let scene, camera, renderer,controls;
let objects=[];
//Creating Scene
scene = new THREE.Scene();
//Creating Camera
camera = new THREE.OrthographicCamera(window.innerWidth / - 50, window.innerWidth / 50, window.innerHeight / 50, window.innerHeight / -50,0.1,1000);
camera.position.set(13,13,13);
camera.lookAt(scene.position);
//Creating renderer
renderer = new THREE.WebGLRenderer({antialias:true});
renderer.setSize(window.innerWidth,window.innerHeight);
document.body.appendChild(renderer.domElement);
controls = new THREE.OrbitControls(camera, renderer.domElement );
//Adding Lights
var light = new THREE.DirectionalLight(0xffffff, 0.5);
light.position.setScalar(1);
scene.add(light);
scene.add(new THREE.AmbientLight(0xffffff, 0.5));
function vehicle(){
var geometry2= new THREE.BoxBufferGeometry(5,5,5);
var material= new THREE.MeshBasicMaterial({color:"brown"});
var head= new THREE.Mesh(geometry2,material);
var geometry1=new THREE.BoxBufferGeometry(8,4,5);
var material1= new THREE.MeshBasicMaterial({color:"green"});
var body= new THREE.Mesh(geometry1,material1);
const geometry = head.geometry;
const positionAttribute = geometry.getAttribute( 'position' );
const vertex1 = new THREE.Vector3();
vertex1.fromBufferAttribute( positionAttribute, 0 );
head.localToWorld( vertex1 );
console.log(vertex1);
const vertex2 = new THREE.Vector3();
vertex2.fromBufferAttribute( positionAttribute, 1);
head.localToWorld( vertex2 );
console.log(vertex2);
const vertex3 = new THREE.Vector3();
vertex3.fromBufferAttribute( positionAttribute, 2 );
head.localToWorld( vertex3 );
console.log(vertex3);
const vertex4 = new THREE.Vector3();
vertex4.fromBufferAttribute(...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.