Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: GLM camera problems.

  1. #1
    Junior Member Newbie
    Join Date
    May 2013

    GLM camera problems.

    I'm having a problem with
    Code :
    My object displays well but when i rotate the view it disappears at about 3/4 of the screen.
    My code:
    Code :
    Projection = glm::perspective(45.0f, (GLfloat)1366/768, 1.0f,6000.0f);
    camera->Position = F3dVector(0,0,30);
    ModelMat = glm::mat4(1.0f);
    View = camera->Render();
    MVP = (Projection * View * ModelMat);
    I think it's a clipping error but I don't know how to solve it.

  2. #2
    Try replacing "(GLfloat)1366/768" by 1.0f

  3. #3
    Intern Contributor
    Join Date
    Jun 2012
    Or try making the third parameter to glm:erspective smaller, 0.001f or so. It could be when you rotate the scene some polygons pass outside the near plane of your viewing frustum.

  4. #4
    Sorry, I misunderstood. "When you rotate" Yes, this can be because of the distance of the nearplane to the camera position.I have came across the same problem before if the actual problem is that. But also there is another problem due to a reason I don't know . I get the result I want only when I make the second parameter 1 when using glm. According to convention of old fixed functionality, this must have been
    the width of the screen / the height of the screen.
    Last edited by newbie_graphic_programmer; 05-28-2013 at 11:05 AM.

Posting Permissions

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