Class Primitives
java.lang.Object
com.codename1.gpu.Primitives
Factory helpers that build common
Mesh primitives. Every primitive uses the
VertexFormat.POSITION_NORMAL_TEXCOORD layout so it can be drawn with any of
the built in materials, lit or unlit, textured or not.-
Method Summary
Modifier and TypeMethodDescriptionstatic Meshcube(GraphicsDevice device, float size) Builds a unit-normal axis aligned cube centered at the origin with the supplied edge length.static Meshquad(GraphicsDevice device, float size) Builds a flat quad in the XY plane centered at the origin facing +Z.
-
Method Details
-
cube
Builds a unit-normal axis aligned cube centered at the origin with the supplied edge length. Each face has its own normals and a full 0..1 texture coordinate quad.
Parameters
-
device: the device that allocates the buffers -
size: the edge length of the cube
Returns
an indexed triangle mesh
-
-
quad
Builds a flat quad in the XY plane centered at the origin facing +Z.
Parameters
-
device: the device that allocates the buffers -
size: the edge length of the quad
Returns
an indexed triangle mesh
-
-