You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Raycaster to locate the intersect point when I click a 3D model on map with threebox.
var intersects = raycaster.intersectObjects(tb.scene.children, true);
Then I get the intersects[0].point which seems the coordinate in threebox.scene space.
I am wondering how can I convert intersects[0].point to some coordinate in threebox.world space or longitude /latitude?
Thanks.
The text was updated successfully, but these errors were encountered:
get the coordinate of center on map:
var coordMapCenter = map.getCenter();
var coordMapCenterArray = [coordMapCenter.lng, coordMapCenter.lat, 0];
place the object to the center:
obj.setCoords( coordMapCenterArray );
move the object to intersect point by below code.
obj.translateX(intersectPoint.x/tb.world.matrixWorld.elements[0]);
obj.translateY(intersectPoint.y/tb.world.matrixWorld.elements[5]);
obj.translateZ(intersectPoint.z/tb.world.matrixWorld.elements[10]);
That is how I find to convert coordinate in threebox.scene to threebox.world by chance.
Hello
I am using Raycaster to locate the intersect point when I click a 3D model on map with threebox.
var intersects = raycaster.intersectObjects(tb.scene.children, true);
Then I get the intersects[0].point which seems the coordinate in threebox.scene space.
I am wondering how can I convert intersects[0].point to some coordinate in threebox.world space or longitude /latitude?
Thanks.
The text was updated successfully, but these errors were encountered: