And if I wanted to set the ModelView to a known position, lets say 45deg
around the Y axis and 35deg around the Z, could I just plug those into
the 3x3 section?
> The rotation is the 3x3 matrix in the upper left corner of the 4x4 matrix
> returned from OpenGL.
> If your retrieved matrix is:
> A B C D
> E F G H
> I J K L
> M N O P
> ...then the rotation component is:
> A B C
> E F G
> I J K
> As a 4x4 matrix (what you would need to load), this would be:
> A B C 0
> E F G 0
> I J K 0
> 0 0 0 1
> Hopefully that will do something remotely similar to what you're asking
> -- Jeff
> > >Hi.
> > >My application needs to draw three lines at the lower left corner of the
> screen, which
> > >indicates the 3 axis (x,y,z)
> > >The idea is to make these lines represent the rotation status of the
> axis, so the user
> > >don't loose orientation when rotating the models.
> > lose not loose. (sorry one of my greatest spelling irritations on the
> > net)
> > >So basically I should save current modelview and projection matrices and
> reset them, make
> > >a very small viewport, draw my 3 lines representing the 3 axis and
> restore everything,
> > >including the previous viewport.
> > >That's actually working but the lines are not rotated.
> > >The problem is that these 3 lines must be drawn using the same rotation
> the system is
> > >using right now, and only that. The current modelview matrix might be
> filled with scaling
> > >and translations that the user did in his interaction and I must extract
> from it just the
> > >rotation to draw these 3 lines.
> > >Making the current interaction system give me feedback of the current
> rotation will
> > >require some code rewrite. If I could just extract that information from
> the current
> > >MODELVIEW matrix that wouldn't be necessary...
> > >Any ideas?
> > I've not tried this but want to do something similar.
> > If you set the 4th component of the matrix to 0 (1?) that should get
> > rid of the translation I think.
> > And then maybe normalising the other 3 components will get rid of any
> > scaling.
> > I've not tried this so not sure if it will really work.
> > Dan
> > --
> > remove .hatespam to reply