Fine Programming from Paris.                      (c) May 2002


    PROGRAMMER'S REFERENCES - 1 Concepts
Introduction
Download
FAQ
Tutorial
Listing 1
Listing 2
System is the anchor to all the system (mainly OS dependant) datas. System is not used directly. 


Scene contain all the  Textures, Images, 3D objects(Objets) and Animation for  generating a 3D Scene and render an Image of this 3D Scene.


Window is a window or a screen, something to draw Images into.


XYZpoint is a 3D point defined by 3 numbers x y z of type WORD.
Center of Scene image is (0,0,0)

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 



Point is a reference to an XYZpoint in a Facette. It means that the XYZpoint values are NOT in the facette.


Facette is a polygon made of Points.  The user is responsable of non-convexity, non complexity cause Woof3D assume that polygons are simples and non ambigous.


Objet is 3D Object like those defined in Caligari or Vscape files (hierarchical, matrix, etc...). This structure exist in Woof3D for compatibility.  Objets are made of PointsFacettes & XYZpoint& Objets and some internal datas. Objets can be loaded from files or created from scratch.


Element is  something that can be move inside the Scene
So Elements are used for Animations but Elements can also be moved directly with the fonction Woof3DSetElementPosition()
Element 0 is the Scene itself and so contain all.
Elements can be a full Objet or several contigous Objets or one part from an  Objet


Frame is the position of an Element at a t time (TimeFrame).


Animation is a list of Frames that define an Element movement (animation 
 Timeframes).


Image is a (mainly only 24 bits)  picture loaded from files or created from scratch.


Texture is a part of an Image that can be use for texturing an entire object or  facettes. It's mainly a kind of SubImage with DrawMode and some internal datas.


Button is a button inside a Window.


SubImage is a rectangular part of an Image that can be use for sprites or buttons.


Return Value All WoofD functions return a WORD.
Often it is the Number of the created or modified Thing. Often it is 0 for functions that never fail. But if it return a negative value the function have fail for sure
It is safer to use the macro VERIFY(Number ) that is equivalent to
         if (Number < 0) goto ProgEnd;
Exemple:
Nscene=Woof3DOpenScene(AUTO,AUTO,Nwindow);
VERIFY(Nscene)


Thing  is a generic term for designing an Objet, an Image, a Texture, etc.. from this Scene.


Nthing or Number is  a WORD  that give access to a Thing  (an Objet, an Image, a Texture, etc....). So there are in fact Nobjet, Nimage, Nwindow,etc...
So you never use pointers with Woof3D but numeric handles called Nthings


Name  is  a string of char  (UBYTE *name) for naming a Thing (Objet, Image, Texture, etc...) 
You can obtain the Number of a Thing (Objet, Image, Texture, etc...) with Woof3DGetNumber( ) 


FileName  is  a string of char  (UBYTE *name) defining a path and file name. 
Example "..\images\dinosaure.bmp"
 
PROGRAMMER'S REFERENCES - 2 Functions
 


WORD Woof3DAddAnimation (UBYTE * name ,WORD AnimMode );


Description
Add a new empty animation to the Scene with given name. It will then need Woof3DAddFrame
Special parameters
AnimMode
Return value
Nanimation




WORD Woof3DAddElement (UBYTE * name ,WORD Nobjet1 ,WORD Npoint1 ,WORD Nobjet2 ,WORD Npoint2 );


Description
Add a new Element to the Scene. This Element is made from all the Objets/Facettes between Nobjet1/Nfacette1 and Nobjet2/NFacette2 
Special parameters
Nfacette1 and Nobjet2/NFacette2 can be AUTO for selecting a single NObjet1
Return value
Nelement = Element added




WORD Woof3DAddFacette (void);


Description
Add an empty Facette to the last Objet of the Scene
Special parameters
Return value
Nfacette= This Facette Number




WORD Woof3DAddFacetteFromFX(WORD *parameters,WORD FacetteFXMode);


Description
Create Facettes from existing Points
Special parameters
Return value



WORD Woof3DAddImage (UBYTE * name ,WORD large ,WORD high ,WORD bits );


