0
votes

In three.js. I have an object(called container)(cube size 2.75,0.40,3.25). If I add 4 smaller objects(called corners)(cubes size 0.25,0.05,0.25) to the corners of the container, how can I get the scene positions of the smaller object(the corners), not the positions that I used to put them in the container.

1
I have figured out what I needed to know. - Mike O
'var hitPntPos = new THREE.Vector3(); var hitPntQuat = new THREE.Quaternion(); var hitPntScale = new THREE.Vector3(); Vehicle.hitPoints[0].matrixWorld.decompose(hitPntPos, hitPntQuat , hitPntScale); //var hitPntRot = new THREE.Vector3(); //hitPntRot = rotation.setEulerFromQuaternion( hitPntQuat, eulerOrder ); alert('hitPoints[0] x,z ' + hitPntPos.x + ',' + hitPntPos.z);' - Mike O

1 Answers

0
votes

Try something like this:

var Pos = new THREE.Vector3();
var Quat = new THREE.Quaternion(); 
var Scale = new THREE.Vector3();
object.matrixWorld.decompose(Pos, Quat , Scale); 

Then you can get the needed info like this:

var neededInfo = Pos.x;//or Pos.y or Pos.z