Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i have a rectangle drawn with openGL. I want to rotate that rectangle based on mouse movement
i mean,when i move mouse on clockwise diretion, then the rectangle should move clockwise direction, and if i move the mouse on anticlockwise direction, then the rectangle should move on anticlockwise direction.
how can i do this in vc++

thank you in advance
Posted

1 solution

Find the nAngle based on movement in X or Y direction...

C#
glRotatef( nAngle, 0,0, 1 );
glRectf( -0.5, -0.5, 0.5, 0.5 );
 
Share this answer
 
Comments
Jijesh Balakrishnan 11-Jul-12 0:20am    
Thank you for your reply
but i have one doubt, how can i get the value for nAngle?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900