Change point of rotation for Mouse Rotate

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Change point of rotation for Mouse Rotate

gandalf
I am using MouseRotate in my application to rotate around a group of cubes(more like rubic's cube). I cannot figure out a way to change the point of rotation of my cube. Please find below a screenshot of my program, the circle indicates the origin around which the cube rotates by default. Let me know if I can explain my problem any better.

Reply | Threaded
Open this post in threaded view
|

Re: Change point of rotation for Mouse Rotate

gouessej
Administrator
Hi

As far as I know, you can only act on the transform group that you use to create a MouseRotate. Look at the source code to understand how the transform is used:
https://github.com/hharrison/java3d-utils/blob/master/src/classes/share/com/sun/j3d/utils/behaviors/mouse/MouseRotate.java#L235
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Change point of rotation for Mouse Rotate

gandalf
Sorry I couldn't make my question clear. I just wanted to know if the point of rotation could be changed from origin (0,0,0) to some other point(x,y,z).
Reply | Threaded
Open this post in threaded view
|

Re: Change point of rotation for Mouse Rotate

gouessej
Administrator
Your question was clear, I just tried to explain to you that as Java 3D is open source, the best way to understand how it works consists in looking at its source code. You might have to write your own "MouseRotate" to obtain the desired behavior.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Change point of rotation for Mouse Rotate

gandalf
Thank you so much. I will get to it right away.