This video features a guest lecture by Kaveh, a distinguished computer graphics veteran (known for work on Jurassic Park, Final Fantasy, and The Hobbit films), introducing his personal project "Cons 9," a 3D graphics system built using Common Lisp. The presentation highlights Lisp's unique strengths for interactive development, demonstrating real-time procedural generation of diverse 3D forms. These include complex geometries derived from point clouds, dynamic sweep operations, and animated particle systems influenced by various force fields. Kaveh emphasizes the power of live code evaluation for rapid iteration, the use of first-class functions for flexible animation, and the generation of "live meshes" that dynamically update based on their inputs. The demo also covers advanced concepts such as sprite rendering with proper transparency handling, realistic "plant growth" simulations influenced by resource competition, and the creation of smooth, merging "blobby" shapes (iso surfaces) and Signed Distance Functions (SDFs) using the marching cubes algorithm for polygonal representation. The discussion extends to the practicalities of using Cons 9, its interoperability with other software, and delves into the philosophical advantages of Common Lisp, such as its powerful interactive debugging capabilities and flexible, unopinionated nature.
Exploring Cons 9: Interactive 3D Graphics with Common Lisp
0:00 Introduction & Computer Graphics Journey: Kaveh, a computer graphics veteran with 40 years of experience (including animating Jurassic Park and R&D for Final Fantasy, and work on The Hobbit films), introduces his personal project, "Cons 9," to a San Jose State computer graphics class. He shares insights into the early, exclusive nature of 3D graphics development due to high costs and limited resources.
2:28 Cons 9 - A Lisp-Based Project: Kaveh presents "Cons 9," a 3D graphics system he developed using Common Lisp. He explains Common Lisp's historical significance as one of the oldest languages still in use, highlighting its visionary features like recursion, first-class functions, closures, and macros, which enable highly interactive development.
6:30 Interactive 3D Modeling Workflow: The demonstration showcases Cons 9's real-time, interactive workflow, where Lisp expressions are evaluated live in an Emacs editor, instantly updating the 3D graphics window. This allows for rapid prototyping and modification of shapes like cut cubes, point clouds, various curves (spirals, circles), and Platonic solids, eliminating the need for laborious compile-link cycles.
10:38 Dynamic Fractalization: Kaveh demonstrates fractalizing 3D shapes, including cubes and planes, which can generate organic-looking terrains. The ability to modify parameters like iteration count and see immediate visual feedback highlights the system's interactive power.
14:40 Animation with First-Class Functions: Cons 9's animation system is built on the concept of passing functions (closures) that are executed every frame. This allows for flexible animation, from simple object translations to complex hierarchical movements (e.g., rotating cubes, multi-jointed structures), offering a powerful alternative to traditional keyframing.
19:12 Procedural Meshes and UV Mapping: The system supports procedural UV meshes and sweep operations. A 2D profile (e.g., a circle) can be swept along a 3D path (e.g., a sine curve) with controllable twist and taper parameters. UV coordinates are not just for texturing but can also drive visual properties like vertex coloring, creating effects such as a rainbow spectrum along the swept mesh.
23:00 Particle Systems and Mesh Generation: Kaveh shows how particle system paths can be used as input for sweep extrusions, creating dynamic, organic shapes. While history is cached in some examples, the system can later demonstrate live mesh regeneration tied to particle motion.
25:39 Advanced Particle Dynamics: The presentation explores advanced particle behaviors, including bifurcation, emission from various point sources (circles, polyhedra vertices/face centers), and the application of force fields (gravity, attractors, noise fields). Perlin noise is used to create realistic "tufting" effects, where particles in a region move coherently, mimicking natural phenomena like fur.
34:47 Sprites and Transparency Handling: Cons 9 includes a sprite class for 2D objects that always face the camera. Kaveh explains the crucial importance of sorting transparent objects from back to front in OpenGL to ensure correct visual layering, as the Z-buffer cannot inherently handle transparency.
38:54 Particle Color Inheritance: Particles can inherit color from the spawning surface's vertices, leading to dynamic visual effects like a "billowing gas" that changes color based on its origin point on a textured sphere.
40:47 Live Mesh Regeneration: A key takeaway is the concept of "live objects" or "sweep meshes" that automatically regenerate their geometry when their input parameters are changed, enabling fluid, animated growth and transformation effects linked to particle systems.
44:31 Resource-Based Growth Simulation: Kaveh demonstrates a simulation where 3D objects (e.g., "plants") grow based on resource availability (e.g., proximity to a "river") and competition for "light" (shadowing from larger objects), adding a layer of realism to procedural plant generation.
46:57 Iso Surfaces and SDFs (Marching Cubes): The video delves into iso surfaces ("blobbies"), which are 3D contours of density fields that allow for smooth merging shapes. Kaveh then introduces Signed Distance Functions (SDFs), explaining how Cons 9 uses the "marching cubes" algorithm to generate polygonal mesh representations from SDFs, providing a robust way to create complex geometry for standard rendering pipelines.
58:20 Practical Usage and Lisp Philosophy: Cons 9 can export geometry to OBJ and limited USD files for use in other 3D software like Maya or Blender. Kaveh recommends SBCL (Steel Bank Common Lisp) as the implementation. He elaborates on Lisp's powerful philosophy: its unopinionated nature, ability to modify classes and instances live, garbage collection, and unique "restarts" feature for debugging crashes without exiting the program, allowing for highly efficient live development and error recovery.
1:13:15 Conclusion & Future Outlook: Kaveh encourages students to explore Lisp for graphics, sharing his personal enjoyment of the language and its enduring strengths, including its performance advantages over languages like Python. An interesting anecdote reveals that Maya almost adopted Scheme (a Lisp dialect) as its embedded scripting language.