Description
Create a new Image in the Scene for user use.
Special parameters
bits can be 8 15 16 24 32 bits. But most functions only works with 24 bits. (in v1.0 always use 24 bits)
Return value
Nimage= The new image number. Note that this image is not used by anything (Sys or Scene) and must be freeed by user.




WORD Woof3DAddObjet (UBYTE * name );


Description
Add an empty Objet to the Scene.
Special parameters
Return value
Nobjet = Objet created




WORD Woof3DAddObjetFromFX (WORD * parameters ,WORD ObjetFXMode );


Description
Create an Objet from other Objets/Facettes with a special effects (FX) Usefull for creating Objet from scratch
Special parameters
ObjetFXMode
Return value
Nobjet = Objet created




WORD Woof3DAddPointFacette (WORD Npoint );


Description
Add the nth XYZPoint to the last Facette of the last Objet of the Scene
Special parameters
Return value
Nfacette= last Facette Number




WORD Woof3DAddPointXYZ (WORD x ,WORD y ,WORD z );


Description
Create one X Y Z point in the last objet. Similar to Woof3DAddPointXYZFromImage( ). Center of Scene image is (0,0,0)
Special parameters
Return value
Npoint= Last point created number or return -1 if cant create more points.




WORD Woof3DAddPointXYZFromImage (WORD Nimage ,UBYTE * RGB ,WORD CenterMode );


Description
Create automatically from an image a serie of X Y Z points in the last objet. Similar to Woof3DAddPointXYZ with X Y Z values that are the coordinates inside the image. If a pixel has the same color than *RGB then it is added to the list. Z is always 0. No facettes are created.
Special parameters
CenterMode define how the X Y Z points are centered
Return value
Number of X Y Z points created 




WORD Woof3DAddSetFrame (WORD Nframe ,ULONG time ,WORD Nelement ,WORD RefMode ,WORD Xtheta ,WORD Ytheta ,WORD Ztheta ,LONG GlobalPosX ,LONG GlobalPosY ,LONG GlobalPosZ );


Description
Add and Set a new frame to the Scene inside the last animation defined. or Set an existing frame.
Special parameters
NEW if n is set to NEW then add a new frame else modify an existing one.
Return value
Nframe




WORD Woof3DAddSubImage (WORD Nimage ,UBYTE * name ,WORD x ,WORD y ,WORD large ,WORD high );


Description
Add a SubImage
Special parameters
Return value



WORD Woof3DAddTexture (WORD Nimage ,WORD x ,WORD y ,WORD large ,WORD high ,WORD posX ,WORD posY ,WORD TexMode ,WORD DrawMode ,UBYTE * name );


Description
Create a Texture from given Image number n minX,minY,maxX,maxY specify the rectangle defining the texture area within this Image posX posY define the Texture Centering. DrawMode define the drawing method for Facette/Points
Special parameters
minX,minY,maxX,maxY can be AUTO so Texture is Image size. posX posY can be AUTO so Texture is centered.
Return value
Ntexture= New texture added




WORD Woof3DAlert (UBYTE * text );


Description
Open an Alert window with the given text message (window aspect change with OS) 
Special parameters
None
Return value



WORD Woof3DCenterObjet (WORD Nobjet ,WORD Nfacette ,WORD CenterMode );


Description
Center a 3D Objet to the Center (0,0,0). All the Points of Nobjet are modified.
Special parameters
CenterMode define how the X Y Z points are centered
Return value
0




WORD Woof3DClear (WORD Thing ,WORD n );


Description
Clear the nth Thing of the scene. Thing give the type of Thing to clear
Special parameters
n can be set to ALL to clear all given Things
Return value
0




WORD Woof3DClose (WORD Nthing );


Description
Close definitely (and free memory of) this Scene or this Window
Special parameters
Nthing can be an Nwindow or SCENE to close this Scene
Return value



WORD Woof3DComputeScene (WORD ComputeMode);


Description
The Big One function : compute and draw all the Scene (Objet,texture,facettes,etc..).
Special parameters
None cause the result depends only of what is defined in the Scene. ComputeMode MUST be 0
Return value



