Three.js orbit control rotate and focus object - three.js

I am using Threejs and oribt control.
I want a feature, if I give the object name. orbit control should rotate and focus ( make visible in center of screen ).
Could some one help me on this?
Thanks,
Sabari.

Related

How can i zoom to specific part of a model when clicked on that part in three.js?

I have been trying to zoom into specific part of a model on click. I have managed to do it for the default axes but the issue is that my orbit controls are enabled and when i rotate the scene my axes changed and now when i click it zooms into another part of model?

Camera rotation lost when i use orbitcontrols three.js

I am developing a web application that uses 3d buildings as models. I want to create a button that places the camera so that the model is in a suitable position, however when I rotate the camera manually the mouse control resets it again.
Sample here:Link
If I enable //controls.update() the rotation doesn't work. With //controls.update() disabled the camera rotate fine but when I use the mouse, the camera is reset.
¿What can I do? Thanks!
You shouldn't directly change the rotation of the camera, instead you should change the position+target.
When you call controls.update() the rotation of the camera will be calculated based on the position of the camera (the location of the camera) and the target of the controls (the location of focus).
For example you can do:
controls.target.set(0,0,1);
camera.position.set(-0.041, 1.9, -1.21);
controls.update();

How do I put an interactable Canvas onto a 3D game object?

Is it possible to place a UI Canvas onto a 3D object? I'd like to create a cash dispenser machine (for example) with a user interface that can be interacted with. Then there will be keycode locks on doors, touchscreen computers, etc.
How can I display a canvas as a 3D object in the 3D world and still have it interactable? Placing it on a Plane would be good enough.
Yes, it is possible. Change Canvas Render Mode to World Space then drag your Camera into the Event Camera slot. You will have to find select the Canvas, press F in Scene View to find it then move it to the place you want it to be.
You need to use World Space UI. Can place anywhere in scene but make sure use can view it in order to interact.
To learn more, watch this video : https://blogs.unity3d.com/2014/06/30/unity-4-6-new-ui-world-space-canvas/

3D Image in Three.js

http://threejs.org/examples/#webgl_geometry_large_mesh
http://threejs.org/examples/#canvas_lights_pointlights
Please see above link. Can anyone please tell how to create and render moving person or statue?
using three.js you can easily create and render moving person or statue
on the first link the statue is no moved , it is done using camera animation(changing the position of camera accoring to the movement of mouse in the canvas)
for a moving person ,you should go for morph animation
morph animation three.js

Threejs Rotating object with device orientation control

I am trying to achieve an effect similar to one of the cardboard app examples that Google has put out with their cardboard app called the 'exhibit'. I have a 3D object that I want to rotate using device orientation control. Right now with just the device orientation control, I can view the 3D object but when I turn around, the camera rotates (it seems) causing the object to fall out of view until I turn all the way back around to where it was in the beginning. In other words the camera seems to rotate in its axis as I look around. What I want is to be able to rotate the object as I turn around.
Kinda like this example http://threejs.org/examples/#misc_controls_orbit except I want to rotate using device orientation control.
Any idea how I can incorporate this feature?
Thank you for your assistance.
The answer to my own question for future seekers is to replace camera in
controls = new THREE.DeviceOrientationControls(camera, true);
with the 3D object you are trying to rotate.

Resources