1
0
Fork 0

There are some problems with ssgTimedSelector's but shorter strings of

rabbit lights appear to almost work except the last light or two is never
included in the animation and longer strings of lights are drawn as all
light on ... :-(
This commit is contained in:
curt 2002-10-18 03:36:56 +00:00
parent bbdca39e3b
commit 89ede45989

View file

@ -272,15 +272,17 @@ ssgTimedSelector *gen_rabbit_lights( const point_list &nodes,
ssgTimedSelector *rabbit = new ssgTimedSelector; ssgTimedSelector *rabbit = new ssgTimedSelector;
unsigned int i; int i;
sgVec3 pt, normal; sgVec3 pt, normal;
for ( i = 0; i < pnt_i.size(); ++i ) { for ( i = (int)pnt_i.size() - 1; i >= 0; --i ) {
ssgVertexArray *vl = new ssgVertexArray( 3 ); ssgVertexArray *vl = new ssgVertexArray( 3 );
ssgNormalArray *nl = new ssgNormalArray( 3 ); ssgNormalArray *nl = new ssgNormalArray( 3 );
ssgColourArray *cl = new ssgColourArray( 3 ); ssgColourArray *cl = new ssgColourArray( 3 );
sgSetVec3( pt, nodes[pnt_i[i]][0], nodes[pnt_i[i]][1], sgSetVec3( pt, nodes[pnt_i[i]][0], nodes[pnt_i[i]][1],
nodes[pnt_i[i]][2] ); nodes[pnt_i[i]][2] );
cout << "nml_i[" << i << "] = " << nml_i[i] << endl;
sgSetVec3( normal, normals[nml_i[i]][0], normals[nml_i[i]][1], sgSetVec3( normal, normals[nml_i[i]][0], normals[nml_i[i]][1],
normals[nml_i[i]][2] ); normals[nml_i[i]][2] );
@ -332,8 +334,8 @@ ssgTimedSelector *gen_rabbit_lights( const point_list &nodes,
} }
rabbit->setDuration( 5 ); rabbit->setDuration( 10 );
rabbit->setLimits( 0, pnt_i.size() ); rabbit->setLimits( 0, pnt_i.size() + 1 );
rabbit->setMode( SSG_ANIM_SHUTTLE ); rabbit->setMode( SSG_ANIM_SHUTTLE );
rabbit->control( SSG_ANIM_START ); rabbit->control( SSG_ANIM_START );