Make games that sell.
K3D
K3D:

#include "K3D.h"


Quick Reference

Quick Reference
beginScene
endScene
scale
setShadeMode
display
setAlphaMode
setTexture
enableBlending
load
loadK3D
saveK3D

void beginScene( bool clearScene , bool useScreenRes) ;
Starts the rendering of a 3D scene.

ClearScene only clears the ZBuffer.

set useScreenRes to True to use screencoordinates ( 2D ),
note that you might have to scale the object to be able to see it.

void endScene( void ) ;
ends a 3d scene rendering.

scale( float sx , float sy , float sz ) ;
scales a model in real time.

void setShadeMode( EShadeMode esm ) ;
sets the shade mode for the display command : ESM_FLAT or ESM_GOURAUD
Use ESM_FLAT for robots for example, gouraud is "smoothing" the object.

void display( float x, float y , float z , float rx=0 , float ry=0 , float rz=0 ) ;
displays a model at position x,y,z ( 0,0,0 = center of the screen if you are not using screenRes )
rx/ry/rz represents the rotations of the object.

This function calls:
void displayFlat( float x , float y , float z , float rx=0 , float ry=0 , float rz=0 ) ;
void displayGouraud( float x , float y , float z , float rx=0 , float ry=0 , float rz=0 ) ;
depending on the shade model selected ( you might want to call directly the method that you prefer )

void setAlphaMode( bool regular ) ;

sets the alpha blending mode, true/false ( additive )


void setTexture( KGraphic *texturePtr ) ;

sets a texture for an object. ( in case you didn't load it with the model or want to modify it )

void enableBlending( bool allowBlend , float blendFactor ) ;

Enables alpha blending and adjust the blending coefficient ( usefull to fade out objects )


bool load( char *filename , float scaleFactor = 1 , bool loadTexture = true ) ;

Loads a .ASE model .
scaleFactor can be set to rescale the object on load ( precalculated )
loadTexture set to false will not load the texture associated with the model. ( useful if you want to
share the same texture through different models )
Currenly only 1 texture and 1 Mesh are supported per model.

Materials and animations are not supported.

loadMk is currently under development ( loads milkshape ascii objects )


void loadK3D(char *filename, bool loadtexture ) ;

loads a native k3d 3d object.


void saveK3D(char *filename ) ;

saves a native k3d 3d object.



© 2003-2005, Phelios, inc. - All rights reserved.
Trademarks mentioned are the property of their respective owners.