GLBasic User Manual

Main sections

X_DRAWOBJ

X_DRAWOBJ num#, frame#



Draws an animation frame of a loaded 3D object. num# specifies the object's id, frame# is the animation frame starting with index '0'.
It will be placed at the location indicated by X_MOVEMENT and X_ROTATION.


// DRAWOBJ Demo

ddd_file$ = "moon"
scale = 7

X_LOADOBJ ddd_file$+".ddd", 1
LOADSPRITE ddd_file$+".bmp", 1

WHILE TRUE
X_MAKE3D
X_CAMERA 0, 20, 900, 0, 0, 0
X_AMBIENT_LT 0, RGB(128,128,128)


X_DRAWAXES 0,0,0

phi=phi+(0.5)
X_SCALING scale, scale, scale
X_ROTATION 270, 1,0,0
X_ROTATION phi, 0.5,1,0

X_SETTEXTURE 1
X_DRAWOBJ 1, 0

X_MAKE2D
PRINT "PRINT/DRAWSPRITE ? MAKE2D !", 10, 20
SHOWSCREEN
WEND

See also...