Macaw OS C reference

Function newmesh

#include <macaw3d.h>
int newmesh(
    const float *corners,
    int ncorners,
    const int *triangles,
    int ntriangles,
    const int *textures,
    int ntextures,
    const int *texids
);

Makes a thing with a shape of your own, built from 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, or NULL for plain light grey.
ntexturesint
How many pictures are in textures (16 at most are used). 0: plain light grey.
texidsconst int *
An array with one number for each triangle, saying which texture it uses, counting from 0. NULL: all use the first.

Returns int

The new thing's number.

In Shapes, terrain and models, with newcube, newsphere, newcylinder, newcone, newplane, newterrain, newterrainfn, newmodel, newsprite, newpivot.