I followed the instructions in the howto http://wiki.flightgear.org/Howto:Texture_a_building#Night_Textures.
Day textures work fine, switch to night textures as well, so the textranslate animation is properly triggered, but:
My problem: no matter what axis values I modify in the textranslate animation of the xml, the texture shifts along the x axis. I need it to shift along the y-axis, though, as my night texture is sitting on top of the texture file (like in the howto). It even shifts when all axis are set to "0"! However, I am certain that the textranslate animation is properly executed as it works fine as soon as I "comment out" (<!-- ... -->) the respective section of the xml.
It would be great if someone could point me in the right direction. Alternatively, I would be interested if the texture swap animation (having the night/day textures in separate files) would be an option for static objects (buildings) and if someone could give me example code, as I was unable to find it.
Thanks in advance!
The xml:
- Code: Select all
<?xml version="1.0"?>
<PropertyList>
<path>alpha_rotex1.ac</path>
<animation>
<type>range</type>
<min-m>0</min-m>
<max-m>25000</max-m>
</animation>
<animation>
<type>textranslate</type>
<object-name>alpha_rotex1</object-name>
<property>/sim/time/sun-angle-rad</property>
<step> 1.57 </step>
<factor>0.318471338</factor>
<center>
<x-m> 0 </x-m>
<y-m> 0 </y-m>
<z-m> 0 </z-m>
</center>
<axis>
<x>0</x>
<y>-1</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>material</type>
<object-name>alpha_rotex1</object-name>
<condition>
<greater-than>
<property>/sim/time/sun-angle-rad</property>
<value>1.57</value>
</greater-than>
</condition>
<emission>
<red>0.3</red>
<green>0.3</green>
<blue>0.3</blue>
</emission>
</animation>
</PropertyList>
The ac file:
- Code: Select all
AC3Db
MATERIAL "DefaultWhite" rgb 1.0000 1.0000 1.0000 amb 0.2000 0.2000 0.2000 emis 0.0000 0.0000 0.0000 spec 0.5000 0.5000 0.5000 shi 10 trans 0.0000
MATERIAL "alpha rotex 1" rgb 0.8000 0.8000 0.8000 amb 1.0000 1.0000 1.0000 emis 1.0000 1.0000 1.0000 spec 0.5000 0.5000 0.5000 shi 12 trans 0.0000
OBJECT world
kids 1
OBJECT poly
name "alpha_rotex1"
data 12
alpha_rotex1
loc -6.0618038 69.5146103 11.8372307
texture "alpha_rotex1.png"
texrep 1 1
crease 35.0
numvert 30
-71.9828033 -68.8040085 12.5531158
-72.3317337 -68.8040085 -9.5324593
-77.9727097 -68.8040085 7.5800114
-80.1423874 -68.8040085 1.6364822
-78.1615448 -68.8040085 -4.3726177
-72.3317337 85.7091751 -9.5324593
-71.9828033 85.7091751 12.5531158
-78.1615448 85.7091751 -4.3726177
-80.1423874 85.7091751 1.6364822
-77.9727097 85.7091751 7.5800114
46.6101723 -68.8040085 56.1269951
27.7355766 -68.8040085 67.6006165
45.3505173 -68.8040085 63.8097000
41.3212051 -68.8040085 68.6879807
35.1356583 -68.8040085 70.0191803
27.7355766 85.7091751 67.6006165
46.6101723 85.7091751 56.1269951
35.1356583 85.7091751 70.0191803
41.3212051 85.7091751 68.6879807
45.3505173 85.7091751 63.8097000
24.0158234 -68.8040085 -66.7628403
43.6967926 -68.8040085 -55.8983612
31.3703175 -68.8040085 -69.4145050
37.6931000 -68.8040085 -68.2809372
42.0215797 -68.8040085 -63.5346947
43.6967926 85.7091751 -55.8983612
24.0158234 85.7091751 -66.7628403
42.0215797 85.7091751 -63.5346947
37.6931000 85.7091751 -68.2809372
31.3703175 85.7091751 -69.4145050
numsurf 17
SURF 0X0
mat 1
refs 15
25 0.885157 0.375265
27 0.874924 0.384686
28 0.865033 0.389855
29 0.853188 0.385663
26 0.842955 0.375754
5 0.748550 0.288675
7 0.738235 0.278874
8 0.735518 0.271118
9 0.740970 0.267553
6 0.760269 0.267174
15 0.973214 0.267174
17 0.986165 0.267553
18 0.991618 0.272094
19 0.988412 0.279362
16 0.981027 0.286721
SURF 0X0
mat 1
refs 15
20 0.000000 0.000000
22 0.000000 0.000000
23 0.000000 0.000000
24 0.000000 0.000000
21 0.000000 0.000000
10 0.000000 0.000000
12 0.000000 0.000000
13 0.000000 0.000000
14 0.000000 0.000000
11 0.000000 0.000000
0 0.000000 0.000000
2 0.000000 0.000000
3 0.000000 0.000000
4 0.000000 0.000000
1 0.000000 0.000000
SURF 0X0
mat 1
refs 4
1 0.668725 -0.000561
5 0.668726 0.388999
26 0.057281 0.388999
20 0.057281 -0.000560
SURF 0X0
mat 1
refs 4
21 0.668725 -0.000561
25 0.668726 0.388999
16 0.057281 0.388999
10 0.057281 -0.000560
SURF 0X0
mat 1
refs 4
0 0.057281 -0.000560
6 0.057281 0.388999
9 0.026777 0.388999
2 0.026777 -0.000560
SURF 0X0
mat 1
refs 4
2 0.026777 -0.000560
9 0.026777 0.388999
8 0.001987 0.388999
3 0.001987 -0.000560
SURF 0X0
mat 1
refs 4
3 0.724272 -0.000561
The texture file:
During day:
During night: