glOrtho question

F923e021a633170fb10416df23dffddd
0
urika 101 Nov 18, 2003 at 11:38

when using glOrtho is my camera always at (0,0,0) ?
can i change it using gluLookAt?

12 Replies

Please log in or register to post a reply.

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Nov 19, 2003 at 10:18

you can change the modelview matrix but there isn`t much sense in using gluLookAt in that situation is there ??? why do want to do that ???

F923e021a633170fb10416df23dffddd
0
urika 101 Nov 20, 2003 at 13:51

i have an app that shows a map in 3d ih have 2 modes perspective and ortho
in perspective u can move the map around and stuff and in ortho u see the map from above.
i made a zoom button that moves the camera forword and backword using gluLookAt , i works great in perspective but doesnt do anything in ortho , i wonder how can i do it in ortho as well
thanks

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Nov 20, 2003 at 19:59

assuming that the camera is at 0,0,0 you’d just have to move it back or forth a little… i haven’t used glOrtho much in the past so i’m jsut guessing

F923e021a633170fb10416df23dffddd
0
urika 101 Nov 26, 2003 at 11:23

thats the point , in perspective it works , in ortho it does not

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Nov 26, 2003 at 21:51

specify “not working”.

it is working. it does something. but not what you possibly expect.

explain/show what it does, and what it explain how it should look..

F923e021a633170fb10416df23dffddd
0
urika 101 Nov 27, 2003 at 14:28

i press on the zoom button , the camera comes closer to the object (i know that , because if i return to perspective mode i see the object closer) bu i don see any differance on the sreen.
the object looks exactly the same in glOrtho no matter how many times i zoom in or zoom out

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Nov 27, 2003 at 16:01

no wonder. orhto has no perspecive =?> it will always look the same no mather how near or far you are..

it’s not a bug, it’s a feature

2b97deded6213469bcd87b65cce5d014
0
Mihail121 102 Nov 27, 2003 at 16:25

That’s true davepermen. With the tutorial i’m sending this week you’ll find out why exactly…

F923e021a633170fb10416df23dffddd
0
urika 101 Dec 07, 2003 at 10:17

i didn’t say it was a bug , for me it is though.
is there any way around it?

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Dec 07, 2003 at 13:11

yes. scale your scene, or the viewport (the width/height in the ortho) to zoom, move the cam with glTranslate to.. move

F923e021a633170fb10416df23dffddd
0
urika 101 Dec 07, 2003 at 13:34

works great thanks

13bbbd1f6a9f143eee8bfb45aefda798
0
AKKUMAR 101 Sep 01, 2004 at 21:36

To make it more clear, orthographic projection is actually perspective projection at infinite distance. That is the reason, irrespective of if you go near / far , it appears the same.
The field of view ( FOV) is really large and so it does not affect the FOV , if you move a little bit further / not.
That is the reason why it does not work.