I have a problem that when i use DragControls on an object like cubes or cylinders or spheres it works: i can drag these objects but when i use it on loaded objects with OBJLoader it doesnt work i cant drag them
ps : i’m using OrbitContols also and it works fine with Geometry objects but not with loaded objects
- Could you please share a live example / jsfiddle / codepen, showing how you use the DragControls?
- Just a general note - when you load a model (regardless of model format), it usually isn’t only a single mesh. Most models consist of a Group / parent mesh and several submeshes within it.
this is a github link to my project you can check it out, i’ll edit my post too.
/cc
I’ve answered you at stackoverflow.
thanks so much bro God bless you <3
if someone is wondering what the solution is, its Mugen87 solution, credits to him :
The problem is that the OBJ loader does not return an instance of THREE.Mesh
but THREE.Group
. You have to traverse through the group and add all meshes individually to the objects
array. So :
object.traverse( function( o ) {
if ( o.isMesh ) objects.push( o );
} );
1 Like