OrbitControl rotate itself even pan (drag) to everywhere

I want to do as the same this question Orbit object around changing axis.
Also like this OrbitControls still rotate on model origin even when pan

Exactly like this example. By the way I want to do “Fit” and “Zoom” like the example.

I spent 2 days for researching this. However all of questions that I visited that seem to be not resolve yet.
Please help me.
Thanks in advanced.
P/s: for easier supporting, here is my codepen

nobody helps me :frowning:

Are you looking for something like that?

Dear sir,
I’m looking for some thing exactly like this Autodesk viewer
You do right click to drag the object to somewhere then you do left mouse (orbit) to rotate the object. It still rotates around itself.

Just out of curiousity, should we provide a ready-made solution to you?

Honestly, I’m not an expert in three.js, 3D.
So I appreciate any helps.

Our conversation goes a bit off-topic, but could you put more effort in researching the task and do something yourself? :slight_smile:

Yes, I could. I’d spent 3 days already. Honestly I’m stuck and no way so finally I came here for asking.

The problem is that no control class of three.js can do what you are looking for. Besides, OrbitControl would be a bad starting point since the control mechanism of the Autodesk viewer is more similar to TrackballControls. You can easily see that since it’s possible to move the camera over the poles (in some sense the camera gets flipped upside down). This is not possible with OrbitControl since it retains the original up vector of the camera.

Maybe you can achieve a similar effect by combining TrackballControls with DragControls like in this example. In any event, you definitely need some enhancements if you want an exact replication of the Autodesk viewer control.


Thanks for replying.
I’ll try TrackballControls instead.

Hey there, I’m trying to achieve the same behavior with TrackballControls you described @nxhoang! Any updates on your progress? @Mugen87 the example you linked is unfortunately no longer available. Do you have an updated link? Thanks to everyone :slight_smile:

Try it with this one: three.js webgl - draggable cubes

1 Like