# Class: l3dprimitive

Primitives such as cubes, boxes and user meshes.

## Hierarchy

    o-+ l3dlist
      o-+ l3dnode
        o-+ l3dprimitive

## Interfaces:

- indexarray
- matobject
- renderflag
- rendersurface
- vertexarray

## Methods:

### Method overview:

- matsurface
- newbox
- newcylinder
- newquad
- newquadcentered
- newsphere
- originalmesh
- rendermesh
- size
- usermesh

matsurface (l3dprimitive,[matsurface])
  returns: ([matsurface])
  returns or sets material
newbox (string name,|l3dlayerid|,float w,d,h)
  returns: ([l3dprimitive])
  creates new l3dnode
newcylinder (string name,|l3dlayerid|,float size)
  returns: ([l3dprimitive])
  creates new l3dnode
newquad (string name,|l3dlayerid|,float w,d)
  returns: ([l3dprimitive])
  creates new l3dnode. origin of the quad is lower left corner
newquadcentered (string name,|l3dlayerid|,float w,d)
  returns: ([l3dprimitive])
  creates new l3dnode. origin of the quad is center point
newsphere (string name,|l3dlayerid|,float size)
  returns: ([l3dprimitive])
  creates new l3dnode
originalmesh (l3dprimitive)
  returns: ()
  deletes the usermesh and uses the original mesh again.
rendermesh (l3dprimitive,[rendermesh])
  returns: ([rendermesh])
  gets or sets rendermesh. Get only works if a usermesh was created before or another rendermesh passed for useage.
size (l3dprimitive,[float radius/float x,y,z])
  returns: ([float radius/float x,y,z])
  returns or sets size (modifies l3d's visbbox as well). Visual size will be overriden by calls to renderscale.
usermesh (l3dprimitive, vertextype, int numverts, numindices, [vidbuffer vbo], [int vbooffset], [vidbuffer ibo], [int ibooffset])
  returns: ()
  creates inplace custom rendermesh (see rendermesh for details) Note that polygon winding is CCW.

## Inherited Methods:

### From l3dnode

cambox, camsphere, camvolumedelete, color, delete, isanimateable, lastframe, lightmap, lightmaptexmatrix, linkinterface, localmatrix, localpos, localrotaxis, localrotdeg, localrotquat, localrotrad, name, novistest, parent, parentbone, renderscale, rotationlock, setlayer, unlink, unparentbone, uselocal, uselookat, usemanualworld, visflag, worldmatrix, worldpos, worldrotaxis, worldrotdeg, worldrotquat, worldrotrad

### From l3dlist