creating a cube with jit.gen

Marigold Maripol's icon

hi all-

i noticed there are primitives available in jit.gen for torus, sphere, cylinder, plane, and cone - yet there is no "cube". i am curious why that is and whether there is a simple way to write one.

thanks !

TFL's icon

I don't know reason why there is no cube in jit.gen, and I don't the math to create one, but you can still generate the vertex coordinates outside of jit.gen using a [jit.gl.gridshape @shape cube @matrixoutput 1] if you want custom matrix dimension/number of vertices, or [jit.gl.plato @shape cube @matrixoutput1] if you want the bare minimum triangles for a cube (2 per face).