-2

I need to make something similar like on this picture but with cubes instead of spheres:

example image

The cubes should bounce infinitely and rotate around a random axis. Is that possible to make in OpenGL? Does anyone have a code for this?

genpfault
  • 49,394
  • 10
  • 79
  • 128
  • see [Bouncing an object off a wall](https://stackoverflow.com/a/71827702/2521214) its 2D to port to 3D you need triangle/triangle intersection instead of line/line intersection and also add rotation with inertia ... however rotation is usually just faked as the real deal would require potentially infinite list of rotations per object ... see [Cone to box collision](https://stackoverflow.com/a/62257945/2521214) look for `line closest(triangle t0,triangle t1);` in code – Spektre Jun 05 '22 at 06:44

0 Answers0