WORD Woof3DCosinus (WORD angle ,WORD * cos ,WORD * sin );


Description
Return the Cosinus an Sinus value of the given angle of rotation in degree * 10 Example angle=450 mean a 45° So Angle must be in 0 à 3599
Special parameters
None
Return value



WORD Woof3DDraw (WORD Nimage ,WORD x ,WORD y ,WORD large ,WORD high ,UBYTE * texte ,WORD StyleMode ,WORD state );


Description
Draw a block with different Styles (TEXT, RECTANGLE,etc…) in the Image
Special parameters
StyleMode
Return value



WORD Woof3DDrawFillRectangleRGB (WORD Nimage ,WORD x ,WORD y ,WORD large ,WORD high ,UBYTE * RGB );


Description
Draw a filled rectangle in the Image. Use instead Woof3DDraw()
Special parameters
None
Return value



WORD Woof3DDrawLineRGB (WORD Nimage ,WORD x0 ,WORD y0 ,WORD x1 ,WORD y1 ,UBYTE * RGB );


Description
Draw a line in the Image Use instead Woof3DDraw()
Special parameters
None
Return value



WORD Woof3DDrawPixelRGB (WORD Nimage ,WORD x ,WORD y ,UBYTE * RGB );


Description
Draw a single pixel in the Image (not an efficient fonction)
Special parameters
None
Return value



WORD Woof3DDrawRectangleRGB (WORD Nimage ,WORD x ,WORD y ,WORD large ,WORD high ,UBYTE * RGB );


Description
Draw a rectangle in the Image Use instead Woof3DDraw()
Special parameters
None
Return value



WORD Woof3DDrawSubImage (WORD Nimage ,WORD Nsubimage ,WORD x ,WORD y ,WORD DrawMode );


Description
Draw a SubImage in the Image
Special parameters
None
Return value



WORD Woof3DDrawTextRGB (WORD Nimage ,WORD x ,WORD y ,UBYTE * text ,UBYTE * RGB );


Description
Draw a Text in the Image Use instead Woof3DDraw()
Special parameters
None
Return value



WORD Woof3DDrawWindow (WORD Nwindow );


Description
ReDraw the Window with the 24 bits image glued to YOU SHOULD not use this function that is handled by Woof3DWindowsManager()
Special parameters
None
Return value



WORD Woof3DFileRequester (UBYTE * fileName ,UBYTE * title );


Description
Open a File Requester Window (window aspect change with OS) to select a FileName
Special parameters
None
Return value



WORD Woof3DGetButtonsValues (WORD Nwindow ,BOOL * click ,WORD * state ,WORD * value );


Description
Fill 3 arrays with the current values of the buttons from a Window
Special parameters
None
Return value



WORD Woof3DGetNumber (WORD Thing ,UBYTE * name );


Description
Get the Number of a Thing from his Name. Thing give the type of Thing to obtain
Special parameters
None
Return value



WORD Woof3DGetPixelRGB (WORD Nimage ,WORD x ,WORD y ,UBYTE * RGB );


Description
Get the RGB color of a pixel (not very usefull)
Special parameters
None
Return value



WORD Woof3DGetValuesEdition(WORD *Nobjet,WORD *Nfacette,WORD *Npoint);


Description
Get the selected values that can be acessed with the SELECTION parameter
Special parameters
None
Return value
0




WORD Woof3DGetValuesEditionMore(WORD *Nimage,WORD *Ntexture,WORD *Nelement,WORD *Nanimation,WORD *Nframe);


Description
Get the selected values that can be acessed with the SELECTION parameter
Special parameters
None
Return value
0




WORD Woof3DGetValuesPosition (WORD Nelement ,WORD * Xtheta ,WORD * Ytheta ,WORD * Ztheta );


Description
Get the actual position variables from an Element (how it is turned)
Special parameters
None
Return value
Nelement




WORD Woof3DGetValuesWindow (WORD Nwindow ,UBYTE * key ,WORD * state ,BOOL * mouseMove ,WORD * WinAction ,WORD * specialkey );


