Macaw OS C reference

Function newmodel

#include <macaw3d.h>
int newmodel(const char *path, const int *textures, int ntextures);

Makes a thing from a model in an .obj file.

Parameters

pathconst char *
The .obj file. A path that doesn't start with / is in your program's folder.
texturesconst int *
An array of picture numbers, one for each material in the order they first come in the file. NULL: plain light grey.
ntexturesint
How many pictures are in textures. 0: plain light grey.

Returns int

The new thing's number, or 0 if the file couldn't be read or has no faces.

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