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: View Cube

  1. #1
    Intern Contributor
    Join Date
    Oct 2011
    Posts
    52

    View Cube

    Im working on a 3D modelling program. I have a view cube in the bottom left corner. I want to draw it in perspective mode, but when I look down the negative Z(initial camera angle), I only want to see its front side(Like its drawn in the centre of the window) I dont want to see the Top and Right sides like on the pic:

    http://uploadpic.org/v.php?img=M4hlwF8ATp

    Is there a way to do that?
    Thanks!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    If you want to draw in perspective mode there is always some potential to see the sides but to get the effect of the cube in the centre of the window, set a viewport in the bottom left corner (something like glViewport(0,0,50,50)) and render to it with a camera parallel looking straight at the cube - just like you would if you wanted to draw the cube in the centre of the window.

  3. #3
    Intern Contributor
    Join Date
    Oct 2011
    Posts
    52
    Thanks! It works now.

Posting Permissions

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