Graphic Rotation

friendsforniraj's Avatar, Join Date: Nov 2006
Go4Expert Member
in graphics
what to do to rotate an object about a particular pt.
0
Frank Reich's Avatar
Go4Expert Member
HI. What do you use to display your graphic? OpenGL?
You should give more information if you would like us to help you
0
friendsforniraj's Avatar, Join Date: Nov 2006
Go4Expert Member
ohh sure
i want to rotate it through c programmin usin putimage and getimage func
i open it by using gmode ginit and gdriver
0
Frank Reich's Avatar
Go4Expert Member
sorry, in that matter i can not help you. i am only a bit familar with OpenGL.

good luck.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You have to calculate left and top based on the rotation you want combining with the getimage is done from.
0
friendsforniraj's Avatar, Join Date: Nov 2006
Go4Expert Member
please explain in detail
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
The detail is that you need to perform some basic calculations.
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
As Shabbir says, this is pretty basic stuff. You can consider the line between the point of rotation and any given point (a pixel) as a vector. This vector can be expressed as an angle with respect to some coordinate system. To rotate it, one merely adds the angle of rotation. I suggest you review your trigonometry.
0
friendsforniraj's Avatar, Join Date: Nov 2006
Go4Expert Member
no i have already did that
even if i use getimage i get the image in the memory
but i cannot rotate through putimage as it only use top left corner and not the right corner
and even try to get the coordinates and put the image in new coordinates and do rotation like this
i used write algo but program gets terminated automatically and c gets closed
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
Quote:
but program gets terminated automatically and c gets closed
This is not a rotation-related phenomenon. I suggest that you deside what your REAL question is, then ask it as clearly as possible. "C gets closed"? C is a language. We don't get to use it anymore?