I use three.js with jsmodeler to load model from obj. Everything works fine but problem is in custom things.
I have list of buttons clicking on each I can select mesh and highlight it, it's working.
var new_material = new THREE.MeshBasicMaterial( { color: color, wireframe: false, opacity:0.5, transparent:true, side: THREE.BackSide } );
mesh.material = new_material;
But I also need to view this selected mesh, somehow to rotate all to turn into view this. I tried some options without luck.
viewer.camera.position.set(mesh);
viewer.camera.lookAt(new THREE.Vector3());
viewer.camera.lookAt(mesh.matrixWorld);
I found example with mouse coordinates but it's not the same. Author of jsmodeler did not respond in 2 weeks so I think I cannot wait for help there.
This is my rough example http://jsfiddle.net/536yb7kg/19/
There is a model. We want to select different parts of it by buttons. I added one button. After selection it highlights one mesh - make it semitransparent black. But we do not see this until we manually rotate this model. I need that it's not only highlighted but also rotates so we can see what we selected by button