William Briggs (stimpy++at++niesten.arc.nasa.gov)
Fri, 18 Feb 94 09:10:04 -0800
>- In one of our applications at least, the culling does not work properly.
> Objects suddenly vanish before they leave the viewing frustrum. Any ideas
> why this could be? We are not changing any of the GeoSets or other data in
> the hierarchy after it has been initially set up.
I assume you are using Performer 1.0 because we had the same problem.
Ours occurred when we scaled a pfDCS with pfDCSScale. This was useful
for instancing our data set. A once-defined box from a procedure for
creating pfGeoSets could be scaled to the particular task. Some of our
boxes vanished before the edge of our frustum. We tested and found that
the problem got worse with more scaling.
On Fri, 16 Jul 93 18:41:18 -0700
Jim Helman <jimh++at++surreal.asd.sgi.com> writes:
> There is a culling bug for scaled DCSes
> which was fixed in Release 1.1. 1.1 only
> was released for IRIX 5.0.
Our work-around was to scale the data-points as the pfGeoSet was created.
However, in the example coloredbox.c all points are statically defined.
Therefore the points must be dynamically allocated:
static pfGeoSet *MakePalmGSet( float scale, pfGeoState *gstate)
{
void *arena;
int i;
pfVec3 *scaled_scoords;
pfGeoSet *gset;
static pfVec3 scoords[] = {{-2.00f,-.50f, 3.75f },
{ 2.00f,-.50f, 3.75f },
{ 2.00f, .50f, 3.75f },
{-2.00f, .50f, 3.75f },
{-1.25f,-.75f, 0.00f },
{ 1.75f,-.75f, 0.00f },
{ 1.75f, .75f, 0.00f },
{-1.25f, .75f, 0.00f },
{ 2.00f,-.68f, 1.00f },
{ 2.00f, .68f, 1.00f }};
static ushort svindex[] = {0, 1, 2, 3, /* front */
0, 3, 7, 4, /* left */
4, 7, 6, 5, /* back */
1, 8, 9, 2, /* right */
8, 5, 6, 9, /* right/bottom */
3, 2, 6, 7, /* top */
0, 4, 5, 1}; /* bottom */
static pfVec3 snorms[] = {{ 0.000f, 0.000f,-1.000f},
{ 0.981f, 0.000f, 0.196f},
{ 0.000f, 0.000f, 1.000f},
{-1.000f, 0.000f, 0.000f},
{-0.707f, 0.000f, 0.707f},
{ 0.000f,-0.998f,-0.067f},
{ 0.000f, 0.998f,-0.067f}};
static ushort snindex[] = {0, 1, 2, 3, 4, 5, 6};
static ushort scindex[] = {20, 20, 20, 20,
20, 20, 10, 0,
0, 10, 10, 0,
20, 5, 15, 20,
5, 0, 10, 15,
20, 20, 10, 10,
20, 0, 0, 20};
arena = pfGetSharedArena();
scaled_scoords = (pfVec3 *)pfMalloc( sizeof( pfVec3[8] ), arena );
for( i = 0; i < 8; i++ )
PFSCALE_VEC3( scaled_scoords[i], scale, scoords[i] );
gset = pfNewGSet( arena );
pfGSetCtabMode( gset, PF_ON );
pfGSetAttr( gset, PFGS_COORD3, PFGS_PER_VERTEX, scaled_scoords, svindex );
pfGSetAttr( gset, PFGS_NORMAL3, PFGS_PER_PRIM, snorms, snindex );
pfGSetAttr( gset, PFGS_COLOR4, PFGS_PER_VERTEX, NULL, scindex );
pfGSetPrimType( gset, PFGS_QUADS );
pfGSetNumPrims( gset, 7 );
pfGSetGState( gset, gstate );
return( gset );
}
Hope this is useful. Of course 1.2 (hopefully) comes out in March and all
of this will be obsolete. :^)
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:11 PDT