Hi again. I came with the same code above that make 50 triangles, and every two triangles form a face. First I made a grid of objects to have the reference of the vertex of every triangle, so I made six rows of six objects ... 36 in total. Then with a for next I made all triangles between reference grid.
Now I have a problem when trying to texture correctly all of triangles. I'v done it, but in a noob way, and works, but I'm trying to make that in other automatically way.Take a look to this piece of code, and use any image to see what I mean.
if I make it so like a noob:
if d=5 then d=0:f=f+6
if i>0 then d2=1
if i>5 then d2=2
if i>10 then d2=3
if i>15 then d2=4
if i>20 then d2=5
render image on the left.
if I make so:
if d=5 then d=0:f=f+6:d2=d2+1
render image on the right
Being just 5*5 , is not a problem making that as a noob, but imagine that we need 50*50, I don't want to write 50 lines of code .I can't find where to inc the var .Someone can help?
I slowed down the code to see better the construction
autocam off
rem sync on
sync rate 16
load image "coche.bmp",1
position camera 20,30,-20
point camera 20,0,-20
o=100
for i= 1 to 6
for a= 1 to 6
inc o
make object box o,0.2,0.2,0.2
position object o,a*5,0,-i*5
next a
next i
rem d2=1
for i= 1 to 25
x1=object position x(101+d+f)
y1=object position y(101+d+f)
z1=object position z(101+d+f)
x2=object position x(102+d+f)
y2=object position y(102+d+f)
z2=object position z(102+d+f)
x3=object position x(108+d+f)
y3=object position y(108+d+f)
z3=object position z(108+d+f)
x3b=object position x(107+d+f)
y3b=object position y(107+d+f)
z3b=object position z(107+d+f)
inc d
if d=5 then d=0:f=f+6 rem :d2=d2+1
rem remstart
if i>0 then d2=1
if i>5 then d2=2
if i>10 then d2=3
if i>15 then d2=4
if i>20 then d2=5
rem remend
make object triangle i,x1,y1,z1,x2,y2,z2,x3,y3,z3:sleep 60
make object triangle i+25,x3,y3,z3,x3b,y3b,z3b,x1,y1,z1:sleep 60
scale object texture i,0.2,0.2
scroll object texture i,0.2*d-0.2,0.2*d2-0.2
scale object texture i+25,-0.2,-0.2
scroll object texture i+25,0.2*d,0.2*d2
next i
for i= 1 to 50
texture object i,1:sleep 60
next i
do
sync
loop
Cheers.
I'm not a grumpy grandpa
