Link to home
Start Free TrialLog in
Avatar of jsbsudha
jsbsudhaFlag for Germany

asked on

opengl perspective and orthogonal

By using the function
glortho( 0,0,maxX,maxY,0,maxZ) I can define the viewing volume in my viewport....
I have set the option in the user interface window  to select either ortho view or perspective view..... My coordinate axes x,y,z  lie at the lower left corner of the graphical window in orthographic view...

the problem is if the user selects the perspective view....the picture disappears and it is somewhere in the graphics window.....  and the coordinate axes comes to the center.....
glperspective(45, w/h,1.0, 12000);

is there anything I have  to improve the relation between ortho and perspective....

Thanking you


SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
but anyway a good solution would be to give your client/customer a button in the gui to center the object(s) into the window .. otherwise they're gonna be frustrated very soon, searching for the object .. ;)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
About orign position.
As you have different positions of the orign (lower left for ortho and center for perspective), what you see in ortho is the upper right quadrant (just positive x's and y's) and in perspective, all the four quadrants.

Also, the combination of:
    distance object-viewport   +
    small viewport   +
    different orign positions
can produce what you describe. In the below figure, we notice that the blue object doesn't appear in the viewport (in red) when the method is perspective.
This can be your case.

Jose
ortho-perspective2.GIF
Avatar of jsbsudha

ASKER

thank you for explaining me clearly about the perspective and orthogonal....  I  would like to consider your answer..... Before that my application suddenly shows the runtime exception error...I am in urgent condition to solve the error......I am going to post that question now....
what is the solution for it?I want to make my perspective projection  to start from lower left corner.......like my orthographic projection.....
See the first few posts ;)
I don't want to move my orthographic view to center........
may be I can do translation but.........please wait

i willc ome again