MD2 library for OpenGL applications

Started by Petr Schreiber, January 01, 2009, 09:16:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Petr Schreiber

Hi,

I had some free time during Xmas, so I decided to create library which could be of some use for other programmers too.

As José does incredible job on translating headers, I decided to base the solution on them, as little refund for all his work he invests in his job here.

So what that mysterious tool is? Simple library to load and animate 3D models in Id Software MD2 file format.

I attach for you documentation, DLL+samples and also the source code, written in PBWIN9. I hope you will find it useful, or that it will at least entertain you for a while.


Petr

Updated the download with fixed typo in documentation
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

José Roca

 
Many thanks for your wonderful Christmas gift!

Patrice Terrier

#2
Petr,

I also would like to say thank you for this new contribution that helps to make this forum one of the finest and most valuable place to learn about low level OpenGL SDK programming for PB.

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

Petr,

Currently the demo(s) are very CPU intensive and not cooperative with other applications because of the way the animation is being processed in the main loop.

Changing from GLFW to the BassBox OpenGL model would drecrease the CPU usage drasticaly and produce an application that is more responsive to other Windows message (for example the animation will still run while moving the window to another location) and the programmer could have full control on what is going on, inside of the message cracker.

The benefit would be also to use md2 into BassBox OpenGL plugins ;)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

Petr,

The provided PDF documentation improperly refers to TBGL_ instead of MD2_  ;)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

Hi José, Patrice,

thanks :)

I am sorry about those typos, I just uploaded version which should be correct.

Regarding CPU usage of the demos - sure :) Running in tight loop invlolves such a problems, but I decided for GLFW because the code of examples gets very very short, so people can focus more on the principle.

BassBoxing the code is good idea, I also wanted to use GDIPlus to upload textures, but there was problem (my GDI+ ignorance) with not square dimensioned ones.
I will have a look into BassBox code again, I think the key feature to keep CPU usage low is using timers?
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

#6
QuoteBassBoxing the code is good idea, I also wanted to use GDIPlus to upload textures, but there was problem (my GDI+ ignorance) with not square dimensioned ones.
I will have a look into BassBox code again, I think the key feature to keep CPU usage low is using timers?

Petr,

Everything is in BassBox.bas and BBplugin.inc (including the code to create the textures).
And yes, using the TIMER will reduce the CPU footprint and also will keep the animation running while moving the window container arround.

Then we could make Sydney BassBoxing on audio ...  ;)
(see the attached Sydney in red suit)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

;D

that would be interesting, speed of animation could be varied according to music :)

Do you know Black & White plugin for WinAMP?
The bear has multiple animations and switches between them according to type of music + adjusts speed.

Not so easy to do, but result could be great.
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

Here is already a picture we could use for background ...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

David Boytor

the zip file is corrupted

winzip and explorer shows an error

Petr Schreiber

Hi David,

you are right, not sure how this happened.
I re-uploaded the file again to the first post, could you try again?


Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Christopher Boss

Nice library !

It works great even with EZGUI 5.0. I created a custom object in my 3D engine just so it could use a library like this.


David Boytor

File download works great, not corrupted any more, thanks for your help!!!

Cheers!!!