Playing animations with DarkBASIC Professional
Here is a short example file for DarkBASIC Professional that loads, animates and rotates the file yago.x:
RemStart
------------------------------------------------------
Using CharacterFX Animations in DarkBASIC Professional
26 February 2003
------------------------------------------------------
Written by Guy Savoie
Director
Real Game Tools
guysavoie@realgametools.com
www.realgametools.com
------------------------------------------------------
When exporting X models from CharacterFX for use in
DarkBASIC Professional, we recommend using DirectX 8
text format, with "Output Templates" checked.
DarkBASIC Professional has a powerful command set
making it very easy to use animated 3D models.
This program loads an animated 3D model, and uses the
default animation looping built into DarkBASIC
Professional. For full animation frame control,
DarkBASIC Professional provides additional commands,
including:
IntegerValue = TOTAL OBJECT FRAMES(Object Number)
SET OBJECT FRAME Object Number, Frame
IntegerValue = OBJECT FRAME(Object Number)
For more information, check out the demonstration
programs at www.realgametools.com.
------------------------------------------------------
RemEnd
sync on:sync rate 60
color backdrop rgb(128,128,128)
position light 0,-100,100,-100
load object "yago.x",1
set object speed 1,100
loop object 1
i = 0
do
i = (i + 1) mod 360
rotate object 1,0,i,0
sync
loop
Here is a minimal DarkBASIC Professional program to load a file and play its animations:
load object "yago.x",1
loop object 1
do
loop