Description
Get all the usefull variables from a windows to follow user actions
Special parameters
key is the keyboard mouseMove is TRUE if mouse has moved state specialkey
Return value



WORD Woof3DGetValuesXYZ(WORD Nthing,LONG *x,LONG *y,LONG *z)


Description
Get an actual position X Y (Z)
Special parameters
Nthing can be SELECTION actual edition cursor position on the 3D environnement WINDOW actual x and y mouse position (WORD converted to LONG, Z = 0) SCENE actual GlobalPosition X Y Z of the 3D Scene Nelement actual GlobalPosition X Y Z of the Element N
Return value
Nthing




WORD Woof3DGetXYZpoint (WORD Nobjet ,WORD Nfacette ,WORD Npoint ,WORD * XYZpoint );


Description
Give access to an array of 3 WORDs defining an XYZpoint. You can assume only an access to this unique XYZpoint.
Special parameters
None
Return value
0




WORD Woof3DImagesFX (WORD Nimage ,WORD Nimage2 ,UBYTE * RGB ,WORD ImageFXMode );


Description
Apply a special effects (FX) to an 24 bits image (or 2)
Special parameters
ImageFXMode
Return value



WORD Woof3DLoadFile (UBYTE * filename ,UBYTE * name );


Description
Load a file to the Scene
Special parameters
If filename is then this function call Woof3DFileRequester() to obtain a filename. File Formats recognized In Woof3D v1.0 those file formats are recognized and automatically stored in the Scene : Picture BMP 24 bits unpacked (to Scene/image) File Config Woof3D (to Scene) File VScape Ascii (to Scene/Objet) File Caligari 24 Ascii (to Scene/Objet) File Caligari 2 Ascii (to Scene/Objet)
Return value
Nthing= loaded Thing number




WORD Woof3DModify(WORD Thing,WORD parameter,WORD value);


Description
Modify one parameter of the Scene
Special parameters
In v1.0 only that Woof3DModify(SCENE,BACKGROUND,TRUE); Woof3DModify(SCENE,BACKGROUND,FALSE); Woof3DModify(SCENE,DRAWMODE,NEXT); Woof3DModify(SCENE,BACKGROUND,TEXTURE); or an other DrawMode
Return value



WORD Woof3DModifyScene (WORD left ,WORD right ,WORD up ,WORD down ,WORD zoom ,WORD scale ,WORD RefMode );


Description
Modify some parameter of an existing Scene
Special parameters
AUTO or NONE
Return value



WORD Woof3DModifyTexture (WORD Ntexture ,WORD posX ,WORD posY ,WORD DrawMode ,WORD RefMode );


Description
Modify an existing Texture posX posY define the Texture Centering. DrawMode define the drawing method for Facette/Points
Special parameters
left,right,up,down, define in pixels a rectangle that clip the 3D image zoom activate the perspective or else should be 0 Scale enlarge the image = a 320 pixels large 3D image has a 1024 scale factor.
Return value



WORD Woof3DOpenScene (WORD large ,WORD high ,WORD Nwindow );


Description
First function to call for making a 3D Scene. Large and high define the size in pixels of the image (of the Scene) that will be rendered. large MUST be multiple of 32 (32,64,...,320,etc..) large and high MUST be in the range 32-1024 WindowPt is used to display this image (Window/screen).
Special parameters
if Nwindow is AUTO then a new Window is created with Large and high. if Large and high are AUTO then the Nwindow dimensions are used. Large and High define the maximal surface that could be rendered (in v1.0 large and high MUST be window size) 
Return value



WORD Woof3DOpenWindow (WORD large ,WORD high ,WORD bits ,char * name ,WORD WindowMode ,WORD nb_buttons );


Description
First function to call to obtain a display (window aspect change with OS) 
Special parameters
If all is AUTO ask user to choose resolution & mode
Return value



WORD Woof3DPrint (WORD Thing ,WORD n );


Description
Print info about the nth Thing of the scene. Thing give the type of Thing to print
Special parameters
n can be set to ALL to print all given stuffs
Return value
0




