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

Thread: access x, y, z after transformations?

  1. #1
    Intern Newbie
    Join Date
    Sep 2013
    Posts
    31

    access x, y, z after transformations?

    At first I took it for granted but it turned out I don't have access to x, y and z directly for a model, after I draw it at some coordinates resulted from a series of rotatef()/translatef() transformations. I'm not sure even now I can't.
    Question: what's the way to get x, y, z?
    The only way I can think of to do it is to store the final matrix and retrieve it next frame and work up on it but it is both resource consuming and it looks sooo smelly.

  2. #2
    Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Location
    Innsbruck, Austria
    Posts
    281
    You mention rotatef and translatef, so I assume you are using OpenGL(R) 2.x or older.

    Perhaps the simplest way would be to take your transformation matrices and transform the model data "manually".

    WIth OpenGL(R) >=3.0, you could use transform feedback.

    With older OpenGL(R) version, you could maybe, somehow use feedback mode, but I'm not quite sure on that (never used it myself).

  3. #3
    Intern Newbie
    Join Date
    Sep 2013
    Posts
    31
    Thank you, I guess I'm going to do it manually.

Posting Permissions

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