Class LightSourceDemo
java.lang.Object
eu.svjatoslav.aukio.e3d.examples.essentials.LightSourceDemo
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildScene(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 voidEntry point for the light sources demo.
-
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 bothmain(String[])and the golden-image harness — must stay deterministic (no time, no unseeded randomness).- Parameters:
shapes- scene to add shapes tolighting- lighting to configurecamera- camera to position
-
main
Entry point for the light sources demo.- Parameters:
args- command line arguments (ignored)
-