67
edits
Paul Richter (talk | contribs) (→Illuminate during dark: explanation of the 1.57 horizon) |
Paul Richter (talk | contribs) (→Switch to another part of texture if illuminated: rewrite for clarity; texture does not have to be 512) |
||
Line 181: | Line 181: | ||
===Switch to another part of texture if illuminated=== | ===Switch to another part of texture if illuminated=== | ||
For v1.9 or later, the way to change textures is the textranslate animation, which lets you "slide" across a texture map. This animation is applied to a single image which has the daytime and nighttime textures placed next to each other. | |||
The width in pixels of texture map (if it is being moved sideways) should be an integral power of two (eg. 2<sup>0</sup>=1, 2<sup>1</sup>=2, 2<sup>2</sup>=4, 2<sup>3</sup>=8, 2<sup>4</sup>=16 and so on). For this example, this texture map has two sides that are each 256 pixels wide. The '''left side''' is for day-time textures, the '''right side''' is for night-time textures. Each night-time texture is positioned exactly 256 pixels to the right of the day-time texture. Here is an example taken from the shared model [http://scenemodels.flightgear.org/modeledit.php?id=1570 German village house - grey roof]: | |||
[[Image:Germanvillagehouse1_day.png|thumb|day-time textures]] | [[Image:Germanvillagehouse1_day.png|thumb|day-time textures]] | ||
[[Image:Germanvillagehouse1_night.png|thumb|night-time textures]] | [[Image:Germanvillagehouse1_night.png|thumb|night-time textures]] | ||
Line 193: | Line 193: | ||
Finally you have to add two bits of code to the XML file: 1) Code that tells FG to move the texture to the left during night-time and 2) code that illuminates the model during night-time. | Finally you have to add two bits of code to the XML file: 1) Code that tells FG to move the texture to the left during night-time and 2) code that illuminates the model during night-time. | ||
The following code tells FG to | The following code tells FG to translate the texture halfway across horizontally at nightfall: | ||
<animation> | <animation> |
edits