1
0
Fork 0

Add volcanic activity for Surtsey

This commit is contained in:
Thorsten Renk 2019-10-19 10:27:33 +03:00
parent 88289b894a
commit 8efa938ace
11 changed files with 777 additions and 0 deletions

View file

@ -33,5 +33,10 @@
<main-activity type="int" userarchive="y">0</main-activity>
</katla>
<surtsey>
<main-activity type="int" userarchive="y">0</main-activity>
<side-activity type="int" userarchive="y">0</side-activity>
</surtsey>
</PropertyList>

BIN
Models/Volcanoes/Surtsey/ash.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View file

@ -0,0 +1,82 @@
<?xml version="1.0"?>
<!-- Beerenberg main crater activity -->
<PropertyList>
<model>
<path>surtsey_smoke.xml</path>
<offsets>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<heading-deg>0</heading-deg>
</offsets>
<condition>
<equals>
<property>/environment/volcanoes/surtsey/main-activity</property>
<value>1</value>
</equals>
</condition>
</model>
<model>
<path>surtsey_main_ash_eruption.xml</path>
<offsets>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<heading-deg>0</heading-deg>
</offsets>
<condition>
<equals>
<property>/environment/volcanoes/surtsey/main-activity</property>
<value>2</value>
</equals>
</condition>
</model>
<model>
<path>surtsey_main_ash_eruption_secondary.xml</path>
<offsets>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<heading-deg>0</heading-deg>
</offsets>
<condition>
<equals>
<property>/environment/volcanoes/surtsey/main-activity</property>
<value>2</value>
</equals>
</condition>
</model>
<model>
<path>surtsey_smoke_small.xml</path>
<offsets>
<x-m>50.0</x-m>
<y-m>500.0</y-m>
<z-m>0.0</z-m>
<heading-deg>0</heading-deg>
</offsets>
<condition>
<equals>
<property>/environment/volcanoes/surtsey/side-activity</property>
<value>1</value>
</equals>
</condition>
</model>
</PropertyList>

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -0,0 +1,71 @@
var surtsey_ash_loop_flag = 0;
var surtsey_main_factor = 1.0;
var surtsey_main_probability = 0.985;
var surtsey_pos = geo.Coord.new().set_latlon(63.30510848, -20.6054166);
var surtsey_ash_loop = func (timer) {
if (surtsey_ash_loop_flag == 0)
{
print("Ending Surtsey ash eruption simulation.");
return;
}
if (timer < 0.0)
{
if (rand() > 0.6)
{
setprop("/environment/volcanoes/surtsey/ash-main-alpha", (rand() - 0.5) * 40.0);
setprop("/environment/volcanoes/surtsey/ash-main-beta", (rand() - 0.5) * 40.0);
}
else
{
setprop("/environment/volcanoes/surtsey/ash-main-alpha", 0.0);
setprop("/environment/volcanoes/surtsey/ash-main-beta", 0.0);
}
timer = 2.0 + 3.0 * rand();
}
var aircraft_pos = geo.aircraft_position();
var dist = aircraft_pos.distance_to(surtsey_pos);
var turbulence = 100000.0/(dist * dist);
if (turbulence > 1.0) {turbulence = 1.0;}
setprop("/environment/volcanoes/turbulence", turbulence);
timer = timer - 0.1;
settimer(func {surtsey_ash_loop(timer);}, 0.1);
}
surtsey_state_manager = func {
var state_main = getprop("/environment/volcanoes/surtsey/main-activity");
if ( (state_main > 1) and (surtsey_ash_loop_flag == 0))
{
print ("Starting Surtsey ash eruption simulation.");
surtsey_ash_loop_flag = 1;
surtsey_ash_loop(0.0);
}
else if ((state_main < 2) and (surtsey_ash_loop_flag == 1))
{
surtsey_ash_loop_flag = 0;
setprop("/environment/volcanoes/turbulence", 0);
}
}
# call state manager once to get correct autosaved behavior, otherwise use listener
surtsey_state_manager();
setlistener("/environment/volcanoes/surtsey/main-activity", surtsey_state_manager);

View file

@ -0,0 +1,110 @@
<?xml version="1.0"?>
<PropertyList>
<particlesystem>
<name>surtsey-main-ash-eruption</name>
<texture>ash.png</texture>
<emissive>false</emissive>
<lighting>false</lighting>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<roll-deg>0.0</roll-deg>
<pitch-deg>0.0</pitch-deg>
<heading-deg>0.0</heading-deg>
<attach>global</attach>
<placer>
<type>point</type>
</placer>
<shooter>
<theta-min-deg>0</theta-min-deg>
<theta-max-deg>5</theta-max-deg>
<phi-min-deg>0</phi-min-deg>
<phi-max-deg>360</phi-max-deg>
<speed-mps>
<value>320</value>
<spread>150</spread>
</speed-mps>
<rotation-speed>
<x-min-deg-sec>0</x-min-deg-sec>
<y-min-deg-sec>0</y-min-deg-sec>
<z-min-deg-sec>-20</z-min-deg-sec>
<x-max-deg-sec>0</x-max-deg-sec>
<y-max-deg-sec>0</y-max-deg-sec>
<z-max-deg-sec>20</z-max-deg-sec>
</rotation-speed>
</shooter>
<counter>
<particles-per-sec>
<value>8</value>
<spread>1</spread>
</particles-per-sec>
</counter>
<align>billboard</align>
<particle>
<start>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.5</value>
</alpha>
</color>
<size>
<value>150.0</value>
</size>
</start>
<end>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.3</value>
</alpha>
</color>
<size>
<value>1000.0</value>
</size>
</end>
<life-sec>
<value>120</value>
</life-sec>
<mass-kg>6.15</mass-kg>
<radius-m>0.05</radius-m>
</particle>
<program>
<fluid>air</fluid>
<gravity type="bool">false</gravity>
<wind type="bool">true</wind>
</program>
</particlesystem>
</PropertyList>

View file

@ -0,0 +1,142 @@
<?xml version="1.0"?>
<PropertyList>
<particlesystem>
<name>surtsey-main-ash-eruption-secondary</name>
<texture>ash.png</texture>
<emissive>false</emissive>
<lighting>false</lighting>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<roll-deg>0.0</roll-deg>
<pitch-deg>0.0</pitch-deg>
<heading-deg>0.0</heading-deg>
<attach>global</attach>
<placer>
<type>point</type>
</placer>
<shooter>
<theta-min-deg>0</theta-min-deg>
<theta-max-deg>5</theta-max-deg>
<phi-min-deg>0</phi-min-deg>
<phi-max-deg>360</phi-max-deg>
<speed-mps>
<value>240</value>
<spread>100</spread>
</speed-mps>
<rotation-speed>
<x-min-deg-sec>0</x-min-deg-sec>
<y-min-deg-sec>0</y-min-deg-sec>
<z-min-deg-sec>-20</z-min-deg-sec>
<x-max-deg-sec>0</x-max-deg-sec>
<y-max-deg-sec>0</y-max-deg-sec>
<z-max-deg-sec>20</z-max-deg-sec>
</rotation-speed>
</shooter>
<counter>
<particles-per-sec>
<value>10</value>
<spread>1</spread>
</particles-per-sec>
</counter>
<align>billboard</align>
<particle>
<start>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.5</value>
</alpha>
</color>
<size>
<value>80.0</value>
</size>
</start>
<end>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.3</value>
</alpha>
</color>
<size>
<value>350.0</value>
</size>
</end>
<life-sec>
<value>80</value>
</life-sec>
<mass-kg>6.15</mass-kg>
<radius-m>0.05</radius-m>
</particle>
<program>
<fluid>air</fluid>
<gravity type="bool">false</gravity>
<wind type="bool">true</wind>
</program>
</particlesystem>
<animation>
<object-name>surtsey-main-ash-eruption-secondary</object-name>
<type>rotate</type>
<property>/environment/volcanoes/surtsey/ash-main-alpha</property>
<factor>1</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>
<object-name>surtsey-main-ash-eruption-secondary</object-name>
<type>rotate</type>
<property>/environment/volcanoes/surtsey/ash-main-beta</property>
<factor>1</factor>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0</z-m>
</center>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
</PropertyList>

View file

@ -0,0 +1,107 @@
<?xml version="1.0"?>
<PropertyList>
<particlesystem>
<name>surtsey-smoke</name>
<texture>smoke_turbulent.png</texture>
<emissive>false</emissive>
<lighting>false</lighting>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<roll-deg>0.0</roll-deg>
<pitch-deg>0.0</pitch-deg>
<heading-deg>0.0</heading-deg>
<attach>local</attach>
<placer>
<type>point</type>
</placer>
<shooter>
<theta-min-deg>90</theta-min-deg>
<theta-max-deg>90</theta-max-deg>
<phi-min-deg>0</phi-min-deg>
<phi-max-deg>0</phi-max-deg>
<speed-mps>
<value>20</value>
<spread>10</spread>
</speed-mps>
<rotation-speed>
<x-min-deg-sec>0</x-min-deg-sec>
<y-min-deg-sec>0</y-min-deg-sec>
<z-min-deg-sec>-40</z-min-deg-sec>
<x-max-deg-sec>0</x-max-deg-sec>
<y-max-deg-sec>0</y-max-deg-sec>
<z-max-deg-sec>40</z-max-deg-sec>
</rotation-speed>
</shooter>
<counter>
<particles-per-sec>
<value>1</value>
<spread>1</spread>
</particles-per-sec>
</counter>
<align>billboard</align>
<particle>
<start>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.6</value>
</alpha>
</color>
<size>
<value>50.0</value>
</size>
</start>
<end>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.1</value>
</alpha>
</color>
<size>
<value>350.0</value>
</size>
</end>
<life-sec>
<value>120</value>
</life-sec>
<mass-kg>1.0</mass-kg>
<radius-m>2.50</radius-m>
</particle>
<program>
<fluid>air</fluid>
<gravity type="bool">true</gravity>
<wind type="bool">true</wind>
</program>
</particlesystem>
</PropertyList>

View file

