Sunday, February 22, 2009

crude ascii cube

So... working on some stuff... needed the vertices and indices for cube. The point "0" is set at (x,y,z)

4 .--------. 5
|\ |\ floor : 0,1,2 0,2,3
| \ | \ ceiling : 4,5,6 4,6,7
|7 .--------. 6 back : 0,1,5 0,5,4
| | | | front : 3,7,6 3,6,2
0 .--|-----. 1| left : 0,4,7 0,7,3
\ | \ | right : 1,5,6 1,6,2
\| \|
3 .--------. 2

pushi( vertices, [
x + 0 , y + 0, z + 0 // 0
, x + m , y + 0, z + 0 // 1
, x + m , y + 0, z + m // 2
, x + 0 , y + 0, z + m // 3
, x + 0 , y - m, z + 0 // 4
, x + m , y - m, z + 0 // 5
, x + m , y - m, z + m // 6
, x + 0 , y - m, z + m // 7
] );

btw... Adobe... wtf doesn't Graphics.drawTriangles take a zcoord and do zbuffering? Way to phone it in guys... Flash 11?

No comments:

Post a Comment