PDA

View Full Version : The TBGL module



Petr Schreiber
20-09-2005, 22:25
Hi all,

as the Eros and Roberto are working hard on the thinBASIC, it becames more powerful and fast. I tried to test thinBASIC in one of the most hard ways - in real time graphics. And I think it already passed it without problems.

I wrote the module TBGL which allows you to create and work with 3D graphics using OpenGL.


So what's TBGL ?
TBGL is library helping to create realtime animations, games and tools. Its renderer is based on industry standard OpenGL, but the module itself provides much more than OpenGL does.
Besides rendering it handles keyboard and mouse input as well.

Do I need to install something to run 3D ?
TBGL was designed to be easily used on any kind of 32-bit Windows system, it was tested on Windows 98/98SE, Window Millenium and Windows XP.

Its advantage consists in the fact it is based on OpenGL 1.1 specifications, so no additional care is needed ( just properly installed drivers ).

To fully enjoy the graphics you should have some kind of 3D accelerator in your PC. Although 3D card is not needed, as TBGL can run in software mode, I strongly suggest to have one.
Even as old cards as TNT 2, GeForce 2 MX or Radeon 7000 are fine !


What about speed ?
With the thinBasic version 1.0.9.5 and TBGL module v0.1.6 I was able to run scene with
1,5 million triangles at 25 FPS in 1024x768 on computer with Duron 850MHz and Radeon 9600.

Today, you can render scene with over 5 million of polygons on such a inexpensive card as NVIDIA GeForce 9500GT.


More details...
You can design scene creating polygons and/or by composing built-in 3D primitives.
Another way is to load M15 models.

As the 3D graphics are difficult to manage, you can start testing TBGL quickly by editing bundled source code examples.

TBGL is fully documented API.

There is also borning small archive of commented tutorials on the http://psch.thinbasic.com/

This is just brief list of abilities of TBGL module:

- Create polygons
- Assign color to each object/vertex
- Load and map BMP and TGA textures
- Translate, rotate and scale objects
- Nest objects to create animations

- Use predefined primitive objects
- Setup individualy the complexity of each primitive object
- Cut objects by clipping planes
- Use display lists
- Print text on screen using BMP font
- Print text on screen or everywhere in 3D using windows font

- Apply light on objects
- Use various types of blending
- Configure and apply the fog effect

- Save screenshots

- Use viewports to define various frames inside standard TBGL window
- Choose beetween windowed and fullscreen mode

... this is +/- classic OpenGL arsenal, just made simplier to use.
Really unique are then:

- Loading of M15 models
- Manipulating them standard way or using hardware independant "model shaders"
- Using bone system
- Keyboard and mouse handling
- Entity system
- Sprite system
- ... and much more !

- With TBGL are also bundled thinBASIC headers for OpenGL 2.1, so if you are advanced user...

Combining TBGL with pure GL functions is possible.


Petr Schreiber


Since version 0.1.5, TBGL is distributed directly with thinBASIC 8)

RobertoBianchi
21-09-2005, 11:19
Hi Psch,

I'm happy to see the born of first user module.
Also the scripts are impressive, congratulation and welcome!

Regards,
Roberto

Petr Schreiber
21-09-2005, 11:34
Thanks Roberto,

The file "TBGL_Demo6_MovingIn3D.tBasic" shows how to use YOUR console module as input window to move in 3D space using arrows on keyboard!
( just don't forget to move console below the OpenGL window and give it focus :oops: )

Psch