@ -0,0 +1,107 @@
<?xml version="1.0"?>
<PropertyList>
<particlesystem>
<name>surtsey-smoke-small</name>
<texture>smoke_turbulent.png</texture>
<emissive>false</emissive>
<lighting>false</lighting>
<x-m>0.0</x-m>
<y-m>0.0</y-m>
<z-m>0.0</z-m>
<roll-deg>0.0</roll-deg>
<pitch-deg>0.0</pitch-deg>
<heading-deg>0.0</heading-deg>
<attach>global</attach>
<placer>
<type>point</type>
</placer>
<shooter>
<theta-min-deg>90</theta-min-deg>
<theta-max-deg>90</theta-max-deg>
<phi-min-deg>0</phi-min-deg>
<phi-max-deg>0</phi-max-deg>
<speed-mps>
<value>20</value>
<spread>10</spread>
</speed-mps>
<rotation-speed>
<x-min-deg-sec>0</x-min-deg-sec>
<y-min-deg-sec>0</y-min-deg-sec>
<z-min-deg-sec>-40</z-min-deg-sec>
<x-max-deg-sec>0</x-max-deg-sec>
<y-max-deg-sec>0</y-max-deg-sec>
<z-max-deg-sec>40</z-max-deg-sec>
</rotation-speed>
</shooter>
<counter>
<particles-per-sec>
<value>4</value>
<spread>1</spread>
</particles-per-sec>
</counter>
<align>billboard</align>
<particle>
<start>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.6</value>
</alpha>
</color>
<size>
<value>10.0</value>
</size>
</start>
<end>
<color>
<red>
<property>/rendering/scene/diffuse/green</property>
</red>
<green>
<property>/rendering/scene/diffuse/green</property>
</green>
<blue>
<property>/rendering/scene/diffuse/green</property>
</blue>
<alpha>
<value>0.1</value>
</alpha>
</color>
<size>
<value>50.0</value>
</size>
</end>
<life-sec>
<value>30</value>
</life-sec>
<mass-kg>1.0</mass-kg>
<radius-m>2.50</radius-m>
</particle>
<program>
<fluid>air</fluid>
<gravity type="bool">true</gravity>
<wind type="bool">true</wind>
</program>
</particlesystem>
</PropertyList>

View file

@ -143,6 +143,13 @@ geo.put_model("Models/Volcanoes/Katla/main_crater.xml", 63.65750, -19.182871 );
}
var set_surtsey = func {
io.include("Models/Volcanoes/Surtsey/surtsey.nas");
geo.put_model("Models/Volcanoes/Surtsey/main_crater.xml", 63.30510848, -20.6054166 );
}
# volcano definitions
var kilauea = volcano.new("Kilauea", 19.39, -155.20);
@ -169,6 +176,11 @@ var katla = volcano.new("Katla", 63.65750, -19.182871);
katla.set = set_katla;
append(volcano_manager.volcano_array, katla);
var surtsey = volcano.new("Surtsey", 63.305, -20.605);
surtsey.set = set_surtsey;
append(volcano_manager.volcano_array, surtsey);
# start the manager when autosaved (need some delay for terrain loading to finish)
settimer(func {volcano_manager.start();}, 5.0);

View file

@ -0,0 +1,141 @@
<?xml version="1.0"?>
<PropertyList>
<name>Surtsey</name>
<layout>vbox</layout>
<default-padding>1</default-padding>
<modal>false</modal>
<width>400</width>
<empty>
<pref-height>6</pref-height>
</empty>
<text>
<label>Surtsey activity</label>
</text>
<empty>
<pref-height>4</pref-height>
</empty>
<hrule/>
<group>
<layout>table</layout>
<text>
<label>Central crater activity</label>
<halign>left</halign>
<row>0</row>
<col>0</col>
</text>
<text>
<label>dormant</label>
<row>0</row>
<col>1</col>
</text>
<slider>
<name>central</name>
<row>0</row>
<col>2</col>
<min>0</min>
<max>2</max>
<step>1</step>
<live>true</live>
<property>/environment/volcanoes/surtsey/main-activity</property>
<binding>
<command>dialog-apply</command>
<object-name>central</object-name>
</binding>
</slider>
<text>
<label>active</label>
<row>0</row>
<col>3</col>
</text>
<text>
<label>Side crater activity</label>
<halign>left</halign>
<row>1</row>
<col>0</col>
</text>
<text>
<label>dormant</label>
<row>1</row>
<col>1</col>
</text>
<slider>
<name>side</name>
<row>1</row>
<col>2</col>
<min>0</min>
<max>1</max>
<step>1</step>
<live>true</live>
<property>/environment/volcanoes/surtsey/side-activity</property>
<binding>
<command>dialog-apply</command>
<object-name>side</object-name>
</binding>
</slider>
<text>
<label>active</label>
<row>1</row>
<col>3</col>
</text>
</group>
<empty>
<pref-height>12</pref-height>
</empty>
<hrule/>
<empty>
<pref-height>20</pref-height>
</empty>
<group>
<layout>table</layout>
<button>
<row>0</row>
<col>0</col>
<legend>OK</legend>
<default>true</default>
<equal>true</equal>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<row>0</row>
<col>1</col>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>