← All skills

Skill

Computer graphics

Drawing 3D scenes. Achilles's OpenGL viewer renders every body from the simulation's own state.

1 log entry1 project

AchillesBest example

A viewer drawn from the simulation's own state

Pull request

Also shows: C++

The viewer is a small OpenGL 3.3 program with GLFW as its only dependency. GLFW opens the window and also loads the handful of OpenGL functions the viewer needs. Every visible body is drawn from a single unit cube uploaded to the GPU once, then scaled and placed at that body's pose, with one draw call per body. The shading is simple directional lighting, and lines show the skeleton and a ground grid. You orbit the camera by dragging the mouse and zoom with the scroll wheel. The viewer reads only the simulation's render-only viz state, which is never stepped, so simulation ticks and drawn frames stay independent. Passing --headless skips the viewer entirely. Here, eight double pendulums are released 0.002 rad (about 0.1°) apart, and within a few seconds chaos sends each one its own way.

Recorded from the Achilles viewer, RK4 at a 2 ms step.