sparrowMesh

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.

Summary
sparrowMeshSparrowMesh is for loading meshes (definied at sparrowRenderer.h).
Functions
spMeshLoadObjLoads a wavefront object file (.obj).
spMeshLoadObjSizeLoads a wavefront object file (.obj) like spMeshLoadObj, but with a fourth parameter for resizing.
spMeshDeleteDeletes a mesh

Functions

spMeshLoadObj

PREFIX spModelPointer spMeshLoadObj(char *name,
SDL_Surface *texture,
Uint16 color)

Loads a wavefront object file (.obj).

Parameters

namethe filename of the obj file to load
textureSDL_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.
colorevery 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.

Returns

spModelPointera pointer to a new created spModel struct

See Also

spMeshLoadObjSize

spMeshLoadObjSize

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.

Parameters

namethe filename of the obj file to load
textureSDL_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.
colorevery 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.
sizea fixed point factor for the mesh. size = SP_ONE does the same like spMeshLoadObj

Returns

spModelPointera pointer to a new created spModel struct

See Also

spMeshLoadObj

spMeshDelete

PREFIX void spMeshDelete(spModelPointer mesh)

Deletes a mesh

Parameters

meshthe mesh to be deleted and freed.  The texture is not freed (!)
SparrowRenderer is for rendering 3D stuff to the target of sparrowPrimitives.
PREFIX spModelPointer spMeshLoadObj(char *name,
SDL_Surface *texture,
Uint16 color)
Loads a wavefront object file (.obj).
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.
PREFIX void spMeshDelete(spModelPointer mesh)
Deletes a mesh
Contains a mesh.
Close