Create slides with interactive 3D
This tutorial explains how to integrate interactive 3D models, typically made with OpenGL, in presentations. It goes through complete examples, from the simplest to the most advanced; each example comes with all its code, to download, and a live demo.
An example
Below is a C++ program compiled for the web, displayed in a frame. The buttons are outside the frame, as they would be in the text of a slide: they change the parameters of the program while it runs, and display a value computed by the program.
The examples, one step at a time
Emscripten, a local web server, reveal.js or lhtml-site.
Raw OpenGL 3.3, about 200 lines: the four changes for the web, settings in the address.
Parameters declared once in C++: the page builds their panel.
A program of a library, in a slide without changing a line.
A waving surface driven from the text of the slide.
Marching cubes, with an ImGui window enlarged for the projector.
Drag the points of a curve: the slide shows its length.
The same talk in reveal.js and in lhtml-site: titles, text, and the models in some slides.
The checklist: files to copy, lines to add, the build for the web, the frame of the slide.
Advanced examples
Three advanced examples, each on another situation of a talk: files to load, keys of the demo, two demos to compare.
OBJ models with their materials and textures, packed with the demo; the slide chooses the model.
Keys of the demo that leave the arrow keys to the presentation.
Two methods compared, driven by the same slider of the slide.
Offline, the projector, an image in the PDF, a video as plan B, tests.
Every file of the examples, of the bridge between the program and the slide, and of the tests: all the files, and the reference of the bridge.