an example made by
Kevil :
sync on
rem setting the triangle vars
polys=1
x1#=-3.0 : y1#=2.0 : z1#=1.0
x2#=3.0 : y2#=2.0 : z2#=-1.0
x3#=-1.0 : y3#=-1.0 : z3#=0.0
rem make the memblock with the right size (Each poly has 3 vertices with 36 bytes of data each)
rem plus another 12 bytes for the header
make memblock 1,(polys*3*36)+12
rem write the header
rem FVF format (4 bytes, so a dword) this is normally 338
write memblock dword 1,0,338
rem FVF size (in this case 36 bytes)
write memblock dword 1,4,36
rem Number of vertices
write memblock dword 1,8,polys*3
rem writing data for the first vertex
rem position (3 floats(float=4 bytes) for the x,y and z position of the vertex point)
write memblock float 1,12,x1#
write memblock float 1,16,y1#
write memblock float 1,20,z1#
rem normal (again 3 floats) we well set it so each vertex point faces the camera (not normal)
write memblock float 1,24,0
write memblock float 1,28,0
write memblock float 1,32,-1.00
rem color (as a dword, or as 4 bytes blue,green,red,alpha)
write memblock dword 1,36,rgb(255,0,0)
rem UV texture coordinates (2 floats) doesn't matter for now, because we don't give it a texture
write memblock float 1,40,0.00
write memblock float 1,44,0.00
rem writing data for the second vertex
rem position (3 floats(float=4 bytes) for the x,y and z position of the vertex point)
write memblock float 1,12+36,x2#
write memblock float 1,16+36,y2#
write memblock float 1,20+36,z2#
rem normal (again 3 floats) we well set it so each vertex point faces the camera (not normal)
write memblock float 1,24+36,0
write memblock float 1,28+36,0
write memblock float 1,32+36,-1.00
rem color (as a dword, or as 4 bytes blue,green,red,alpha)
write memblock dword 1,36+36,rgb(0,255,0)
rem UV texture coordinates (2 floats) doesn't matter for now, because we don't give it a texture
write memblock float 1,40+36,1.00
write memblock float 1,44+36,0.00
rem writing data for the third vertex
rem position (3 floats(float=4 bytes) for the x,y and z position of the vertex point)
write memblock float 1,12+72,x3#
write memblock float 1,16+72,y3#
write memblock float 1,20+72,z3#
rem normal (again 3 floats) we well set it so each vertex point faces the camera (not normal)
write memblock float 1,24+72,0
write memblock float 1,28+72,0
write memblock float 1,32+72,-1.00
rem color (as a dword, or as 4 bytes blue,green,red,alpha)
write memblock dword 1,36+72,rgb(0,0,255)
rem UV texture coordinates (2 floats) doesn't matter for now, because we don't give it a texture
write memblock float 1,40+72,0.50
write memblock float 1,44+72,1.00
rem make a mesh out of this memblock
make mesh from memblock 1,1
rem make an object with this mesh
make object 1,1,0
position camera 0,0,-10
do
sync
loop
"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."