trimeshloader
1.0.0
Flexible ANSI C trimeshloader 3DS/OBJ
|
This tutorial shows how to use the high level loading functions. Nearly all OpenGL and application code is stripped. Only some lines are left for orientation.
First we need the header of course. To make it plain and simple we just use a global variable to hold the trimesh data:
load the file provided by the user. if loading fails for some reason, NULL is returned:
Now we actually draw each object of the the trimesh. bind the vertex data with glVertexPointer, and provide indices to glDrawElements: