|
From: Alexander R. <a_r...@in...> - 2000-11-17 02:55:46
|
Hi,
first thanks *a lot* for modifying the fleet_scene_* files I sent you,
that was more than I expected :-))))
In attachment the modified/compiling version of these files.
I also attached the plib-ssg version of TuxFleet for comparison.
But no 3D models get drawn on the screen yet :-(
Scott McMillan wrote:
>
> First, it is unfortunate you use the testLoader program has
> the example for some aspects of SGL. It illustrates a complex
> way of doing traversals. Some of the simpler test programs
Which exactly?
> are better for this. I am enclosing changes that I have made
> to your class (I have not compiled this b/c I don't have the
> TuxFleet or PLIB installed)....
As soon as TuxFleet works better with sgl I will give out a new release
with some demo *.obj models and demo mission/model files for sgl.
> Here are some comments:
>
> - In order to better help you I need to understand what the
> member functions are supposed to do. For
> example what does it mean to "setup the ith light", are fov's
In setupLight I try to set them all to off, to switch them on back later
in setLight ... setupLight is just an old kludge to test something.
> in radians, are fov values half field values, how are the
The FOV is given in degrees, fov_x=45 means you can see 45 degrees left
and 45 degrees right.
> lights supposed to behave? etc. etc.
The lights are turned on and positioned in setLight, their position is
given in absolute coordinates, they should shine a ball of light in all
directions.
> - You must make sure that a proper graphics context is current
> when calling sgl::initialize() which means when you construct
> this object.
I should have, I'm calling that when GL is fully initialized (for plib
I'd call ssgInit() at that time)
> - Also are you driving the view postion and orientation by
> setting the camera view matrix? That is, do you have some
> external code that determines where you are in the 3D
> world and then you call FleetSceneSGL::setCamera. If
The camera position is given in absolute coordinates, I'm calculating
that on my own.
> this is the case, then you do not really need the zup_camera.
Aah - I got confused because in the testLoaders example you were using a
view_matrix as well a Polar-Camera.
> In the code I am sending back I have removed this.
> I also may need to know what the implied coordinate system of
> the viewing camera is supposed to be.
z shows up
x shows right
y shows forward
> - SGL does nothing to set up the proper viewport or GL projection
> matrix. If you do not do this elsewhere than there need to be
> commands in FleetSceneSGL (the sglu cameras do not do this
> for you). I have added a call to set up the projection matrix
> but the glViewport command is missing.
I put a glViewport(0,0,640,480) in, but no change.
> - SGL does not currently have support for lights in the scene.
> If these lights need to in a constant position relative to the
> scene (and not the viewer) then additional code is needed in
> cullAndDraw to make sure they are positioned after the camera
> matrix is applied. I have implemented a crude way to do this
> in the code I am sending you, but I really don't know what the
> proper functionality was so I made some guesses.
I've got no big light-system at the moment.
Currently, 1-3 lights are set up on startup on absolute positions, they
never move or change after that.
> P.S. If the intent is to not depend on any PLIB code, then the
> interface to wrapper classes like this (and any other core code)
> should not depend on types defined in PLIB (or SGL). That is,
That's true for class FleetScene, although I'll never get rid of plib-sg
(simple geometry math routines) in my engine/game code.
> you should not pass parameters of type sgVec4. Instead you
> should use something more generic like float[4];
I'll change that.
Some comments on the files you sent me:
from buildFrustum:
void FleetSceneSGL::buildFrustum();
{
float x2 = near_clip*tan(fov_x*0.5);
float y2;
if (fov_y == -1.0) // square pixels
{
y2 = x2*(float)win_y/(float)win_x;
}
else
{
float t = near_clip*tan(fov_y*0.5);
^^^^^^^
}
I expect this float t should mean float y2?
void FleetSceneSGL::setupLight(int i)
{
// HACK only support 8 lights for now:
I thought that GL can only use 8 lights at all? (GL-newbie!)
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... |