Skip to content Skip to sidebar Skip to footer

Three.js: Access Scene Objects By Name Or Id

I'm generating objects from an array which I've defined like this (It's not limited to these three): var links = [['Linkedin','img/linkedin.png','-300','-230', '600'],

Solution 1:

You can do this:

myObject.name = "objectName";
...
varobject = scene.getObjectByName( "objectName" );

or to recursively search the scene graph

varobject = scene.getObjectByName( "objectName", true );

Alternatively, you can search by ID.

varobject = scene.getObjectById( 4, true );

three.js r.61

Post a Comment for "Three.js: Access Scene Objects By Name Or Id"