Function mesh3d
#include <macaw3d.h>int mesh3d(
const float *corners,
int ncorners,
const int *triangles,
int ntriangles,
const int *textures,
int ntextures,
const int *texids,
const char *options
);
Makes a mesh of any shape from your own corners and triangles.
Parameters
cornersconst float *- An array with 5 floats for each corner: x, y, z, then u and v, which say where on the texture it goes (0 to 1 across).
ncornersint- How many corners there are (not how many floats).
trianglesconst int *- An array with 3 corner numbers for each triangle, counting from 0. The front is the side its corners go round anticlockwise.
ntrianglesint- How many triangles there are.
texturesconst int *- An array of picture numbers for its textures. Give at least one: without any, nothing is drawn.
ntexturesint- How many pictures are in
textures(16 at most are used). texidsconst int *- An array with one number for each triangle, saying which texture it uses, counting from 0.
NULL: all use the first. optionsconst char *- Words in a string:
"double"draws both sides,"fullbright"ignores the light.NULLor"": neither.
Returns int
The new mesh's number.
In Making meshes, with cube3d, cube3dsides, room3d, loadobj.