|
From: Scott M. <smc...@er...> - 2000-11-22 05:38:47
|
Alexander Rawass wrote:
>
> Ok, see the files in attachment:
>
> When I start tuxfleet now, I can see the spaceships rotating in space,
> they are also correctly positioned and scaled
> But the fov isn't set correctly, I draw with openGL boxes around the
> spaceships, and the boxes are just 'near' the place where the ships get
> draw.
You would have to be a bit more precise about what you mean by 'near'.
Besides how do you draw boxes around them? Do you draw 2D boxes on the
near clip plane or do you put something in the scene graph?
> I tried a closer look at buildFrustum and applied some changes, but
> didn't succeed doing anything better.
> I suspect that buildFrustum is somehow not correct - when I increase the
> fov in TuxFleet by typing < > , or ., that doesn't work correctly - if I
> steadily increase fov_y by 1 for example, the fov gets wider - mostly -
> but at some values the ships simply vanish until I increase the fov
> further.
I am 99% sure my build frustum code is correct. Some of the equations
were taken directly from Mesa. And besides, it has been heavily
tested by PowerScene. You do realize that you need to send the FOV
in radians to the buildFrustum command?
When I sent you code once I know I initialized the fov_x and fov_y
values incorrectly:
fov_x(60.0*180.0/M_PI),
fov_y(45.0*180.0/M_PI),
It should have read
fov_x(60.0*M_PI/180.0),
fov_y(45.0*M_PI/180.0),
If you choose to set fov_y to -1.0 you must make sure that win_x and
win_y are the same size as the window or the frustum won't work.
> There's also a lighting problem:
>
> All ships are draw with much too much light - so much light that you
> can't even see the contoures of the ships, changing the values in
> TuxFleet's configuration file has no effect.
This is might be a problem with how you are scaling the models. If
there
is a bug in SGL it might not be renormalizing the normals (I doubt it
though).
Alternatively, it could be a bug with Mesa, which PLIB doesn't exercise
although I couldn't imagine what off-hand.
Or, it could be a difference between the sglLight code and the built-in
PLIB lights.
Without being able to run your code, I couldn't begin to figure this
out. I am not sure I have time right now.
scott
--
Scott McMillan Email: smc...@er...
|