Howto:Illuminate faces: Difference between revisions

Jump to navigation Jump to search
→‎Switch to another part of texture if illuminated: meaning of the step and factor values
(→‎Switch to another part of texture if illuminated: rewrite for clarity; texture does not have to be 512)
(→‎Switch to another part of texture if illuminated: meaning of the step and factor values)
Line 214: Line 214:
The 3d object (the house) which "wears" the texture is called <tt>germanvillagehouse1</tt> here. This name refers to the name given to the respective object in the AC file. For more information on object names, see [[AC_files:_Understanding_and_changing_.ac_code#Identifying_an_object|AC files: Basic changes to textures and colors]].
The 3d object (the house) which "wears" the texture is called <tt>germanvillagehouse1</tt> here. This name refers to the name given to the respective object in the AC file. For more information on object names, see [[AC_files:_Understanding_and_changing_.ac_code#Identifying_an_object|AC files: Basic changes to textures and colors]].


In order to illuminate the object during dark, add the block of code introduced above: [[Howto:_Illuminate_faces#Illuminate_during_dark|Illuminate during dark]]. Finally you will have two blocks of code: One that moves the texture at dusk and one that illuminates the object at dusk. Make sure both of them use the right object name. The light will be switched off and the texture will be switched back to day-time texture when the sun rises above an angle of 1.57.
In order to illuminate the object during dark, add the block of code introduced above: [[Howto:_Illuminate_faces#Illuminate_during_dark|Illuminate during dark]]. Finally you will have two blocks of code: One that moves the texture at dusk and one that illuminates the object at dusk. Make sure both of them use the right object name. The light will be switched off and the texture will be switched back to day-time texture when the sun rises above an angle of 1.57. Two essential tags here are <step> and <factor>. The <step> tag indicates that the texture should be translated in a single step only when the value passes 1.57 or a multiple thereof; without it the texture would be translated continuously. The <factor> tag is equal to 0.5/1.57, which normalizes the sun angle in radians to a value between 0 and 1 for translating the texture.


===Flashing light===
===Flashing light===
67

edits

Navigation menu