User Tools

Site Tools


tutorials:light-modeling-light-sources

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorials:light-modeling-light-sources [2025/06/02 18:56] – [SpotLight] MHtutorials:light-modeling-light-sources [2025/06/02 19:09] (current) MH
Line 95: Line 95:
  
 Please refer to [[tutorials:basic-spectral-light-modeling#light_sources|Spectral Light Modelling]] tutorial. Please refer to [[tutorials:basic-spectral-light-modeling#light_sources|Spectral Light Modelling]] tutorial.
 +
 +
 +===== Light colour =====
 +
 +To define the colour of the emitted light source, the function //setColor// can be used. It expectes an object of //RGBColor// type as input argument, that itself expects a triple of red, green, and blue values in the range of zero to one. E.g., to get a red light source one needs to add //setColor(new RGBColor(1,0,0))// to the list of settings for a light node.
 +
 +<code java>
 +protected void init () [
 +  Axiom ==> 
 +    LightNode.(setLight(new SpotLight().(
 +      setVisualize(true),
 +      setNumberofrays(150),
 +      setRaylength(1.1),
 +      setColor(new RGBColor(1,0,0))
 +    )));
 +]
 +</code>
 +
 +{{ :tutorials:light_node_colour.png?direct&400 |}}
  
  
tutorials/light-modeling-light-sources.txt · Last modified: 2025/06/02 19:09 by MH