Thread: RE: [Plib-devel] Simple SSG examples
Brought to you by:
sjbaker
From: Dave M. <Dav...@dy...> - 2000-08-03 19:21:51
|
Without debugging it, I noticed that // Create a simple state - no lighting, no texuring etc. ssgSimpleState *state = new ssgSimpleState(); state->disable(SSG_GL_LIGHTING_EN); might be causing problems. Try this instead: ssgSimpleState *state = new ssgSimpleState () ; state -> disable ( GL_LIGHTING ) ; and maybe add: state -> disable ( GL_ALPHA_TEST ) ; state -> disable ( GL_BLEND ) ; state -> setOpaque () ; --Dave > I've only been using sg in my game so far, so I figured it > was about time I got to grips with ssg. As there's a bit of a lack of > ssg examples I figured I write some and kill two birds with one stone. > > So, how much more simple can you get than a white rectangle > on the screen. Which is why I feel a bit lame when I can't get it to > work :) > > Source code is attached - it's v.simple so I can't imagine > what's up with it. > > If anyone get's some time maybe they could take a look. > > Sam > > Hmm..Sudden thought - is the SSG co-ordinate system different > from the OpenGL convention? > > |
From: Sam S. <sa...@sp...> - 2000-08-04 12:50:03
|
RE: [Plib-devel] Simple SSG examples----- Original Message -----=20 From: Dave McClurg=20 To: 'pli...@li...'=20 Sent: Thursday, August 03, 2000 8:22 PM Subject: RE: [Plib-devel] Simple SSG examples Without debugging it, I noticed that=20 // Create a simple state - no lighting, no texuring etc.=20 ssgSimpleState *state =3D new ssgSimpleState();=20 state->disable(SSG_GL_LIGHTING_EN);=20 might be causing problems. Try this instead:=20 ssgSimpleState *state =3D new ssgSimpleState () ;=20 state -> disable ( GL_LIGHTING ) ;=20 and maybe add:=20 state -> disable ( GL_ALPHA_TEST ) ;=20 state -> disable ( GL_BLEND ) ;=20 state -> setOpaque () ;=20 I gave that a go, but I didn't have any luck with it. I also tried = passing normal and texture ararrys rather than nulls in that was having = an effect - no joy. I even tried explicitly setting the camera to the = orign, and still got nothing. I'm obviously missing something very basic in my code :/ Thanks for the reply, Sam |
From: Sam S. <sa...@sp...> - 2000-08-06 10:31:01
|
RE: [Plib-devel] Simple SSG examplesThere were a couple of problems with it - one was my fault (polygon winding issues - should had realised back face culling was on by default, doh! ), and the other is a bug in ssg. The ssgContext class initialises the camera matrix to the identity matrix and not _ssgOpenGLAxisSwapMatrix. So if you do nothing with the camera you end up with opengl's coordinate covention (y is up), rather than ssg's (z is up). Anyway it works now, so by tomorrow I should have some real simple ssg examples to contribute. I've got a simple textured spinning cube, an explosion, and a simple scene you can fly round (using the quaternion routines). Nothing hot, but I always find I learn a damn site quicker from examples than documentation so I imagine these will be of use to people. Sam |
From: Steve B. <sjb...@ai...> - 2000-08-06 18:31:55
|
Sam Stickland wrote: > > RE: [Plib-devel] Simple SSG examplesThere were a couple of problems with > it - one was my fault (polygon winding issues - should had realised back > face culling was on by default, doh! ), and the other is a bug in ssg. > > The ssgContext class initialises the camera matrix to the identity > matrix and not _ssgOpenGLAxisSwapMatrix. So if you do nothing with the > camera you end up with opengl's coordinate covention (y is up), rather > than ssg's (z is up). Hmmm - yes - you are exactly right. I have never written a program where the camera wasn't initialised explicitly. I'll fix it right now. > Anyway it works now, so by tomorrow I should have some real simple ssg > examples to contribute. I've got a simple textured spinning cube, an > explosion, and a simple scene you can fly round (using the quaternion > routines). Nothing hot, but I always find I learn a damn site quicker > from examples than documentation so I imagine these will be of use to > people. Great! Sample programs are always a horrible chore for experts in the API to write (we want to build big, complicated programs)...so ironically, the best source for example programs may well be in people who have just picked up the package and are experimenting with it. Do you want CVS write-access to contribute these examples? If so, I need to know your Sourceforge user ID. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Steve B. <sjb...@ai...> - 2000-08-06 19:09:32
|
Steve Baker wrote: > > Sam Stickland wrote: > > > > RE: [Plib-devel] Simple SSG examplesThere were a couple of problems with > > it - one was my fault (polygon winding issues - should had realised back > > face culling was on by default, doh! ), and the other is a bug in ssg. > > > > The ssgContext class initialises the camera matrix to the identity > > matrix and not _ssgOpenGLAxisSwapMatrix. So if you do nothing with the > > camera you end up with opengl's coordinate covention (y is up), rather > > than ssg's (z is up). > > Hmmm - yes - you are exactly right. > > I have never written a program where the camera wasn't initialised > explicitly. > > I'll fix it right now. ...Done. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Sam S. <sa...@sp...> - 2000-08-07 00:09:40
|
----- Original Message ----- From: Steve Baker <sjb...@ai...> To: <pli...@li...> Sent: Sunday, August 06, 2000 7:36 PM Subject: Re: ssgContext bug and remedy (was Re: [Plib-devel] Simple SSG examples) > Sam Stickland wrote: > > > > Anyway it works now, so by tomorrow I should have some real simple ssg > > examples to contribute. I've got a simple textured spinning cube, an > > explosion, and a simple scene you can fly round (using the quaternion > > routines). Nothing hot, but I always find I learn a damn site quicker > > from examples than documentation so I imagine these will be of use to > > people. > > Great! > > Sample programs are always a horrible chore for experts in the API to > write (we want to build big, complicated programs)...so ironically, > the best source for example programs may well be in people who have > just picked up the package and are experimenting with it. Heh - I do have a bit of an alteria motive here. If I'm writing sample programs for plib I might get a bit more help when things don't work right :) > Do you want CVS write-access to contribute these examples? If so, > I need to know your Sourceforge user ID. Yes, that would be good. It's 'sps196'. It'll be a day or two before I have them all properly commented, and with the full complement of makefile though. Sam |
From: Steve B. <sjb...@ai...> - 2000-08-07 06:13:54
|
Sam Stickland wrote: > > Do you want CVS write-access to contribute these examples? If so, > > I need to know your Sourceforge user ID. > > Yes, that would be good. It's 'sps196'. It'll be a day or two before I > have them all properly commented, and with the full complement of > makefile though. OK - you have write access. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |