mrdoob/three.js — Issue #648: ColladaLoader creates two copies of same object
Author: Codeguyross
Created: 2011-10-13 18:23:19+00:00
State: open

I was experimenting with the collada loader and attempting to select different object created by the loader when I noticed that something odd was happening. When attempting to select an object, an alternative object was being selected. I did a little investigating and determined that the were two identical objects being rendered.

I wanted to check here and see if anyone knew why there were two objects being created.

Thanks for helping!,

Codeguy

In case anyone wanted to see the loader I am using or the object selection code:

var loader = new ColladaLoader();
loader.load( '../three.js/models/sample.dae', function colladaReady( collada ) {
dae = collada.scene;
skin = collada.skins[ 0 ];
init();
animate();
} );

Picker code -The intersects variable will contain all object under the mouse cursor when clicked

function onDocumentMouseDown( event ) {
event.preventDefault();
var vector = new THREE.Vector3( ( event.clientX / window.innerWidth ) * 2 - 1, - ( event.clientY / window.innerHeight ) * 2 + 1, 0.5 );
projector.unprojectVector( vector, camera );

var ray = new THREE.Ray( camera.position, vector.subSelf( camera.position ).normalize() );

var intersects = ray.intersectObjects(scene.objects);
}