WORD Woof3DSelector (UBYTE * text_list );


Description
Open a Window with buttons to give a choice to user
Special parameters
texte must be of the kind Button1|Button2|Button3 that will create 3 buttons All buttons texts MUST be separate by |
Return value
Nbutton = the selected button from 0 to n-1




WORD Woof3DSetButton (WORD Nwindow ,WORD Nbutton ,WORD x ,WORD y ,WORD large ,WORD high ,UBYTE * text ,WORD ButtonMode );


Description
Define or modify a button of the Window. This Window must have been created with buttons
Special parameters
Return value
0




WORD Woof3DSetButtonValue(WORD Nwindow,WORD Nbutton,WORD state,WORD value)


Description
Change the actual button value/state. This Window must have been opened with buttons at Woof3DOpenWindow. This button must have been defined with Woof3DSetButton.
Special parameters
Return value
0




WORD Woof3DSetEdition (WORD Nobjet ,WORD Nfacette ,WORD Npoint ,WORD Nimage ,WORD Ntexture ,WORD Nelement ,WORD Nanimation ,WORD Nframe ,WORD EditMode );


Description
Define actual selected values that can be acessed with the SELECTION parameter
Special parameters
Return value
EditMode




WORD Woof3DSetElementAnimation (WORD Nelement ,WORD Nanim );


Description
Assign an animation to an element. Element position will then change with the animation and time.
Special parameters
Return value
Nelement = Element modified




WORD Woof3DSetElementPosition (WORD Nelement ,WORD RefMode ,WORD Xtheta ,WORD Ytheta ,WORD Ztheta ,LONG GlobalPosX ,LONG GlobalPosY ,LONG GlobalPosZ );


Description
Define or change the position of Nelement immediatly. X Y Z theta Xtheta,Ytheta,Ztheta define the angle of rotation in degree * 10 Example Xtheta=450 mean a 45° axe X rotation Example Ztheta=3600 mean a 360° axe Z rotation Element 0 is the Scene ViewPoint see also Woof3DViewPoint() GlobalPos X Y Z GlobalPosX,GlobalPosY,GlobalPosZ define the global (universe) position If the Scene ViewPoint is also GlobalPos 0,0,0 then a element at (0,0,0) is screen centered.
Special parameters
Xtheta,Ytheta,Ztheta,GlobalPosX,GlobalPosY,GlobalPosZ can be NONE meaning this value is unchanged.
Return value
Nelement = Element modified




WORD Woof3DSetFacettesTexture (WORD Nobjet ,WORD Nfacette ,WORD Ntexture );


Description
Set a Texture to an Objet or a Facette
Special parameters
Return value



WORD Woof3DSetImageButton (WORD ButtonMode ,UBYTE * name ,WORD Nsubimage1 ,WORD Nsubimage2 ,WORD Nsubimage3 ,WORD Nsubimage4 ,WORD Nsubimage5 );


Description
Define a new kind of button with the five different aspects from five SubImages
Special parameters
Return value



WORD Woof3DSetObjetPosition (WORD Nobjet ,WORD Xtheta ,WORD Ytheta ,WORD Ztheta ,WORD Xtrans ,WORD Ytrans ,WORD Ztrans );


Description
Modify a 3D Objet (Objet) to the given position. All the Points of objet n are modified (destructive function). In fact it recenter the objet to a new position
Special parameters
Nobjet can be set to ALL
Return value
Nobjet = This Objet Number




WORD Woof3DSetViewPoint (WORD Xtheta ,WORD Ytheta ,WORD Ztheta ,LONG GlobalPosX ,LONG GlobalPosY ,LONG GlobalPosZ ,WORD RefMode );


Description
Define or change the position of Scene ViewPoint. Element 0 is the Scene ViewPoint see also Woof3DViewPoint() This function is equivalent to Woof3DRotMoveElement(ScenePt,0,mode,Xtheta,Ytheta,Ztheta,GlobalPosX,G GlobalPosY,GlobalPosZ);
Special parameters
RefMode define if the given values replace or are added to the existing values. Xtheta,Ytheta,Ztheta,GlobalPosX,GlobalPosY,GlobalPosZ can be NONE meaning this value is unchanged.
Return value
0




