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: Transform between two different viewport

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Posts
    15

    Transform between two different viewport

    I need to draw some specific 3d object, which don't zoom with camera(such as coordinate system).

    For now, I would like to implement this by adopting two different project matrix, which meant that I draw these 3d object in specific project matrx(which don't zoom at all).

    here is problem, while drawing coordinates system, a 3d location and vector direction are provided, I transform 3d point onto screen coordinates by gluProject(spt, using project matrix1), then I translate screen spt onto another 3d coordinates(using project matrix2), then I setup the second camera to draw the coordinates system.

    It seems work, but location is not right. anybody can give me suggestion?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: Transform between two different viewport

    I suggest you set up the projection matrices to get the effect you want. However, it's very seldom a good idea to do any kind of transform except perspective and screen scale in the projection matrix. Usually, you should do what you need in the modelview matrix.

    Note that if you want to draw a coordinate system which matches your object, then you want to use the same world space and projection space, only the "model" part of the "modelview" matrix should be different. See the red book for lots of examples.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

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