Class LightSourceDemo

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

public class LightSourceDemo extends Object
Demo showcasing light sources and their effect on shaded surfaces.

This demo displays a white sphere illuminated by two colored light sources: a bright yellow light on the right side and a dim blue light on the left side. The white sphere base color allows the light colors to mix visibly on the surface, demonstrating how multiple light sources contribute to shading.

Run this demo:

java -cp target/aukio-3d-demos.jar eu.svjatoslav.aukio.e3d.examples.essentials.LightSourceDemo

Key concepts demonstrated:

  • LightSource creation with position, color, and intensity
  • LightSourceMarker for visualizing light positions
  • ShadingEnabled on SolidPolygonSphere
  • Ambient light configuration
  • Multiple lights adding their contributions
See Also:
  • LightSource
  • LightSourceMarker
  • LightingManager
  • 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: one shaded white sphere, two colored light sources with markers, ambient light, and the initial camera placement.
    static void
    main(String[] args)
    Entry point for the light sources demo.

    Methods inherited from class Object

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

    • LightSourceDemo

      public LightSourceDemo()
  • 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: one shaded white sphere, two colored light sources with markers, ambient light, and the initial camera placement. 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 light sources demo.
      Parameters:
      args - command line arguments (ignored)