nixa
6th September 2002, 11:29
This was an experiment on making 3D objects whith coordinates off all points being known. I thought i'll make a simple piramide first for test.
This is how it schould work:
whith points being:
A(0,0,0);
B(1,0,0);
C(0.5,0,sqrt(3)/2);
D(0.5,sqrt(6)/3,sqrt(3)/6);
to drow a piramid lines schould go:
A->B->C->A->D->B->C->D
So I made x1,y1 and z1 do this for each of 8 values of i the rest is just 3D->2D code.
The problem is it doesnt work.
Could someone help me out.
init:
n=8;sp=0.1
on beat:
tx=rand(201)/100-1;ty=rand(201)/100-1;tz=rand(201)/100-1;
per frame :
kx=kx+tx*sp;ky=ky+ty*sp;kz=kz+tz*sp; sx=sin(kx);
sy=sin(ky);sz=sin(kz);
cx=cos(kx);cy=cos(ky);cz=cos(kz);
per point:
i=i*8+1;
x1=equal(i,1)*0+equal(i,2)*1+equal(i,3)/2+equal(i,4)*0+equal(i,5)/2+equal(i,6)*1+equal(i,7)/2+equal(i,8)/2;
y1=equal(i,1)*0+equal(i,2)*0+equal(i,3)*0+equal(i,4)*0+equal(i,5)*sqrt(6)/3+equal(i,6)*0+equal(i,7)*0+equal(i,8)*sqrt(6)/3;
z1=equal(i,1)*0+equal(i,2)*0+equal(i,3)*sqrt(3)/2+equal(i,4)*0+equal(i,5)*sqrt(3)/6+equal(i,6)*0+equal(i,7)*sqrt(3)/2+equal(i,8)*sqrt(3)/6;
x1=x1*2-1;y1=y1*2-1;z1=z1*2-1;
x2=x1*cz-y1*sz;y1=x1*sz+y1*cz;
y3=y2*cx-z1*sx;z3=y2*sx+z1*cx;
x=x2*cy-z3*sy;y=x2*sy+z3*cy;
This is how it schould work:
whith points being:
A(0,0,0);
B(1,0,0);
C(0.5,0,sqrt(3)/2);
D(0.5,sqrt(6)/3,sqrt(3)/6);
to drow a piramid lines schould go:
A->B->C->A->D->B->C->D
So I made x1,y1 and z1 do this for each of 8 values of i the rest is just 3D->2D code.
The problem is it doesnt work.
Could someone help me out.
init:
n=8;sp=0.1
on beat:
tx=rand(201)/100-1;ty=rand(201)/100-1;tz=rand(201)/100-1;
per frame :
kx=kx+tx*sp;ky=ky+ty*sp;kz=kz+tz*sp; sx=sin(kx);
sy=sin(ky);sz=sin(kz);
cx=cos(kx);cy=cos(ky);cz=cos(kz);
per point:
i=i*8+1;
x1=equal(i,1)*0+equal(i,2)*1+equal(i,3)/2+equal(i,4)*0+equal(i,5)/2+equal(i,6)*1+equal(i,7)/2+equal(i,8)/2;
y1=equal(i,1)*0+equal(i,2)*0+equal(i,3)*0+equal(i,4)*0+equal(i,5)*sqrt(6)/3+equal(i,6)*0+equal(i,7)*0+equal(i,8)*sqrt(6)/3;
z1=equal(i,1)*0+equal(i,2)*0+equal(i,3)*sqrt(3)/2+equal(i,4)*0+equal(i,5)*sqrt(3)/6+equal(i,6)*0+equal(i,7)*sqrt(3)/2+equal(i,8)*sqrt(3)/6;
x1=x1*2-1;y1=y1*2-1;z1=z1*2-1;
x2=x1*cz-y1*sz;y1=x1*sz+y1*cz;
y3=y2*cx-z1*sx;z3=y2*sx+z1*cx;
x=x2*cy-z3*sy;y=x2*sy+z3*cy;