WORD Woof3DSetWindowAction (WORD Nwindow ,WORD WinAction );


Description
Force actual Window Action (Not for use)
Special parameters
always 0
Return value



WORD Woof3DWindowsManager (WORD ManageMode);


Description
Manage & redraw all the opened Windows ManageMode MUST be 0
Special parameters
always 0
Return value
always 0
  PROGRAMMER'S REFERENCES - 3 Parameters
  DrawMode define the Texture drawing method for Facette/Points
SHADE grey shaded
COLORSHADE average Texture's color shaded
TEXTURE textured
TEXTURESHADE textured and shaded
SPRITE textured with holes where pixels are RGB (0,0,0)
SPRITESHADE textured and shaded 
                        with holes where pixels are RGB (0,0,0)
QTEXTURE textured with fast draw (no Zbuffering) (bugged !!)
TRANSP transparent
TRANSPSHADE transparent and shaded
FROMTEX use the DrawMode defined on each Textures. Not for use.
LINES draw Facettes with lines only
POINTS draw only textured points
NOTHING1 draw nothing (for debugging dont use it)
NOTHING2 draw nothing (for debugging dont use it)


SHADE & COLORSHADE

TEXTURE & TEXTURESHADE

SPRITE & SPRITESHADE

TRANSP & TRANSPSHADE

LINES & POINTS

NOTHING1 or NOTHING2




TexMode  is the texturing axe for Woof3DAddTexture, Woof3DModifyTexture
XAXE Texture is mapped among the X axis
YAXE Texture is mapped among the Y axis
ZAXE Texture is mapped among the Z axis


Thing  give what to use in a generic function
SCENE the full Scene content
OBJET a 3D object from this Scene
TEXTURE a Texture from this Scene
IMAGE an Image from this Scene
MATRICES a 3D object and matrices from this Scene
ELEMENT an Element from this Scene
ANIMATION an Animation from this Scene
FACETTE a Facette from this Scene
TEXTURE a Texture from this Scene
XYZPOINT an XYZ Point from this Scene




AnimMode  define the type of animation
ANIM_SIMPLE frames are played one time only 
ANIM_LOOP frames are played again and again 
ANIM_FLIP frames are played then played back, etc... 
ANIM_TRM one frame define a speed in Turn per Minute (not
implemented in v1.0) 
ANIM_KMH one frame define a speed in Kmh (not implemented in v1.0)


CenterMode define how the X Y Z points are centered
XYZCENTER = fully centered
XMIN        = aligned on X minimum value = left aligned
XMAX       = aligned on X minimum value = left aligned
XCENTER = centered on X median value = horizontal centering
YMIN        = aligned on Y minimum value = up aligned
YMAX       = aligned on Y minimum value = down aligned
YCENTER = centered on Y median value = horizontal centering
ZMIN        = aligned on Z minimum value
ZMAX       = aligned on Z minimum value
ZCENTER = centered on Z median value




RefMode define if the given values replace or are added to the existing values.
ABSOLUTE all given X Y Z Theta and GlobalPos are absolute and replace the existing values
RELATIVE given X Y Z Theta and GlobalPos are added to the existing values


File Format in Woof3D v1.0 those file formats are recognized and automatically 
stored in the Scene : 
Picture BMP 24 bits unpacked (to Scene/image) 
File Scene Woof3D (to Scene) 
File VScape Ascii (to Scene/Objet) 
File Caligari 24 Ascii (to Scene/Objet) 
File Caligari 2 Ascii (to Scene/Objet)


ObjetFXMode for generating a new Objet with Woof3DAddObjetFromFX ()
OBJET_FAN create a polygon 
OBJET_BOX create a box 
OBJET_TEXTURE create a simple Facette with Texture size 
OBJET_EXTRUDE1 create an Objet  from 2 Facettes 
OBJET_EXTRUDE2 create an Objet  from 2 Facettes


