[Plib-users] Cutout usage
Brought to you by:
sjbaker
From: Paolo L. <p.l...@ci...> - 2000-04-12 12:56:44
|
I'm trying to use ssgCutout nodes in a modified version of the 3DS loader for supporting 3DS "billboard" objects - not to mention that can't get the expected result! (e.g. objects staying always parallel to the screen ...). What I did is in the following code: ... ssgVTable *v = new ssgVTable( GL_TRIANGLES, vertex_count, vertices, normal_count, normals, texcrd_count, texcrds, 0, NULL); if ( object_name != (char *)NULL ) { v -> setName( object_name ); object_name = (char *)NULL; // global from parse_objblock() } v -> setState( state ); if ( strstr( v->getName(), "bboard" ) > 0 ) { // N E W C O D E ssgCutout *bboard = new ssgCutout(FALSE); bboard->addKid( v ); current_transform -> addKid( bboard ); } else // E N D N E W C O D E current_transform -> addKid( v ); ... Just for try, in 3DS I gave "billboard" object name to *bboard* for detecting beyond the 3DS storing format (and they are actually detected). The graph organization I implemented is the following (slightly different from the original one coded in the 3DS loader from Per): original: root | +---------+-------+ | | transform ... transform | | vtable ... vtable w cutout (when present): root | +---------+-------+ | | transform ... transform | | vtable ... cutout | vtable The result is simply those objects are no longer (visible) in the scene, both with ssgCutout(TRUE) and ssgCutout(FALSE). Can anybody tell me why? (my billboard objects have origin at their center). Thanks in advance - |