Graphic Rotation

Discussion in 'C' started by friendsforniraj, Dec 2, 2006.

  1. friendsforniraj

    friendsforniraj New Member

    Joined:
    Nov 24, 2006
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    studying
    in graphics
    what to do to rotate an object about a particular pt.
     
  2. Frank Reich

    Frank Reich New Member

    Joined:
    Nov 28, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    HI. What do you use to display your graphic? OpenGL?
    You should give more information if you would like us to help you :D
     
  3. friendsforniraj

    friendsforniraj New Member

    Joined:
    Nov 24, 2006
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    studying
    ohh sure
    i want to rotate it through c programmin usin putimage and getimage func
    i open it by using gmode ginit and gdriver
     
  4. Frank Reich

    Frank Reich New Member

    Joined:
    Nov 28, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    sorry, in that matter i can not help you. i am only a bit familar with OpenGL.

    good luck.
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You have to calculate left and top based on the rotation you want combining with the getimage is done from.
     
  6. friendsforniraj

    friendsforniraj New Member

    Joined:
    Nov 24, 2006
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    studying
    please explain in detail
     
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    The detail is that you need to perform some basic calculations.
     
  8. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    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.
     
  9. friendsforniraj

    friendsforniraj New Member

    Joined:
    Nov 24, 2006
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    studying
    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
     
  10. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    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?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice