Macaw OS C reference

Function loadobj

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

Makes a mesh 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 mesh's number, or 0 if the file couldn't be read or has no faces.

In Making meshes, with cube3d, cube3dsides, room3d, mesh3d.