I have Vector3
in position.
I have scene
childs:
planet = new THREE.Object3D();
city= new THREE.Object3D();
street= new THREE.Object3D();
scene.add(planet);
planet.add(city);
city.add(street);
how can i get correct world position of vector in each object(planet
,city
and street
individually), with respect to position,scale and rotation of each object..
i try planet.worldToLocal(new THREE.Vector3( vector.x,vector.y,vector.z )
but it seem to work only from global to child object, not for recalculating from planet
to city
.
example:
planet.position.set(10,0,0);
city.position.set(10,0,0);
street.position.set(10,0,0);
if myVector
is new THREE.Vector3(0,10,0)
, i need to get the same position in street object, that should be (30,10,0)
how to get it by THREE functions??