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
Post a Comment