To understand the demos?

meclory
Posts: 12
Joined: Wed Jun 18, 2008 4:29 pm

To understand the demos?

Post by meclory »

Hi,

I heard that the best way to understand this Bullet Physics Library is to study demos. Actually my major is mechanical engineering and I don't have much knowledge about C++ language.

Please let me know what kinds of C++ concepts are necessary to fully understand demo sourcecodes. (I'm now reviewing the concept of Class and Object.)

Thank you very much for your attention to this newbie question.
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: To understand the demos?

Post by abaraba »

hi,

demos do contain examples how to implement almost all possible cases one would want to use Bullet for... but, for the beginning, it is bit difficult to reference multiple files, basically you would spend quite some time searching through the Bullet's "/src" folder as well as some other folders in "Demos" folder, which made very first steps difficult for me, but once you have basic knowledge of structure and program flow, once you learn few function names and know what to look for, its all rather simple...

i don't think you need to have much programming knowledge to start with Bullet, possibly only enough to "recognize" chunks of code, then just copy/paste and experiment...

C knowledge or even general Basic/Pascal should be sufficient, but if you're really new to programming i'd suggest to go over to OpenGL Red Book, they have most simple examples, extremely easy to follow, but the best part is after going through the couple of lessons you will not only learn basics of programming, but OpenGL in the same time

anyway, here's how i started:
Simplified BulletDinoDemo and how to compile it on Linux - http://www.bulletphysics.com/Bullet/php ... f=9&t=2274

*beginners* - Boiled Down 'HelloWorld' demo with OpenGL - http://www.bulletphysics.com/Bullet/php ... =17&t=2277


cheers
Last edited by abaraba on Fri Jun 27, 2008 4:13 am, edited 2 times in total.
meclory
Posts: 12
Joined: Wed Jun 18, 2008 4:29 pm

Re: To understand the demos?

Post by meclory »

Thank you very much!

I will try to understand your great example~

Let me ask one more question....

When I try to execute your main.c using "gcc main.c -lglut -lbulletdynamics -lbulletmath -lbulletcollision" statement, there was an error message, "library not found for ~".

How can I solve this problem? Is there any additional step beyond building the Bullet?
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: To understand the demos?

Post by abaraba »

thanks,
i will make updates... there are few ways around,
first compile Bullet so that you can execute all the bullet demos, then in "/*path/to/bullet*/out/linuxx86/optimize/libs/" you will find Bullet static libraries like "libbulletdynamics.a", "libbulletmath.a"...


1.)
instruct compiler where the libs are, like this:

gcc main.c -lglut -L../../out/linuxx86/optimize/libs -lbulletdynamics -lbulletmath -lbulletcollision

...you can also tell compiler where include files are with "-I/*path/to/includes*", which i do in second example to avoid having non-relative path in source code eg. #include "../../src/Bullet-C-Api.h" can be written then as #include "Bullet-C-Api.h"

OR

2.)
just copy those libraries to your "/usr/lib" folder


...you can find more demos and simple examples in my OpenGL collection, which is in the same time *miniature* Linux based Operating System and C/C++ & OpenGL (ES) development platform: http://www.geocities.com/ze_aks/myos.html


cheers
meclory
Posts: 12
Joined: Wed Jun 18, 2008 4:29 pm

Re: To understand the demos?

Post by meclory »

Thank you!

It is a great example~ I'd like to see other "boiled down recipes".
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: To understand the demos?

Post by abaraba »