Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Q: how to rotate the z-axis to make it face the user?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Los Angeles, CA, USA
    Posts
    116

    Q: how to rotate the z-axis to make it face the user?

    Hi,

    Can someone tell me how to rotate the z-axis such that it will face outward from the screen (toward the human user)? The reason I ask is I want to draw a disk (gluDisk()) that always faces me no matter how I rotate the model. Please help. Thanks.

    Tony

  2. #2
    Member Regular Contributor
    Join Date
    Sep 2002
    Posts
    384

    Re: Q: how to rotate the z-axis to make it face the user?

    glMatrixMode GL_MODELVIEW
    glPushMatrix()
    glScalef 1.0,1.0,-1.0
    //draw your stuff
    glPopMatrix()

    This will flip your triangles, so you need to draw them in reverse order.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Los Angeles, CA, USA
    Posts
    116

    Re: Q: how to rotate the z-axis to make it face the user?

    Hi,

    Thank you for your reply but I don't how it can help simply by changing the z-axis to its opposite direction. I need the disk always face me no matter how I rotate the model. Thanks again away.

    Tony

  4. #4
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: Q: how to rotate the z-axis to make it face the user?

    Do a search for billboarding and specifically point billboards. Point sprites may also interest you.

  5. #5
    Member Regular Contributor
    Join Date
    Sep 2002
    Posts
    384

    Re: Q: how to rotate the z-axis to make it face the user?

    Sorry, I misunderstood.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •