SparrowMesh is for loading meshes (definied at sparrowRenderer.h). In fact it is just an extension of sparrowRenderer, but maybe later with more loaders for more formats or a skeleton animation format.
sparrowMesh | SparrowMesh is for loading meshes (definied at sparrowRenderer.h). |
Functions | |
spMeshLoadObj | Loads a wavefront object file (.obj). |
spMeshLoadObjSize | Loads a wavefront object file (.obj) like spMeshLoadObj, but with a fourth parameter for resizing. |
spMeshDelete | Deletes a mesh |
PREFIX spModelPointer spMeshLoadObj( char * name, SDL_Surface * texture, Uint16 color )
Loads a wavefront object file (.obj).
name | the filename of the obj file to load |
texture | SDL_Surface*, which will be saved as texture and used if the obj will be drawn. At the moment only one texture per mesh is possible! All texture coordinates will be refered to this texture. If you want more textures split your meshfile in submeshes with your 3d modelling program. |
color | every face in a sparrow3d mesh file has a color (no material or such a thing). If you don’t wont a color, set it to white (65535), it will be multiplied with the color of the texture and the result will be the texture. |
spModelPointer | a pointer to a new created spModel struct |
PREFIX spModelPointer spMeshLoadObjSize( char * name, SDL_Surface * texture, Uint16 color, Sint32 size )
Loads a wavefront object file (.obj) like spMeshLoadObj, but with a fourth parameter for resizing. This functions uses the more accurate float multiplication, which is slower but fine at loading time.
name | the filename of the obj file to load |
texture | SDL_Surface*, which will be saved as texture and used if the obj will be drawn. At the moment only one texture per mesh is possible! All texture coordinates will be refered to this texture. If you want more textures split your meshfile in submeshes with your 3d modelling program. |
color | every face in a sparrow3d mesh file has a color (no material or such a thing). If you don’t wont a color, set it to white (65535), it will be multiplied with the color of the texture and the result will be the texture. |
size | a fixed point factor for the mesh. size = SP_ONE does the same like spMeshLoadObj |
spModelPointer | a pointer to a new created spModel struct |
Loads a wavefront object file (.obj).
PREFIX spModelPointer spMeshLoadObj( char * name, SDL_Surface * texture, Uint16 color )
Loads a wavefront object file (.obj) like spMeshLoadObj, but with a fourth parameter for resizing.
PREFIX spModelPointer spMeshLoadObjSize( char * name, SDL_Surface * texture, Uint16 color, Sint32 size )
Deletes a mesh
PREFIX void spMeshDelete( spModelPointer mesh )