PDA

View Full Version : How can I autorotate?



John Jenkins
12-20-2002, 05:36 AM
I am using the trackball class to do matrix rotations on my graphics. A problem that I have is that the data I read in goes up down forward and back. Preferibly I could autorotate it so that it is oriented left to right. Eventhough it is easy to rotate with the mouse, the boss wants it to come up left to right. Here is the basic idea of what I do. I read in a thousand data points and graph them in 3D space (They are a thousand coordinate points).
What I am trying to figureout how to do is auto orient it and add the ability to default back to that orientation. Ok I think that gives the gist of it.

John Jenkins
12-20-2002, 07:47 AM
I have this idea to use the glulookat function. If I take the first and last points in the graph and come up with a funtion for the two points and get a slope of the function, I can then find the perpendicular slope to that point and set that as my up. Hmmm now if I only knew how to use glulook. Anyone aware of sample code that uses that function?

satan
12-20-2002, 08:50 AM
http://www.cevis.uni-bremen.de/~uwe/opengl/gluLookAt.html

Easy enough I think.
If you have any specific questions just ask.
And btw google is your friend http://www.opengl.org/discussion_boards/ubb/smile.gif.

John Jenkins
12-20-2002, 09:08 AM
Thanks satan