Page MenuHomePhabricator

Allow 3D objects to rotate beyond 180° on the Y axis
Closed, DeclinedPublic

Description

When viewing a 3D model in the interactive viewer you can rotate the model "left and right" indefinitely on the X axis. The model will continuously spin as you rotate.

When dragging the model "up and down" along the Y axis there is an invisible limit to the rotation.

Example: https://www.youtube.com/watch?v=QFc5rgPCHR4

If possible, it would be nice to be able to continuously rotate the image along the Y axis as equally as the X.

I may be getting the proper X,Y,Z label incorrect in my description. ¯\_(ツ)_/¯

Event Timeline

dr0ptp4kt added a project: Multimedia.
dr0ptp4kt moved this task from Untriaged to Next up on the Multimedia board.
dr0ptp4kt subscribed.

The next step on this is technical investigation. If it's feasible, probably as a fix that could be contrib'd upstream, we'll take it. If it's a lot of work, we'll re-assess.

MarkTraceur moved this task from Next up to Doing on the Multimedia board.

So, here are the results of my technical investigation:

The library we use to render 3D objects requires that vertical rotation be between 0 + .000001 and pi - .000001, presumably because of some mathematical assumptions they are making that I don't fully understand. Because I would need to cram what I assume is a graduate-level linear algebra course in order to understand, much less alter, their system, I think it is probably not worth our time to pursue this further. However, I could attempt to provide a hack if this is still thought to be worthwhile...it just may not work very well.

Let's avoid a hack. We should file a bug upstream, I think. @MarkTraceurand @Gilles do you know if there's any bug filed upstream on this at https://github.com/mrdoob/three.js/issues ? I tried some searches and it wasn't readily apparent to me if it had been filed upstream.

@Gilles nope - when I change those variables to, e.g., Infinity and -Infinity, the only change is that rotating past the poles will make the camera freak out. I also tried adding in a "restrictPolarAngle" configuration, and not checking the angle in that case, but it didn't help.

It's probably a bug/untested behavior in three-orbit-controls then. But doesn't sound like a bug in threejs per se (the trackball controls don't have that limitation, for instace). You're free to write your own controls plugin, fork this one, etc. There might be other options out there too, I see that the examples folder in threejs has a different version of this one, I'm not sure which one is in use for the extension.

Yeah, I think it's still worth asking whether we really care about this limitation, but if we do, then I'll pursue looking at another control scheme.

dr0ptp4kt added a subscriber: Nirzar.

Based on discussion with @Nirzar we can live without this feature.