|
From: Scott M. <mcm...@ca...> - 2000-11-21 18:35:42
|
Alexander Rawass wrote: > > Hi, > > I wanted to say that I'm already a member on sgl-dev mailing-list, so > you don't need to mail it to be and the list :-) I only do it because sometimes Sourceforge gets really backed up and it could be as long as 10 hours before an email gets posted to the list. If I send it to both, you will be assured of getting it quickly and it will get into the achives. I will only send it to the list from now on if you prefer. > But I 'turned' my ship all around, and in no diretion anything was > visible, if it was just the camera rotation, I would have seen the > spaceship I am heading to after I rotate round, but nothing anywhere at > all. I can't begin to speculate about what the problem is. > > > > 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. > > > > That sglLight class should give you a good start on a replacement > > for PLIB's lights. Note, that all ssgLights are infinite lights. > > It does not appear that you can set the 4th component of the lights, > > and they are initialized to zero. > > <cough> (GL-newbie question) What is the 4th component of the lights? I am sorry...bad typing. I am referring to the 4th component of the light's position (the w component). If this is set to 1.0 the light is put at that position in the 3D scene. If this is set to 0.0 they are set at an infinite distance away in the direction of the position. For example, a position of (1.0, 0.0, 0.0, 0.0) puts the light at infinity along the x-axis. The result is all the light rays come in parallel along the x-axis in the -1 direction. Because the rays are parallel (I believe) the lighting calculations are simpler. > <scratch my head> I am more a GL-newbie, so I don't know the correct > terms etc., but: > > I thought a plib light would be a sphere of light shining off from the > given position in all directions (unless set to headlights, which I > don't do) - and the light doesn't get weaker, I think. That is the behaviour when the 4th component of position is 1. > To setup lights in TuxFleet, I only use plib calls, so if there's > anything that plib does automatically and sgl not - there could be a > problem. That is why I gave you an sglLight class to take care of this. > I usually set the lights at coordinates x=50000 y=-500000 z=50000 (to > resemble a far away sun - the light source should be like a sun) with > following parameters for the each sun: > > color sun_ambient 0.7 0.7 0.7 1.0 > color sun_diffuse 1e-3 1e-3 1e-3 1.0 > color sun_specular 1e-20 1e-20 1e-20 1.0 I would set your position to (1, -1, 1, 0) it won't be attenuated. And I wouldn't worry about small values like 1e-3 and 1e-20. It would be simpler just to set them to 0.0. > Are my lights too weak? Too far away? I probably wouldn't use 0.7, no point in unecessarily darkening the entire scene. > One more comment: > > What about scaling of objects? > I do the scaling inside TuxFleet myself, the matrix I pass to plib is > already scaled correctly. Which matrix? > Do I have to scale the objects differently with SGL? I would recommend that if you want to scale a given model that you place an sglScale node above the model in question. I will have to write a flatten function later to make this more efficient. > I also had a look at the demo models with sgl (with testLoaders): > > I didn't see textures on these models (and I didn't find *.obj with > textures on it in my collection), so can you make me a demo *.obj file > with textures to download or a place where to find? This is a long story. The obj models have hardcoded paths to the material and texture files. Right now SGL does not have the texture or model path functionality (I am working on something right now). Until that time you need to run testLoaders from within any subdirectory of the top sgl directory. For example: % cd bin % platform.linux.i686.dbg/testLoaders.exe ../models/test4.obj One of the faces of the cube should have the wood texture. -- Scott McMillan mailto:mcm...@ca... Cambridge Research Associates http://www.cambridge.com 1430 Spring Hill Road, Ste. 200 Voice: (703) 790-0505 x7235 McLean, VA 22102 Fax: (703) 790-0370 |