Results 1 to 2 of 2

Thread: Orthogonal and perspective projection at the same time.

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    5

    Orthogonal and perspective projection at the same time.



    I want to draw in multiple views.
    In the above picture, View1 is Orthogonal projection view and View2 which contains a cube should be perspective and View3 which contains the label on the cornor of the cube should be orthogonal.

    How can I make these three views in one view togather?
    And is it possible ?
    I am waiting for Any experience and advice for application structure or
    API or any sample code.

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Orthogonal and perspective projection at the same time.

    You can change the projection matrix whenever you want and it will simply apply to all following glDraw* calls. Your views 1 and 3 are probably supposed to be on top of view 2 so I'd suggest rendering view 2 first. Do you need view 1 or view3 to be depth sorted?

    Your render loop should probably be structured like this:
    Code :
    glEnable(GL_DEPTH_TEST);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustumf(...);
    glMatrixMode(GL_MODELVIEW);
    // draw objects in view 2 here
     
    glDisable(GL_DEPTH_TEST);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrthof(...);
    glMatrixMode(GL_MODELVIEW);
    // draw objects in view 1 here
     
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrthof(...);
    glMatrixMode(GL_MODELVIEW);
    // draw objects in view 3 here
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

Similar Threads

  1. two-point perspective projection
    By dsasha in forum OpenGL ES general technical discussions
    Replies: 3
    Last Post: 06-03-2009, 03:43 AM
  2. Problem with Vincent 3D Library and perspective projection
    By Bomber81 in forum OpenGL ES 1.X - fixed function hardware
    Replies: 3
    Last Post: 03-23-2009, 08:13 PM

Posting Permissions

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