Results 1 to 2 of 2

Thread: Coordinates after rotation ?

  1. #1
    Junior Member
    Join Date
    Nov 2004

    Coordinates after rotation ?

    I have a polygon that is displayed after a rotation. How do I find the new world-view coordinates of that polygon's points after it has been pushed through the rotation matrix?

    Thanks a bunch,

  2. #2

    Re: Coordinates after rotation ?

    I saw your question on the OpenML message board!here's your responce:

    for more information about the rotation, i suggest you to read the book *Interactive Computer Graphics by EDWARD ANGEL*.but in summery, i explain you that how this action is performmed.
    if you rotate about the z axis by theta degrees, you can compute the new points with the following equations:

    Newx = x * cos(theta) - y * sin(theta)
    Newy = x * sin(theta) + y * cos(that)
    Newz = z

    or in matrix form
    Pnew = Rz * P
    where Rz is
    |cos(theta) -sin(theta) 0 0|
    |sin(theta) cos(theta) 0 0|
    | 0 0 1 0|
    | 0 0 0 1|
    For rotation about the x axis, we have the following equations:
    Newx = x
    Newy = y * cos(theta) - z * sin( theta)
    Newz = y * sin( theta) + z * cos(theta)

    And for y rotation:

    Newx = x * cos(theta) + z * sin(theta)
    Newy = y
    Newz = - x* sin(theta) + z * cos(theta)

    Note that with these operations, the coordinate system also is rotated. it means that you actually are rotating both of these objects--polygon and coordinate system.if you use from another rotation before your rotation-because the OpenGL transformations are from down to top-you are changing the new changed coordinat system.
    Ehsan Kamrani
    OpenML visitor

    [ November 06, 2004: Message edited by: ehsan_kamrani ]

Similar Threads

  1. problem with rotation
    By himanshu405 in forum OpenGL ES
    Replies: 4
    Last Post: 07-15-2009, 06:14 AM
  2. Replies: 0
    Last Post: 09-11-2008, 11:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean