|
From: Alexander R. <a_r...@in...> - 2000-11-24 03:58:02
|
Hi,
Scott McMillan wrote:
>
> 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 draw the 2D boxes after setting openGL to '2D' with
glOrtho(0.0 , winx , winy, 0.0 ,-1,1);
I calculate the 2D coordinates of the boxes from the 3D coordinates
without openGL and then do some GL_LINES in 2D.
> > spaceships, and the boxes are just 'near' the place where the ships get
I mean:
The FOV of the 3D models getting drawn with SGL and the FOV that the
2D-boxes use to get drawn are not the same, so you can see the ships at
a position and the boxes are near (in terms of mm on the monitor) the
ships, and if you move or rotate it gets worse - it feels as if the FOV
of the ships would be greater than the FOV of the 2D boxes.
> > 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
Yes, I've seen that.
> tested by PowerScene. You do realize that you need to send the FOV
> in radians to the buildFrustum command?
Yes - but it took me some time until I did :-(
> 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),
Shouldn't matter, since I set it.
> 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).
Ok, coming back to scaling (exept for the lighting effect the models are
correctly scaled) :
The matrix I pass to FleetSceneObject::setTransMatrix is correctly
scaled, the direction vectors in the matrix are scaled and are
orthogonal but not orthonormal.
Should I do the scaling differently?
> Alternatively, it could be a bug with Mesa, which PLIB doesn't exercise
> although I couldn't imagine what off-hand.
It's the Nvidia-GL drivers.
> 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.
Don't matter, it has time - and in between, I'll try to work it out for
myself.
Alex
--
Alexander Rawass
Email: ale...@us...
Project Homepage: http://tuxfleet.sourceforge.net
...but some day you'll be a STAR in somebody else's SKY...
|