SparrowRenderer is for rendering 3D stuff to the target of sparrowPrimitives. Like sparrowPrimitves it provides triangles, quads (with and without texture), lines, ellipses, rectangles and blitting or rotozoom of surfaces, furthermore light calculation. Like other 3d libraries (e.g. OpenGL) sparrow3d uses matrizes for the orientation and position in space.
sparrowRenderer | SparrowRenderer is for rendering 3D stuff to the target of sparrowPrimitives. |
Light | |
SP_MODELVIEW_STACK_SIZE | The maximum depth of spPushModelView and spPopModelView Operations |
spPoint | a point struct with space, modelview and projected coordinates |
spTexPoint | a point struct with space, modelview, projected and texture coordinates and the w clip |
spEdge | edge struct for meshes. |
spTriangleS | A triangle struct for meshes. |
spQuadS | A triangle struct for meshes. |
spModel | Contains a mesh. |
spLight | Struct for light sources. |
Operations for the Matrizes | Like other 3d libraries like OpenGL, sparrow3d uses homolog 4x4 matrizes for the orientation in space, too. |
spSetFrustumf2 | Function for setting up the frustom of the projection matrix. |
spSetPerspective | Sets the projection matrix. |
spSetPerspectiveStereoscopic | Sets and returns a projection matrix for steroscopic viewing, so most of the times you will call this function for each eye once. |
spStereoCreateProjectionMatrixes | Use this function, if you want two projection matrixes with the given eye distance for stereoscopic projection. |
spGetProjectionMatrix | Returns the projetion matrix pointer. |
spGetMatrix | Returns you the REAL modelview matrix pointer! |
spPushModelView | Saves the recent ModelView matrix on a stack. |
spPopModelView | Loads the ModelView matrix from the stack. |
spIdentity | Sets the modelview matrix to the identity matrix. |
spMulMatrix | Multiplies the modelview matrix with the given matrix. |
spMulMatrixLeft | Multiplies the modelview matrix with the given matrix, but from the left side. |
spScale | spScale scales the modelview matrix. |
spRotate | Rotates rad radians around the vector (x,y,z). |
spRotateX | Rotates rad radians around the x-axis. |
spRotateY | Rotates rad radians around the y-axis. |
spRotateZ | Rotates rad radians around the z-axis. |
spTranslate | This function does a relative translation to (x,y,z). |
Light functions | Only ”Real” 3D functions (except spLine3D) are enlighted. |
spSetLight | Sets Light Calculation on or off. |
spEnableLight | Specifies, whether a light is used or not for the light calculation. |
spSetLightColor | Sets the color of a light |
spSetLightPosition | Sets the Light Position. |
spUpdateLight | If you want to update the lights position without a recall of spSetLightPosition use this function. |
spSetAmbientLightColor | Sets the global ambient light value. |
“Real” 3D functions | These functions are for drawing 3d primitives in space with light calculation, rotation and so on. |
spTriangle3D | Draws a triangle in 3D space. |
spQuad3D | Draws a quad in 3D space. |
spTriangleTex3D | Draws a textured triangle in 3D space. |
spQuadTex3D | Draws a textured quad in 3D space. |
spMesh3D | Draws a mesh in 3D space. |
spMesh3DwithPos | like spMesh3D, but with an additional position. |
spLine3D | Draws a line in the 3d space with the given color. |
“Billboard” 3D Functions | For these functions the position and size are projected, but the rotation is always, that you see the front (also called “billboard”). |
spRotozoomSurface3D | Draws a rotozoomed surface in 3d space. |
spRotozoomSurfacePart3D | Draws a rotozoomed part of a surface in 3d space. |
spRectangle3D | Draws a billboard rectangle in 3d space. |
spCollapsePrimitives | Determines, whether ellipses, rectangles, ellipses borders and rectangle borders can collapse to an (unseeable) object smaller than one pixel. |
spEllipse3D | Draws a billboard ellipse in 3d space. |
spRectangleBorder3D | Draws a billboard rectangle border in 3d space. |
spEllipseBorder3D | Draws a billboard ellipse border in 3d space. |
“Blitting” 3D Functions | Very much like the ”Billboard” 3D Functions, but the size and rotation is fix (0 and SP_ONE)! |
spBlit3D | Blits a surface in 3d space very fast. |
spBlitPart3D | Blits a part of a surface in 3d space very fast. |
Optimization and other functions | Some optional optimizations and helpers. |
spSetPerspectiveTextureMapping | Every of the ”Real” 3D functions with textures can be rendered with affine texture mapping what may look a bit “wobly” or perspectivly correct, which looks the best, but may be slower! |
spProjectPoint3D | Projects a point in the 3D scene. |
spUsePrecalculatedNormals | Desides, whether the precalculated normal values of meshes are used or not. |
The maximum depth of spPushModelView and spPopModelView Operations
A triangle struct for meshes.
point (int*) | Array of 3 references to points |
was_drawn (int) | determines, where the triangle was drawn the last time: 0 = not drawn, else 1 screen, 2 left, 4 lefttop, 8 top, 16 righttop, 32 right, 64 rightbottom, 128 bottom, 256 leftbottom |
edge (int*) | Array of 3 references to edges |
normal (Sint32) | Array with 3 fixed point numbers as normal |
pNormal (Sint32) | Array with 3 fixed point numbers as projected normal |
A triangle struct for meshes.
point (int*) | Array of 4 references to points |
was_drawn (int) | determines, where the quad was drawn the last time: 0 = not drawn, else 1 screen, 2 left, 4 lefttop, 8 top, 16 righttop, 32 right, 64 rightbottom, 128 bottom, 256 leftbottom |
edge (int*) | Array of 4 references to edges |
normal (Sint32) | Array with 3 fixed point numbers as normal |
pNormal (Sint32) | Array with 3 fixed point numbers as projected normal |
Contains a mesh. You can fill it on your own (have fun, it is a lot of work) or use sparrowMesh to load (e.g.) wavefront object files. SparrowRenderer provides functions for drawing these meshes very fast.
texture (SDL_Surface*) | the texture. Sparrow3D Meshes only can have 1 texture |
pointCount (int) | number of points without texture coordinates in the mesh |
point (spPoint*) | pointer/array to pointCount spPoint structs |
texPointCount (int) | number of points with texture coordinates in the mesh |
texPoint (spTexPoint*) | pointer/array to texPointCount spTexPoint structs |
triangleCount (int) | numbers of untextured triangles in the Mesh |
triangle (spTriangleS*) | pointer/array to triangleCount spTriangleS structs |
texTriangleCount (int) | numbers of textured triangles in the Mesh |
texTriangle (spTriangleS*) | pointer/array to texTriangleCount spTriangleS structs |
quadCount (int) | numbers of untextured quads in the Mesh quad (spQuadS)- pointer/array to quadCount spQuadS structs |
texQuadCount (int) | numbers of textured quads in the Mesh |
texQuad (spQuadS) | pointer/array to texQuadCount spQuadS structs |
edgeCount (int) | numbers of untextured edges in the Mesh |
edge (spEdge*) | pointer/array to edgeCount spEdge structs |
texEdgeCount (int) | numbers of textured edges in the Mesh |
texEdge (spEdge*) | pointer/array to texEdgeCount spEdge structs |
color (Uint16) | 16 bit colour of the whole mesh |
Struct for light sources.
r,g,b (Uint32) | fixed point color of the light. (SP_ONE,SP_ONE,SP_ONE) is a bright white |
x,y,z (Sint32) | position of the light |
tx,ty,tz (Sint32) | translated position of the light |
active (Sint32) | determines, whether the light is enabled in calculation or not. 1 is on, 0 is off |
Like other 3d libraries like OpenGL, sparrow3d uses homolog 4x4 matrizes for the orientation in space, too. These functions are for manipulating the projection and modelview matrix. The last is for the orientation in space, the first for projecting from the 3d space to the 2d space of the screen. Most of the times you will not have to change the matrizes on your own and you can just functions for manipulating them
PREFIX void spSetFrustumf2( Sint32 * matrix, Sint32 left, Sint32 right, Sint32 bottom, Sint32 top, Sint32 znear, Sint32 zfar )
Function for setting up the frustom of the projection matrix. Most of the time you will not use this directly, but the perspective setting up functions do.
matrix | a pointer to at least 16 Sint32 values for the matrix |
left | the left border of the frustum |
right | the right border of the frustum |
bottom | the bottom border of the frustum |
top | the top border of the frustum |
znear | z position auf the near plane |
zfar | z position of the far plane |
PREFIX void spSetPerspective( float fovyInDegrees, float aspectRatio, float znear, float zfar )
Sets the projection matrix. Because you call this function mostly just one time at beginning and the need of REALLY high accuracy, this is one of the rare functions from sparrow3d, which has floats as parameter.
fovyInDegrees | the field of View in degrees. 45° is a good value |
aspectRatio | the aspect ratio of the projection. width / height is a good value most of the times |
znear,zfar | the nearest and farest value for the z ordinate |
PREFIX void spSetPerspectiveStereoscopic( Sint32 * projectionMatrix, float fovyInDegrees, float aspectRatio, float znear, float zfar , float z0, float distance )
Sets and returns a projection matrix for steroscopic viewing, so most of the times you will call this function for each eye once. Because you call this function mostly just one time at beginning and the need of REALLY high accuracy, this is one of the rare functions from sparrow3d, which has floats as parameter.
projectionMatrix | a pointer to at least 16 Sint32 values for the calculated projection matrix |
fovyInDegrees | the field of View in degrees. 45° is a good value |
aspectRatio | the aspect ratio of the projection. width / height is a good value most of the times |
znear,zfar | the nearest and farest value for the z ordinate |
z0 | position of the null paralaxis. That is the plane, where the left and right eye got the same image and it seems, that the object is at screen position while stereoscopic rendering |
distance | the distance from the centre, for one eye positive, for one negative |
PREFIX void spStereoCreateProjectionMatrixes( Sint32 * left_matrix, Sint32 * right_matrix, float fovyInDegrees, float aspectRatio, float znear, float zfar , float z0, float distance, int crossed )
Use this function, if you want two projection matrixes with the given eye distance for stereoscopic projection. The projection matrix of sparrow3d is not set! You have to set it with memcpy(spGetProjectionMatrix(),matrix,sizeof(Sint32)*16) by yourself. For stereoscopic rendering, you have to render the scene two times with the colours of your 3d glasses and merge it afterwars, e.g. with spStereoMergeSurfaces (screen,right_screen,crossedEyes).
left_matrix, right_matrix | the matrizes (pointer to at least 16 Sint32 values) of the left and right eye |
fovyInDegrees | the field of View in degrees. 45° is a good value |
aspectRatio | the aspect ratio of the projection. width / height is a good value most of the times |
znear,zfar | the nearest and farest value for the z ordinate |
z0 | position of the null paralaxis. That is the plane, where the left and right eye got the same image and it seems, that the object is at screen position while stereoscopic rendering |
distance | the distance from the centre, for one eye positive, for one negative |
crossed | determines, whether the you will use crossed eye or color merging for merging the two resulting projections. For colored glassed use crossed=0, for two seperate images crossed=0 |
PREFIX Sint32* spGetProjectionMatrix( void )
Returns the projetion matrix pointer. Be carefull: You get the real pointer, no copy. Usefull for setting the projection matrix on yourself, e.g. while rendering stereoscopic:
spSelectRenderTarget(right_screen); memcpy(spGetProjectionMatrix(),right_projection,sizeof(Sint32)*16);
Sint32* | pointer to the projection matrix |
PREFIX void spPushModelView( void )
Saves the recent ModelView matrix on a stack. Get the last element of the stack with spPopModelView.
Only ”Real” 3D functions (except spLine3D) are enlighted. You have up to 8 light sources (in fact, even more than 4 look shitty).
PREFIX void spUpdateLight( int number )
If you want to update the lights position without a recall of spSetLightPosition use this function. This just multiplies the lights position with the modelview matrix to get the new position in camera space.
number | the light to update position |
PREFIX int spTriangle3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 x3, Sint32 y3, Sint32 z3, Uint16 color )
Draws a triangle in 3D space. Returns 0 if not drawn (culling) or different bits, where the edges are: 1 screen, 2 left, 4 lefttop, 8 top, 16 righttop, 32 right, 64 rightbottom, 128 bottom, 256 leftbottom.
x1,y1,z1 | position of the first triangle point in space |
x2,y2,z2 | position of the second triangle point in space |
x3,y3,z3 | position of the third triangle point in space |
color | 16 Bit color of the triangle |
int | see above |
PREFIX int spQuad3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 x3, Sint32 y3, Sint32 z3, Sint32 x4, Sint32 y4, Sint32 z4, Uint16 color )
Draws a quad in 3D space. Returns 0 if not drawn (culling) or different bits, where the edges are: 1 screen, 2 left, 4 lefttop, 8 top, 16 righttop, 32 right, 64 rightbottom, 128 bottom, 256 leftbottom.
x1,y1,z1 | position of the first quad point in space |
x2,y2,z2 | position of the second quad point in space |
x3,y3,z3 | position of the third quad point in space |
x4,y4,z4 | position of the fourth quad point in space |
color | 16 Bit color of the quad |
int | see above |
PREFIX int spTriangleTex3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 u1, Sint32 v1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 u2, Sint32 v2, Sint32 x3, Sint32 y3, Sint32 z3, Sint32 u3, Sint32 v3, Uint16 color )
Draws a textured triangle in 3D space. Returns 0 if not drawn (culling) or different bits, where the edges are: 1 screen, 2 left, 4 lefttop, 8 top, 16 righttop, 32 right, 64 rightbottom, 128 bottom, 256 leftbottom. The used texture is determined with spBindTexture.
x1,y1,z1 | position of the first triangle point in space |
u1,v1 | texture position of the first triangle point |
x2,y2,z2 | position of the second triangle point in space |
u2,v2 | texture position of the second triangle point |
x3,y3,z3 | position of the third triangle point in space |
u3,v3 | texture position of the third triangle point |
color | 16 Bit color of the triangle |
int | see above |
PREFIX int spQuadTex3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 u1, Sint32 v1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 u2, Sint32 v2, Sint32 x3, Sint32 y3, Sint32 z3, Sint32 u3, Sint32 v3, Sint32 x4, Sint32 y4, Sint32 z4, Sint32 u4, Sint32 v4, Uint16 color )
Draws a textured quad in 3D space. Returns 0 if not drawn (culling) or different bits, where the edges are: 1 screen, 2 left, 4 lefttop, 8 top, 16 righttop, 32 right, 64 rightbottom, 128 bottom, 256 leftbottom. The used texture is determined with spBindTexture.
x1,y1,z1 | position of the first quad point in space |
u1,v1 | texture position of the first quad point |
x2,y2,z2 | position of the second quad point in space |
u2,v2 | texture position of the second quad point |
x3,y3,z3 | position of the third quad point in space |
u3,v3 | texture position of the third quad point |
x4,y4,z4 | position of the fourth quad point in space |
u4,v4 | texture position of the fourth quad point |
color | 16 Bit color of the quad |
int | see above |
PREFIX int spMesh3D( spModelPointer mesh, int updateEdgeList )
Draws a mesh in 3D space. Every time the was_drawn variable of every face is sets, which determines, whether the face was drawn (uneven 0) and where (like e.g. the return value of spTriangle3D).
mesh | pointer to a spModel struct to be drawn |
updateEdgeList | determines, whether the edgeList shall be updated. If 0, no update is made. When 1 every edge is marked. When 2 a solid body is assumed and “holes” (e.g. because of textured and untextured subbodys) are ignored. |
int | the count of drawn faces |
PREFIX int spMesh3DwithPos( Sint32 x, Sint32 y, Sint32 z, spModelPointer mesh, int updateEdgeList )
like spMesh3D, but with an additional position.
x,y,z | position to draw to mesh |
mesh | pointer to a spModel struct to be drawn |
updateEdgeList | determines, whether the edgeList shall be updated. If 0, no update is made. When 1 every edge is marked. When 2 a solid body is assumed and “holes” (e.g. because of textured and untextured subbodys) are ignored. |
int | the count of drawn faces |
PREFIX void spLine3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 x2, Sint32 y2, Sint32 z2, Uint16 color )
Draws a line in the 3d space with the given color. No light calculation is done!
x1,y1,z1 | the point from which the line should be drawn |
x2,y2,z2 | the point to which the line should be drawn |
color | 16 bit color of the line |
PREFIX void spRotozoomSurface3D( Sint32 x, Sint32 y, Sint32 z, SDL_Surface * surface, Sint32 zoomX, Sint32 zoomY, Sint32 angle )
Draws a rotozoomed surface in 3d space. If father away, it gets smaller. If you don’t want these effect evaluate zoomX and zoomY with the z-coordinate or use spBlit3D.
x,y,z | position in 3d space |
surface | SDL_Surface* to be drawn |
zoomX,zoomY | x and y zoom of the surface |
angle | the rotation of the surface in fixed point radian |
PREFIX void spRotozoomSurfacePart3D( Sint32 x, Sint32 y, Sint32 z, SDL_Surface * surface, Sint32 sx, Sint32 sy, Sint32 w, Sint32 h, Sint32 zoomX, Sint32 zoomY, Sint32 angle )
Draws a rotozoomed part of a surface in 3d space. If father away, it gets smaller. If you don’t want these effect evaluate zoomX and zoomY with the z-coordinate or use spBlitPart3D.
x,y,z | position in 3d space |
surface | SDL_Surface* to be drawn |
sx,sy | position of the left top corner of the part of the surface to be drawn |
w,h | size of the part to be drawn |
zoomX,zoomY | x and y zoom of the surface |
angle | the rotation of the surface in fixed point radian |
PREFIX void spCollapsePrimitives( int value )
Determines, whether ellipses, rectangles, ellipses borders and rectangle borders can collapse to an (unseeable) object smaller than one pixel.
value | 0 means, that the primitive do not collapse, if 1 for a specific distance it will not be drawn anymore (too small). Default is 1. |
PREFIX void spRectangleBorder3D( Sint32 x, Sint32 y, Sint32 z, Sint32 w, Sint32 h, Sint32 bx, Sint32 by, Uint16 color )
Draws a billboard rectangle border in 3d space.
x,y,z | position in 3d space |
w,h | width and height of the rectangle |
bx,by | width and height of the border |
color | 16 bit color of the rectangle |
PREFIX void spEllipseBorder3D( Sint32 x, Sint32 y, Sint32 z, Sint32 rx, Sint32 ry, Sint32 bx, Sint32 by, Uint16 color )
Draws a billboard ellipse border in 3d space.
x,y,z | position in 3d space |
rx,ry | x and y radius of the ellipse |
bx,by | width and height of the border |
color | 16 bit color of the ellipse |
Very much like the ”Billboard” 3D Functions, but the size and rotation is fix (0 and SP_ONE)!
PREFIX void spBlitPart3D( Sint32 x1, Sint32 y1, Sint32 z1, SDL_Surface * surface, Sint32 sx, Sint32 sy, Sint32 w, Sint32 h )
Blits a part of a surface in 3d space very fast.
x1,y1,z1 | position in space |
surface | SDL_Surface* to be drawn |
sx,sy | position of the left top corner of the part of the surface to be drawn |
w,h | size of the part to be drawn |
PREFIX void spSetPerspectiveTextureMapping( int value )
Every of the ”Real” 3D functions with textures can be rendered with affine texture mapping what may look a bit “wobly” or perspectivly correct, which looks the best, but may be slower!
value | 1 enables perspectively correct mapping, 0 disables. 0 is default |
PREFIX void spProjectPoint3D( Sint32 x, Sint32 y, Sint32 z, Sint32 * px, Sint32 * py, Sint32 * pz, Sint32 * w, Sint32 withModelview )
Projects a point in the 3D scene. Usefull if you will draw your own stuff in the 3D world.
x,y,z | 3d space point to project |
px,py,pz | pointer (!) to Sint32 coordinates, where to write the projection result |
w | pointer (!) to a Sint32 variable to save the w coordinate for w-clipping if needed |
withModelview | says, whether the rotation in the ModelViewMatrix should be involved. E.g. if you want to get a perspective correct width, you don’t want the rotation. In this case set it to 0. Most of the time you should be fine with 1 |
PREFIX void spUsePrecalculatedNormals( int value )
Desides, whether the precalculated normal values of meshes are used or not. So this works only with spMesh3D* functions. Be carefull! You can use this optimization only, if you don’t scale! Translation and rotations are fine. At default this feature is disabled.
value | 1 enabled, 0 disabled (default) |
Saves the recent ModelView matrix on a stack.
PREFIX void spPushModelView( void )
Loads the ModelView matrix from the stack.
PREFIX void spPopModelView( void )
Function for setting up the frustom of the projection matrix.
PREFIX void spSetFrustumf2( Sint32 * matrix, Sint32 left, Sint32 right, Sint32 bottom, Sint32 top, Sint32 znear, Sint32 zfar )
Sets the projection matrix.
PREFIX void spSetPerspective( float fovyInDegrees, float aspectRatio, float znear, float zfar )
Sets and returns a projection matrix for steroscopic viewing, so most of the times you will call this function for each eye once.
PREFIX void spSetPerspectiveStereoscopic( Sint32 * projectionMatrix, float fovyInDegrees, float aspectRatio, float znear, float zfar , float z0, float distance )
Use this function, if you want two projection matrixes with the given eye distance for stereoscopic projection.
PREFIX void spStereoCreateProjectionMatrixes( Sint32 * left_matrix, Sint32 * right_matrix, float fovyInDegrees, float aspectRatio, float znear, float zfar , float z0, float distance, int crossed )
Returns the projetion matrix pointer.
PREFIX Sint32* spGetProjectionMatrix( void )
Returns you the REAL modelview matrix pointer!
PREFIX Sint32* spGetMatrix( void )
Sets the modelview matrix to the identity matrix.
PREFIX void spIdentity( void )
Multiplies the modelview matrix with the given matrix.
PREFIX void spMulMatrix( Sint32 * matrix )
Multiplies the modelview matrix with the given matrix, but from the left side.
PREFIX void spMulMatrixLeft( Sint32 * matrix )
spScale scales the modelview matrix.
PREFIX void spScale( Sint32 x, Sint32 y, Sint32 z )
Rotates rad radians around the vector (x,y,z).
PREFIX void spRotate( Sint32 x, Sint32 y, Sint32 z, Sint32 rad )
Rotates rad radians around the x-axis.
PREFIX void spRotateX( Sint32 rad )
Rotates rad radians around the y-axis.
PREFIX void spRotateY( Sint32 rad )
Rotates rad radians around the z-axis.
PREFIX void spRotateZ( Sint32 rad )
This function does a relative translation to (x,y,z).
PREFIX void spTranslate( Sint32 x, Sint32 y, Sint32 z )
Sets Light Calculation on or off.
PREFIX void spSetLight( int value )
Specifies, whether a light is used or not for the light calculation.
PREFIX void spEnableLight( int number, Sint32 active )
Sets the color of a light
PREFIX void spSetLightColor( int number, Uint32 r, Uint32 g, Uint32 b )
Sets the Light Position.
PREFIX void spSetLightPosition( int number, Sint32 x, Sint32 y, Sint32 z )
If you want to update the lights position without a recall of spSetLightPosition use this function.
PREFIX void spUpdateLight( int number )
Sets the global ambient light value.
PREFIX void spSetAmbientLightColor( Uint32 r, Uint32 g, Uint32 b )
Draws a triangle in 3D space.
PREFIX int spTriangle3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 x3, Sint32 y3, Sint32 z3, Uint16 color )
Draws a quad in 3D space.
PREFIX int spQuad3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 x3, Sint32 y3, Sint32 z3, Sint32 x4, Sint32 y4, Sint32 z4, Uint16 color )
Draws a textured triangle in 3D space.
PREFIX int spTriangleTex3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 u1, Sint32 v1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 u2, Sint32 v2, Sint32 x3, Sint32 y3, Sint32 z3, Sint32 u3, Sint32 v3, Uint16 color )
Draws a textured quad in 3D space.
PREFIX int spQuadTex3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 u1, Sint32 v1, Sint32 x2, Sint32 y2, Sint32 z2, Sint32 u2, Sint32 v2, Sint32 x3, Sint32 y3, Sint32 z3, Sint32 u3, Sint32 v3, Sint32 x4, Sint32 y4, Sint32 z4, Sint32 u4, Sint32 v4, Uint16 color )
Draws a mesh in 3D space.
PREFIX int spMesh3D( spModelPointer mesh, int updateEdgeList )
like spMesh3D, but with an additional position.
PREFIX int spMesh3DwithPos( Sint32 x, Sint32 y, Sint32 z, spModelPointer mesh, int updateEdgeList )
Draws a line in the 3d space with the given color.
PREFIX void spLine3D( Sint32 x1, Sint32 y1, Sint32 z1, Sint32 x2, Sint32 y2, Sint32 z2, Uint16 color )
Draws a rotozoomed surface in 3d space.
PREFIX void spRotozoomSurface3D( Sint32 x, Sint32 y, Sint32 z, SDL_Surface * surface, Sint32 zoomX, Sint32 zoomY, Sint32 angle )
Draws a rotozoomed part of a surface in 3d space.
PREFIX void spRotozoomSurfacePart3D( Sint32 x, Sint32 y, Sint32 z, SDL_Surface * surface, Sint32 sx, Sint32 sy, Sint32 w, Sint32 h, Sint32 zoomX, Sint32 zoomY, Sint32 angle )
Draws a billboard rectangle in 3d space.
PREFIX void spRectangle3D( Sint32 x, Sint32 y, Sint32 z, Sint32 w, Sint32 h, Uint16 color )
Determines, whether ellipses, rectangles, ellipses borders and rectangle borders can collapse to an (unseeable) object smaller than one pixel.
PREFIX void spCollapsePrimitives( int value )
Draws a billboard ellipse in 3d space.
PREFIX void spEllipse3D( Sint32 x, Sint32 y, Sint32 z, Sint32 rx, Sint32 ry, Uint16 color )
Draws a billboard rectangle border in 3d space.
PREFIX void spRectangleBorder3D( Sint32 x, Sint32 y, Sint32 z, Sint32 w, Sint32 h, Sint32 bx, Sint32 by, Uint16 color )
Draws a billboard ellipse border in 3d space.
PREFIX void spEllipseBorder3D( Sint32 x, Sint32 y, Sint32 z, Sint32 rx, Sint32 ry, Sint32 bx, Sint32 by, Uint16 color )
Blits a surface in 3d space very fast.
PREFIX void spBlit3D( Sint32 x1, Sint32 y1, Sint32 z1, SDL_Surface * surface )
Blits a part of a surface in 3d space very fast.
PREFIX void spBlitPart3D( Sint32 x1, Sint32 y1, Sint32 z1, SDL_Surface * surface, Sint32 sx, Sint32 sy, Sint32 w, Sint32 h )
Every of the ”Real” 3D functions with textures can be rendered with affine texture mapping what may look a bit “wobly” or perspectivly correct, which looks the best, but may be slower!
PREFIX void spSetPerspectiveTextureMapping( int value )
Projects a point in the 3D scene.
PREFIX void spProjectPoint3D( Sint32 x, Sint32 y, Sint32 z, Sint32 * px, Sint32 * py, Sint32 * pz, Sint32 * w, Sint32 withModelview )
Desides, whether the precalculated normal values of meshes are used or not.
PREFIX void spUsePrecalculatedNormals( int value )
This functions merges two same sized (!)
PREFIX void spStereoMergeSurfaces( SDL_Surface * left, SDL_Surface * right, int crossed )
This texture will be used for all following draw operations with textures
PREFIX void spBindTexture( SDL_Surface * texture )