2012年7月22日日曜日

Bouncing Ball

I visualized bouncing balls using OpenGL. See a figure below.
I placed walls at front, back, left, right, and floor. Three balls repeatedly collide with walls and each other. Their kinetic energies are conserved(i.e. completely-elastic collision).
I implemented it in C++ with the OpenGL and boost libraries on Xcode4.3.3. The compile option is as follows:
  1. Other Linker Flags: -framework OpenGL -framework GLUT
  2. Header Search Paths: /opt/local/include
The path /opt/local/include is for including the boost header files. My source code is here.

0 件のコメント:

コメントを投稿