PDA

View Full Version : hmmm, prob with 3d, again



Andrew Davey
03-30-2004, 04:29 AM
I have finally got something to draw on screen using 3d, am drawing lines at the moment. I have set the ortho to:

glOrtho(100.0,-100.0,100.0,-100.0,100.0,-100.0);

and have set the lookat to

gluLookAt(0,0,0,0,0,60,0,1,0);

The idea of the look at it from far back.

What is meant to happen in my program is a line should get animated, but when i draw the initail line it does the following, excuse the ascii art:


-----------|------------
| | |
| | |
| | |
| | |
| |
| |
------------------------hopefully from that you should work out that the line does not start as a dot, as it should and on the first frame is drawn like that.

Can you see anything wrong with the ortho or look at, am using projection matrix and all of these settings are in the Display() function.

Can someone shed some light on what it might be. It could be a coding problem with my code, am looking into that now.

Andrew Davey
03-30-2004, 05:16 AM
solved the problem guys, the problem was that for some reason the pixel drawing, or line drawing was magnified by 100, some how. Dont know really, any ideas?

Now to get it to animate as it should the growth has to be 0.01 and not 1.

I dont understand why this could be so, can anyone suggest a reason??

Cheers

eror
03-30-2004, 05:26 AM
There is no perspective in orthographic view. So far and near (but same) objects have same size. I don't know how big are your objects and it is hard to me to said if this is the reason for magnified objects (probably yes).

And I don't think using gluLookAt() in ortho-view is the best idea but maybe I am wrong.