generate_mesh
Generates a polygon mesh object using structured data supplied to the command. Supports shared vector data for efficiency and per vertex normals and texture coordinates. See below for the description of the mesh format.
arguments
-
"mesh" : Map
Map representing the mesh data to create. Below is an example of a single polygon with 4 vertices and edges, including normals and texture coordinates.
Note: When the mesh is created the object will not have its visible attribute set. You must call the element_set_attribute command to do so.
The normals and texture coordinates are optional however the position vectors must be provided. Position and normal vectors must be 3D while texture coordinates must be 2D.
Example:{ "vectors" : { "points" : [ {"x": 0.0, "y" : 0.0, "z" : 0.0}, {"x": 0.0, "y" : 0.0, "z" : 5.0}, {"x": 0.0, "y" : 5.0, "z" : 0.0}, {"x": 0.0, "y" : 5.0, "z" : 5.0} ], "normals" : [ {"x": -1.0, "y" : 0.0, "z" : 0.0} ], "uvs" : [ {"x": 0.0, "y" : 0.0}, {"x": 0.0, "y" : 1.0}, {"x": 1.0, "y" : 0.0}, {"x": 1.0, "y" : 1.0} ] }, "vertices" : [ {"v" : 0, "n" : 0, "t" : 2}, {"v" : 2, "n" : 0, "t" : 0}, {"v" : 3, "n" : 0, "t" : 1}, {"v" : 1, "n" : 0, "t" : 3} ], "polygons" : [ [0, 1, 2, 3] ] }
-
"name" : String
Name to give the object once generated
return value
VoidVoid.