ImageFXMode special effects (FX) to an 24 bits image (or 2) can be 
FX_RGB_BGR invert bytes R and B 
FX_TRANSP make given RGB color pixels to RGB (0,0,0) and so
transparent. If a pixel is already RGB (0,0,0) it will be RGB(0,0,1) 
FX_YFLIP Flip vertically 
FX_XFLIP Flip horizontally 
FX_REPARTITION Need an area closed by given RGB color and make
an image delta map based from pixels inside this area


speecialkey is the keyboard non-ascii keys. Only  those are
defined in this version 
KEYPRIOR 
KEYNEXT
KEYLEFT
KEYUP
KEYRIGHT
KEYDOWN


state is the actual mouse event for Windows/Buttons and can be 
  IS_NONE mouse state undefined when program start 
  IS_UP 
  IS_PRESS 
  IS_DOWN 
  IS_RELEASE 


WinAction is the action needed by the window, it got no use except for Woof3DWindowsManager()
DO_NOTHING
DO_DRAW
DO_MAKE
DO_COMPUTE
DO_READ
DO_CANCEL
DO_QUIT
  PROGRAMMER'S REFERENCES - 4 Scenes
  Scenes Files are simple text files called *.w3d used  as script for Woof3D they can be loaded like this
 Woof3DLoadFile("tonneau.w3d","MyScene");
Without knowing C you can create *.w3d Scenes Files

They alway began with the text Woof3D.V1
Example
Woof3D.V1

LoadFile
3
..\images\clouds14.bmp BACKGROUND
..\objets\tonneau.sob tonneau 
..\images\BoisI23.bmp bois 

AddTexture
1
bois AUTO AUTO AUTO AUTO AUTO AUTO ZAXE TEXTURESHADE texture1 

SetFacettesTexture
1
tonneau ALL texture1 

Keyword  that must be here

Load files (an Objet or  Image or Scene)
load 3 things
a BMP picture used as background
a Caligari ascii 3D object baril renamed tonneau
a BMP picture of wood renamed bois

Create Textures
1 texture
Use Full image size and center it
 

Objet or Facettes texturing
1 texturing
texturing the baril (tonneau) with texture1 (wood)

Usable Woof3D functions are 

  • Clear
  • LoadFile
  • AddTexture
  • SetFacettesTexture
  • SetObjetPosition
  • AddElement
  • SetElementPosition
  • AddAnimation
  • SetElementAnimation
Functions are used in a more compact way (see examples)

diane.w3d an example showing almost all possibilities :
Woof3D.V1

LoadFile
6
..\images\Camerisier.bmp BACKGROUND
..\objets\DianeCorps.geo corps 
..\objets\aile.geo aile1 
..\objets\aile.geo aile2
..\images\DianeCorpsR.bmp corps 
..\images\DianeR.bmp aile

AddElement
3
Ecorps corps AUTO AUTO AUTO
Eaile1 aile1 AUTO AUTO AUTO
Eaile2 aile2 AUTO AUTO AUTO

AddTexture
2
aile AUTO AUTO AUTO AUTO 67 57 XAXE TEXTURE texAile1 
corps AUTO AUTO AUTO AUTO AUTO AUTO XAXE TEXTURE texCorps 

SetFacettesTexture
3
corps ALL texCorps 
aile1 ALL texAile1 
aile2 ALL texAile1 

SetObjetPosition
3
aile1 0 0 0 0 0 -67 
aile2 0 0 0 0 0 -67 
corps 0 0 0 0 0 0

AddAnimation 
anim1  ANIM_FLIP 
2
00  Eaile1 0 0   0 0 15 -8 ABSOLUTE 
100 Eaile1 0 900 0 0 15 -8 ABSOLUTE 

AddAnimation 
anim2  ANIM_FLIP 
2
00  Eaile2 0 1800 0 0 15 8 ABSOLUTE 
100 Eaile2 0 900  0 0 15 8 ABSOLUTE 

SetElementAnimation
Eaile1 anim1 
SetElementAnimation
Eaile2 anim2 

SetElementPosition
SCENE 0 900 200 0 0 0 ABSOLUTE