Re: ssgVtxArrary and ssgSimpleList addtions + pui resize additions (was Re: [Plib-devel] Changing
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-08-06 18:57:27
|
Sam Stickland wrote: > Well, obviously I should had been using ssgVxtTable rather than the > obsolute ssgVTable - which means the set methods I mentioned need to be > a part of ssgSimpleList. Well, what was intended was that you call ssgVtxTable::getVertex(int i) which delivers a POINTER to the i'th vertex - which you are then at liberty to dink with. (Also 'getColour', 'getNormal' and 'getTexCoord') This is generally faster than a 'get-a-copy-of-the-vertex/dink with it/setVertex' mechanism. I know this works because PPE uses it. One other thing to beware of is that you have to make sure that the bounding sphere stays reasonable. So, either: * Call recalcBSphere each frame after your leaf node has been messed with. * Initialise the object to it's maximum size and call recalcBSphere just once at start of day. Which you do depends on your application. The first is time consuming because recalcBSphere isn't very fast - but it generates accurate spheres which results in less chance of all the polygons being sent to OpenGL when they are in fact off-screen. The second is faster per-frame but results in wasteful field-of-view culling. You choose! Hence, I don't think we need your change...what we *do* need is better documentation! > I've also hacked my copy of pui so that gadget sizes can be specified in > opengl co-ordinates, rather than pixels. It's very simple - it uses > this code from the non-glut part of pui: > > static int puWindowWidth = 400 ; > static int puWindowHeight = 400 ; > > int puGetWindowHeight () { return puWindowHeight ; } > int puGetWindowWidth () { return puWindowWidth ; } > > void puSetWindowSize ( int width, int height ) > { > puWindowWidth = width ; > puWindowHeight = height ; > } > > I need this because I use some of the pui gadgets (well actually > subclasses of the pui gadgets), to add controls to my HUD (this is also > coupled with calling puGetUltimateLiveInterface () -> draw ( 0, 0 ) ; > myself rather than calling puDisplay() - as this would cause a redundant > glViewport call). > > If anyone else is interested in this I'll knock up an alteration so that > it can be enabled at runtime. I guess that's useful - so I'll certainly accept such a patch - providing it doesn't alter the default behavior. -- 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 |