I have an obj model representing a map with tree objects. After successfully loading the model, I am trying to access one specific tree object named Tree1. How can I achieve this?
Currently, my code looks like this:
loader.load( 'map.obj', function ( object ) {
scene.add( object );
var Tree1 = object.getObjectByName( "Tree1" );
console.log(Tree1.position.x + " " + Tree1.position.y + " " + Tree1.position.z);
}, onProgress, onError );
However, it always returns (0,0,0) regardless of which object I select.