Re: [Plib-users] Messing with ssg
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-08-02 02:09:28
|
Will Newton wrote: > > I've been writing some cell shading code (Jet Set Radio style :) and I'm > trying to hook it into ssg as a simple way to debug it. I've never heard of 'cell shading' - or 'Jet Set Radio' - please enlighten me! > In essence I need to override the drawing code of a particular object. It > looks like it probably isn't possible, but can anyone see a way to do > this? Well, there are several ways: * Write a derived class of ssgLeaf or ssgVtxTable that replaces the 'draw' virtual member function with whatever you need to do. You'll have to take on responsibility for calling pre- and post-Draw callbacks and working with the ssgState management system to get the states setup. * As above - but only override the 'fraw_geometry' member function. Then *all* you have to do is draw the polygons - the underlying native SSG class will do everything else. * Write a pre-Draw callback for an existing class - but have it do all the rendering and return FALSE - which will tell SSG *not* to go and draw the object itself. The third way avoids SSG's state setup code though - so you'd have to set up (and restore) the OpenGL state before and after your rendering. The first way is therefore considerably superior - but maybe more than you want to do for a quick hack. The second way is probably what you need. Just look at: void ssgVtxTable::draw_geometry() ...in src/ssg/ssgVtxTable.cxx - use that as an example. ...and of course, when it's all working - CONTRIBUTE IT! -- 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 |