Regular API function

simCreateShape / sim.createShape

Description Creates a mesh shape. See also sim.createPrimitiveShape, sim.createHeightfieldShape and sim.getShapeMesh, and see sim.importMesh for a usage example.
C/C++
synopsis
int simCreateShape(int options,double shadingAngle,const double* vertices,int verticesSize,const int* indices,int indicesSize,const double* normals,const double* textureCoordinates,const unsigned char* texture,const int* textureResolution)
C/C++
parameters
options: Bit-coded:
if bit0 is set (1), backfaces are culled
If bit1 is set (2), edges are visible
If bit2 is set (4), adjacent texture pixels are not interpolated
If bit3 is set (8), texture is applied as a decal
If bit4 is set (16), texture is RGBA, otherwise it is RGB
If bit5 is set (32), texture is horizontally flipped
If bit6 is set (64), texture is vertically flipped
shadingAngle: the shading angle
vertices: an array of vertices
verticesSize: the size of the vertice array
indices: an array of indices
indicesSize: the size of the indice array
normals: an optional array of normal vectors. Has to be 3*indicesSize in length
textureCoordinates: an optional array of texture coordinates. Has to be 2*indicesSize in length
texture: an optional texture, specified as RGB or RGBA
textureResolution: the resolution of the specified texture
C/C++
return value
-1 if operation was not successful, otherwise the handle of the newly created shape
Lua
synopsis
int objectHandle=sim.createShape(int options,float shadingAngle,float[] vertices,int[] indices,float[] normals=nil,float[] textureCoordinates=nil,string/buffer texture=nil,int[2] textureResolution=nil)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
int objectHandle=sim.createShape(int options,float shadingAngle,list vertices,list indices,list normals=None,list textureCoordinates=None,string/bytes texture=None,list textureResolution=None)