![]() |
|
#1
|
|||
|
|||
rotating figure in openglhello
I implemented a rotating cube in opengl which rotates when the user moves the mouse. I am a beginner with opengl, so i wanted to ask you a question on rotating. here is my code for the rotation : CPP / C++ / C Code:
The problem is that i don't know how to make it spin around the z axis when the user moves the mouse. I know that i have to write this function : glRotated(m_zRotate, 0.0, 0.0, 1.0); where m_zRotate is the angle of the rotation in my rendering function. But on mouse move function, how can i implement the z rotation taking into consideration the fact that cz doesn't exist ? only cx and cy - Size variables used in OnSize function. And also my rotation is kind of sudden, not very natural, i don't know why, maybe because it doesn't rotate on the z axis ? Or can you propose a different code for rotation using the mouse with a more natural rotation ? Thank you in advance for your help Last edited by LuciWiz : 11-Apr-2008 at 02:01.
|
|||
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OpenGl | obduk | FLTK Forum | 3 | 06-Apr-2008 05:08 |
| Beginning OpenGL | Xeiph | OpenGL Programming | 4 | 10-Oct-2007 07:07 |
| C++ with OpenGL | BlueFireCO. | OpenGL Programming | 4 | 24-May-2007 16:26 |
| C++ game programming OpenGL | oozsakarya | OpenGL Programming | 2 | 13-Nov-2005 13:50 |
| FLTK and OpenGL | bgarisn | FLTK Forum | 2 | 27-Jun-2005 06:22 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The