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: Problem AR: Modelview and projection matrices

  1. #1
    Junior Member Newbie dehabu's Avatar
    Join Date
    Jul 2010
    Location
    Spain
    Posts
    3

    Problem AR: Modelview and projection matrices

    Hello everyone,

    I'm developing an augmented reality framework for educational purposes. I have created all needed method excepting the module that shows 3D objects.

    By now my intention is show a cube, but I'm having a lot of problem with the geometric consistency. It seems an easy task at first, but I've spent a month of my time trying stuffs and reading documentation.

    This is the issue:

    A camera is calculated from point correspondences. In this case the structure of the camera is K[R | r] (a typical nomenclature in computer vision).

    K = A transformation which contains the focal length
    R = A rotation matrix, encoding the camera orientation
    t = A translation vector, encoding the position of the camera

    Furthermore, in computer vision it's typical to consider the origin at the top-left corner of the image, but in OpenGL the origen is at the left-down corner.

    I have tried to put the focal length into the Projection matrix using gluPerspective and the equivalent fovy. In the Modelview matrix I've loaded the [R|t] matrix (I loaded both by columns).

    To ensure that my original camera is right I'm drawing a cube using ortho2D projection and the original camera. The result is right.

    In short, when I draw objects using the ortho projection and the original matrix all works fine. When I "break" the original matrix and then I put each piece in a OpenGL matrix the result is wrong.

    Could somebody help me?

    Thanks.

  2. #2
    Junior Member Newbie dehabu's Avatar
    Join Date
    Jul 2010
    Location
    Spain
    Posts
    3

    Re: Problem AR: Modelview and projection matrices

    I've solved the problem.

Posting Permissions

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