PDA

View Full Version : A few questions about the TBGL module



Bezumec
22-06-2011, 00:28
Hello Everybody!

I have few questions about TBGL:

1)Does TBGL support collision respones like stop / sliding ?
2)Before any TBGL_m15* functions i must use TBGL_m15InitModelBuffers function, but if i don't know how much number of models or vertices i need ?
3)What type of license is used by thinBasic and TBGL can i use it for commercial purposes ?

ErosOlmi
22-06-2011, 06:47
Hi Bezumec.

I can reply only for number 3: yes, you can create commercial software.
Licence.rtf file can be found in \thinBasic\Licence\ directory. We do not limit the use of thinBasic for commercial purposes.

Others will reply on point 1 and 2

Ciao
Eros

Bezumec
22-06-2011, 09:41
Hi Bezumec.

I can reply only for number 3: yes, you can create commercial software.
Licence.rtf file can be found in \thinBasic\Licence\ directory. We do not limit the use of thinBasic for commercial purposes.

Others will reply on point 1 and 2

Ciao
Eros

Thanks for information.

Petr Schreiber
22-06-2011, 09:52
Hi Bezumec,

thanks for interesting questions!

Ad #1
TBGL does not support any collision routines at the moment and they are not planned in near future. It is possible to set/retrieve each entity transformation matrix, which can be passed to third party engines such as ODE (Open Dynamics Engine).

Ad #2
It is good idea to use TBGL_m15InitModelBuffers in case you create models on the fly. In case you load them from file, it is in theory not necessary, but it can speed up the loading.

If you specify buffer size to small, and model would not fit in, TBGL automagically increases the buffer.

So the number you pass can be more or less approximation.

Ad #3
As Eros said, no problem.

I will update the help file to make it more clear, thanks!


Petr

Bezumec
22-06-2011, 10:15
It is unfortunate that there is no support and no collision respones. And what physical engines working good with thinBasic? I now Bullet physics is the fastest engine. Some argue that the Open Dynamics Engine is very slow, it's true?

Thanks for info Petr.

Petr Schreiber
22-06-2011, 10:25
Hi Bezumec,

I must admit I am not big expert in physics engines. Speed of ODE is not bad, but it is quite hellish to set up.
The problem is, that evaluation of quality of physics engine is not trivial task. I spent some years with ODE, wrote thesis around it and I still cannot say I am expert on it. If the same amount of time is needed for other engines, I will be able to give comparison around time when I am 90 years old :)

As a little proof of concept, both that TBGL is cooperative, and that ODE is hell to setup, I attach example for you.
It does something, but you will see the collision is oddly handled - the box falls through in the end. That is not problem of ThinBASIC or ODE, but on human side - I admit I am not sure how to setup the collision callback properly. I worked with some wrapper libraries with ODE ( PyODE in Python ), where it was easy to setup collision, but there were some other problems and developers responded to my question after 6 months, which made leave this technology.

The work on own physics engine is not something to be done over weekend, it is more like task for years, where you have to solve lot of nontrivial problems related to numeric precision and such. That is why I am not going this route, especially when multiple solutions, pluggable to TBGL, already exist.


Petr

Petr Schreiber
22-06-2011, 10:43
Side note - I am currently cleaning up the internal representation of m15 models, so they will occupy less memory, and you will be able to generate and destroy them at your will, the TBGL_m15InitModelBuffers will stay for compatibility, but won't be necessary at all in future.


Petr