This is the Stickman with a custom 300frame jpg filmstrip... How can I make the animation just play 30fps and loop? Instead of playing random with the beat.
SCENE (
"name" = "Color-o-matic";
"author" = "Gordon Williams & Clayton Brickert Clayduck";
"html" = "scene_colour.html";
SOLID cl();
TEXTURE img();
ANIMATE anim(img) 128,128;
GL gl(cl,anim);
)
float btime,bbtime;
float rot[8];
float rots[8];
int x;
float dxx,dxy,dyx,dyy;
// colours
float ar,ag,ab,br,bg,bb;
float colamt,coltime;
int automatic;
// change colours when told to tweak by R4
void settweak(int num,float val) {
if (num==0) { ar=br; br=val; colamt=0; automatic=0; } // red
if (num==1) { ag=bg; bg=val; colamt=0; automatic=0; } // green
if (num==2) { ab=bb; bb=val; colamt=0; automatic=0; } // blue
}
void init() {
strcpy(img.filename,"Couleurs.jpg");
anim.picx = 6;
anim.picy = 50;
anim.pics = 300;
anim.frame = 0;
strcpy(gl.shader,"BA1;T0;");
}
void reset() {
btime = 0;
for (x=0;x<8;x=x+1) {
rot[x]=rand();
rots[x]=rand()+1.0;
}
colamt = 1;
br = 0.0;
bg = 0.0;
bb = 0.5;
coltime = 1+(rand()*5);
automatic = 1;
bbtime = rand()+0.5;
}
void quad(float rt,float sz) {
dxx = cos(rt)*sz;
dxy = sin(rt)*sz;
dyx = sin(rt)*sz;
dyy = 0.0-cos(rt)*sz;
gl.gltexcoord((0.0-dxx)+(0.0-dyx),(0.0-dxy)+(0.0-dyy));
gl.glvertex(-1,-1,0);
gl.gltexcoord((0.0+dxx)+(0.0-dyx),(0.0+dxy)+(0.0-dyy));
gl.glvertex(1,-1,0);
gl.gltexcoord((0.0+dxx)+(0.0+dyx),(0.0+dxy)+(0.0+dyy));
gl.glvertex(1,1,0);
gl.gltexcoord((0.0-dxx)+(0.0+dyx),(0.0-dxy)+(0.0+dyy));
gl.glvertex(-1,1,0);
}
void render() {
// for frames
bbtime = bbtime - (timepass*(sounda+1.0)*2.0);
if (bbtime<0) {
anim.frame = (rand()*1000);
bbtime = rand()+0.5;
}
// keep moving
btime = btime + timepass;
while (btime>1) {
btime = btime - 1;
for (x=6;x>=0;x=x-1) {
rot[x+1]=rot[x];
rots[x+1]=rots[x];
}[/color]