Roy Ruddle (Ruddle++at++cardiff.ac.uk)
Thu, 30 Apr 1998 12:06:09 +0100 (BST)
I'm writing an application in which the 2 channels on a single pipe
should each have a different update rate. I've tried to implement this by
toggleing the DRAW traversal mode (PF_ON/OFF) according to whether or not
a particular channel should be drawn in a frame but I get the channels
have a black flash.
I've replicated the problem with a 1-channel test program. The channel
covers the whole of the pipe viewport (VP bounds 0 .. 1 in X and Y). The
channel is drawn (correctly) once every 10 frames but it flashes black on
the other frames. This happens whether or not the channel draw traversal
function calls clear(), and whether or not I use a channel draw traversal
function.
My guess is that the black flashing is being caused by a pipe-based
"clear" function.
Can anyone tell me how I can overcome this black flashing (what have I
done wrong?).
System:
MaximumIMPACT
pf2.2, compiled n32 (OGL)
Irix 6.2
Test program is attached.
many thanks
roy
#include <iostream.h>
#include <stdlib.h>
clude <math.h>
e <Performer/pf.h>
Channel.h>
#include <Performer/pr/pfGeoSet.h>
e <Performer/pf/pfLightSource.h>
erformer/pr/pfLight.h>
r/pfMaterial.h>
e.h>
lude <Performer/pf/pfDCS.h>
mer/pfutil.h>
clude <Performer/pr/pfTexture.h>
id OpenPipeWin(pfPipeWindow *pw);
d DrawChannel(pfChannel *channel, void *data)
;
int l1, l2, l3;
ocess( PFMP_DEFAULT );
Scene *scene = new pfScene;
10.0f, ydim = 10.0f, zdim = 9.9f;
/ Create piece of flat terrain
Set *gset = new pfGeoSet();
ype( PFGS_TRISTRIPS );
1 );
hs = 4;
pfVec4 *colour = new pfVec4( 0.2f, 0.7f,
0.2f, 1.0f );
PFGS_OVERALL, colour, 0 );
s = new pfVec3[ *p_lengths ];
vertices;
vv++;
>set( xdim, ydim, zdim ); vv++;
ttr( PFGS_COORD3, PFGS_PER_VERTEX, vertices,
0 );
als->set( 0.0f, 0.0f, 1.0f );
r( PFGS_NORMAL3, PFGS_OVERALL, normals, 0 );
, 0 );
te();
PFTR_OFF );
al();
>setColor( PFMTL_AMBIENT, 1.0f, 1.0f, 1.0f );
mtl->setColor( PFMTL_DIFFUSE, 1.0f, 1.0f,
1.0f );
, mtl );
eode *geode = new pfGeode();
t( gset );
// Configure and open GL window
pfPipe *pipe = pfGetPipe(0);
*pw = new pfPipeWindow(pipe);
"Cardiff UAV");
lay_y = 1024;
play_x, display_y );
BORDER, PFIS_TRUE );
nPipeWin);
e channel
annel( pipe );
0f, 0.0f, 1.0f );
f );
chan->setScene( scene );
c( PFTRAV_DRAW, DrawChannel );
avMode( PFTRAV_DRAW, PFDRAW_OFF );
3 xyz( 0.0f, 0.0f, 100.0f ), hpr;
= 0;
pfSync();
pfGetTime() ) * 30.0f );
xyz, hpr );
= 9 ) { // Draw once every 10 frames
han->setTravMode( PFTRAV_DRAW, PFDRAW_ON );
}
n->setTravMode( PFTRAV_DRAW, PFDRAW_OFF );
fcnt = 0;
}
peWin(pfPipeWindow *pw)
open();
pfLightModel;
f, 1.0f, 1.0f );
pfEnable(PFEN_LIGHTING);
ATE_LIGHTS, PF_ON);
HTMODEL, PF_ON);
;
id DrawChannel (pfChannel *channel, void *dat
a)
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:19 PDT