|
From: Scott M. <mcm...@ca...> - 2000-11-13 20:44:53
|
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 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).... 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 radians, are fov values half field values, how are the lights supposed to behave? etc. etc. - You must make sure that a proper graphics context is current when calling sgl::initialize() which means when you construct this object. - 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 this is the case, then you do not really need the zup_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. - 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. - 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. scott 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, you should not pass parameters of type sgVec4. Instead you should use something more generic like float[4]; Alexander Rawass wrote: > > Hi, > > I've been working a bit on fleet_scene_sgl* for TuxFleet. > > TuxFleet compiles for sgl now, it even runs with sgl - but no 3d models > get drawn yet. > > Please have a look at the files in attachment. > Did I make any obvious mistakes there? > > Do I set the Camera correctly? > > Do I initialize the scene correcly? > > Is the cullAndDraw()-routines okay somehow? > > Alex -- Scott McMillan mailto:mcm...@ca... |