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 2 of 2

Thread: Translation

  1. #1
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    1

    Translation

    Hey guys I am pretty new to opengl. My question probably has a really simple fix.

    I have a plane and the center of my plane is at the origin.(Its a 2d plane)

    I ask the user to give me a scalar number(distance from the plane for me to move the plane), and according to that number I need to Translate my plane in a 3d coordinate system.

    I am assuming since my plane is 2d in 3d coordinate system my plane normal [0,0,1].

    I use
    Code :
    glTranslatef(0,0,distance)
    But it wont translate it where I want it to.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    The effect you see on the screen will depend on your projection matrix. If you are using an orthogonal projection (usual in 2D) you will not see any effect when you project into the screen (ie change z).

Posting Permissions

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