Re: X Rotation using MouseBehaviorJ3D

Hi Jason,

> I've hooked up three sliders bars to a control the x,y,z rotation of a 
> ProjectionControlJ3D object.  I've been using the MouseBehaviorJ3D 
> unmake_matrix method to get the current matrix.  I then make changes to the 
> matrix based on my slider bars, and then call the MouseBehaviorJ3D 
> static_make_matrix method to build my new matrix.  I've noticed when I do 
> this that both the Y and Z rotation values range from -180 to 180 degrees, 
> but the X rotation ranges from 0 to 90 then down to -90 and back to 0 
> degrees.  Is there a reason that  the X rotation uses a different range than 
> the Y and Z rotations?  Is there a way to get all three rotations using the 
> same range without writing some kind of hack?

In MouseBehaviorJ3D.static_make_matrix() you'll see that
the x, y and z rotations are all handled the same, except
for the order they are applied. The order is z, then x,
then y. I haven't worked out the consequences of this
order, but 3-D rotations are notoriously complex (see
any book on quaternions) so wouldn't be suprised by an
explanation of the behavior you describe. Perhaps someone
else on the list has worked through this.

Cheers,
Bill


  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: