GLBasic forum

Codesnippets => Userlibs [ *.gbal] => Topic started by: Schranz0r on 2008-Dec-27

Title: MD2-Loader
Post by: Schranz0r on 2008-Dec-27
Now you can load MD2-Models into GLBasic!
No animation supported yet... sorry...  :S

Code: (glbasic) [Select]
//MD2_LoadModel(filename$, Object_ID%)
//on success -> return the Object_ID%
//else return -1 !

model = MD2_LoadModel("car.md2",1)

Example:

Code: (glbasic) [Select]
model = MD2_LoadModel("car.md2",1)
LOADSPRITE "car.png", 1


LOCAL phi

WHILE TRUE

X_MAKE3D 1,10000,45
X_CAMERA 0,400,400, 0,0,0

INC phi,1

X_ROTATION phi, 0,0,1

X_SETTEXTURE 1, -1
X_DRAWOBJ model, 0

X_DRAWAXES 0,0,0

SHOWSCREEN
WEND
END


Download see attachment
;)


IMPORTANT:

You need this: http://www.glbasic.com/files/headers.rar
Unpack into : Program Files\GLBasic\Compiler

Screenshot:

(http://www.glbasic.com/forum/gallery/532_27_12_08_2_48_05.jpg)

[attachment deleted by admin]
Title: Re: MD2-Loader
Post by: Hatonastick on 2008-Dec-30
Very cool!   :good:  Wish I had even half your coding ability.  :'(

Will you be looking at adding animation later on?
Title: Re: MD2-Loader
Post by: Schranz0r on 2008-Dec-30
I dont know  :|
Thats realy hard  :puke: