Class CSGDemo

java.lang.Object
eu.svjatoslav.aukio.e3d.examples.essentials.CSGDemo

public class CSGDemo extends Object
Demo showcasing Constructive Solid Geometry (CSG) boolean operations.

This demo displays three CSG operations side by side:

  • Subtract: A cube with a spherical cavity carved out
  • Union: A cube merged with a sphere
  • Intersect: The volume shared by a cube and sphere

All operations use a consistent color scheme: red for the first argument (cube) and blue for the second argument (sphere). This makes it easy to see which parts of the result came from which input shape.

Run this demo:

java -cp target/aukio-3d-demos.jar eu.svjatoslav.aukio.e3d.examples.essentials.CSGDemo
See Also:
  • AbstractCompositeShape.union(AbstractCompositeShape)
  • AbstractCompositeShape.subtract(AbstractCompositeShape)
  • AbstractCompositeShape.intersect(AbstractCompositeShape)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    buildScene(eu.svjatoslav.aukio.e3d.renderer.raster.ShapeCollection shapes, eu.svjatoslav.aukio.e3d.renderer.raster.lighting.LightingManager lighting, eu.svjatoslav.aukio.e3d.geometry.Camera camera)
    Builds the demo scene: three CSG operation results with description panels, scene lighting, and the camera placement that views all three.
    static void
    main(String[] args)
    Entry point for the CSG demo.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CSGDemo

      public CSGDemo()
  • Method Details

    • buildScene

      public static void buildScene(eu.svjatoslav.aukio.e3d.renderer.raster.ShapeCollection shapes, eu.svjatoslav.aukio.e3d.renderer.raster.lighting.LightingManager lighting, eu.svjatoslav.aukio.e3d.geometry.Camera camera)
      Builds the demo scene: three CSG operation results with description panels, scene lighting, and the camera placement that views all three. Called by both main(String[]) and the golden-image harness — must stay deterministic (no time, no unseeded randomness).
      Parameters:
      shapes - scene to add shapes to
      lighting - lighting to configure
      camera - camera to position
    • main

      public static void main(String[] args)
      Entry point for the CSG demo.
      Parameters:
      args - command line arguments (ignored)