three.js - How to select a root Object3D using Raycaster -



three.js - How to select a root Object3D using Raycaster -

i have parent object3d has kid meshes. how can utilize raycaster select root parent object?

my example

if have parent object3d has multiple kid meshes, , want select parent raycasting, can following:

add parent object array of objects:

var objects = []; ... objects.push( root_parent_object );

add each kid object pointer root parent object:

child.userdata.parent = root_parent_object;

pass in recursive flag intersectobjects().

var intersects = raycaster.intersectobjects( objects, true );

now when raycaster intersects kid object, can obtain root object.

three.js r.68

three.js

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -