2 ########################################################
3 # routines to set up, transform and manage local weather
4 # Thorsten Renk, August 2011
5 ########################################################
9 # select_cloud_model to define the cloud parameters, given the cloud type and subtype
12 ###########################################################
13 # define various cloud models
14 ###########################################################
16 var select_cloud_model = func(type, subtype) {
19 var path="Models/Weather/blank.ac";
22 if (type == "Cumulus (cloudlet)"){
24 cloudAssembly = local_weather.cloud.new(type, subtype);
26 if (subtype == "small")
28 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet2.rgb";
29 cloudAssembly.n_sprites = 10;
30 cloudAssembly.min_width = 500.0;
31 cloudAssembly.max_width = 700.0;
32 cloudAssembly.min_height = 500.0;
33 cloudAssembly.max_height = 700.0;
34 cloudAssembly.min_cloud_width = 1300;
35 cloudAssembly.min_cloud_height = 750;
36 cloudAssembly.bottom_shade = 0.4;
40 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet1.rgb";
41 cloudAssembly.n_sprites = 5;
42 cloudAssembly.min_width = 600.0;
43 cloudAssembly.max_width = 900.0;
44 cloudAssembly.min_height = 600.0;
45 cloudAssembly.max_height = 900.0;
46 cloudAssembly.min_cloud_width = 1300;
47 cloudAssembly.min_cloud_height = 950;
48 cloudAssembly.bottom_shade = 0.4;
52 # characterize the basic texture sheet
53 cloudAssembly.num_tex_x = 3;
54 cloudAssembly.num_tex_y = 3;
56 #characterize the cloud
57 cloudAssembly.z_scale = 1.0;
59 #signal that new routines are used
63 else if (type == "Cu (volume)"){
67 cloudAssembly = local_weather.cloud.new(type, subtype);
69 if (subtype == "small")
71 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet2.rgb";
72 cloudAssembly.n_sprites = 5;
73 cloudAssembly.min_width = 400.0;
74 cloudAssembly.max_width = 700.0;
75 cloudAssembly.min_height = 400.0;
76 cloudAssembly.max_height = 700.0;
77 cloudAssembly.min_cloud_width = 1000;
78 cloudAssembly.min_cloud_height = 1000;
79 cloudAssembly.bottom_shade = 0.4;
83 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet1.rgb";
84 cloudAssembly.n_sprites = 5;
85 cloudAssembly.min_width = 800.0;
86 cloudAssembly.max_width = 1100.0;
87 cloudAssembly.min_height = 800.0;
88 cloudAssembly.max_height = 1100.0;
89 cloudAssembly.min_cloud_width = 1500;
90 cloudAssembly.min_cloud_height = 1150;
91 cloudAssembly.bottom_shade = 0.4;
95 # characterize the basic texture sheet
96 cloudAssembly.num_tex_x = 3;
97 cloudAssembly.num_tex_y = 3;
99 #characterize the cloud
100 cloudAssembly.z_scale = 1.0;
102 #signal that new routines are used
107 else if (type == "Congestus"){
109 cloudAssembly = local_weather.cloud.new(type, subtype);
111 if (subtype == "small")
113 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet1.rgb";
114 cloudAssembly.num_tex_x = 3;
115 cloudAssembly.num_tex_y = 3;
116 cloudAssembly.n_sprites = 5;
117 cloudAssembly.min_width = 600.0;
118 cloudAssembly.max_width = 900.0;
119 cloudAssembly.min_height = 600.0;
120 cloudAssembly.max_height = 900.0;
121 cloudAssembly.min_cloud_width = 1300;
122 cloudAssembly.min_cloud_height = 1000;
123 cloudAssembly.bottom_shade = 0.4;
130 cloudAssembly.texture_sheet = "/Models/Weather/congestus_sheet1.rgb";
131 cloudAssembly.num_tex_x = 1;
132 cloudAssembly.num_tex_y = 3;
133 cloudAssembly.min_width = 1300.0;
134 cloudAssembly.max_width = 2000.0;
135 cloudAssembly.min_height = 600.0;
136 cloudAssembly.max_height = 900.0;
140 cloudAssembly.texture_sheet = "/Models/Weather/congestus_sheet2.rgb";
141 cloudAssembly.num_tex_x = 1;
142 cloudAssembly.num_tex_y = 2;
143 cloudAssembly.min_width = 1200.0;
144 cloudAssembly.max_width = 1800.0;
145 cloudAssembly.min_height = 700.0;
146 cloudAssembly.max_height = 1000.0;
150 cloudAssembly.n_sprites = 3;
151 cloudAssembly.min_cloud_width = 2200.0;
152 cloudAssembly.min_cloud_height = 1200.0;
153 cloudAssembly.bottom_shade = 0.4;
156 cloudAssembly.z_scale = 1.0;
158 #signal that new routines are used
162 else if (type == "Stratocumulus"){
164 cloudAssembly = local_weather.cloud.new(type, subtype);
166 if (subtype == "small")
168 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet1.rgb";
169 cloudAssembly.num_tex_x = 3;
170 cloudAssembly.num_tex_y = 3;
171 cloudAssembly.n_sprites = 7;
172 cloudAssembly.min_width = 600.0;
173 cloudAssembly.max_width = 900.0;
174 cloudAssembly.min_height = 600.0;
175 cloudAssembly.max_height = 900.0;
176 cloudAssembly.min_cloud_width = 1300;
177 cloudAssembly.min_cloud_height = 1300;
178 cloudAssembly.bottom_shade = 0.4;
184 cloudAssembly.texture_sheet = "/Models/Weather/congestus_sheet1.rgb";
185 cloudAssembly.num_tex_x = 1;
186 cloudAssembly.num_tex_y = 3;
187 cloudAssembly.min_width = 1900.0;
188 cloudAssembly.max_width = 2100.0;
189 cloudAssembly.min_height = 1000.0;
190 cloudAssembly.max_height = 1100.0;
191 cloudAssembly.n_sprites = 3;
192 cloudAssembly.bottom_shade = 0.5;
193 cloudAssembly.min_cloud_width = 3500.0;
194 cloudAssembly.min_cloud_height = 1600.0;
196 else if (rand() > 0.33)
198 cloudAssembly.texture_sheet = "/Models/Weather/congestus_sheet2.rgb";
199 cloudAssembly.num_tex_x = 1;
200 cloudAssembly.num_tex_y = 2;
201 cloudAssembly.min_width = 1900.0;
202 cloudAssembly.max_width = 2000.0;
203 cloudAssembly.min_height = 1000.0;
204 cloudAssembly.max_height = 1100.0;
205 cloudAssembly.n_sprites = 3;
206 cloudAssembly.bottom_shade = 0.4;
207 cloudAssembly.min_cloud_width = 3500.0;
208 cloudAssembly.min_cloud_height = 1600.0;
212 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_sheet1.rgb";
213 cloudAssembly.num_tex_x = 3;
214 cloudAssembly.num_tex_y = 3;
215 cloudAssembly.min_width = 800.0;
216 cloudAssembly.max_width = 1000.0;
217 cloudAssembly.min_height = 800.0;
218 cloudAssembly.max_height = 1000.0;
219 cloudAssembly.n_sprites = 5;
220 cloudAssembly.bottom_shade = 0.4;
221 cloudAssembly.min_cloud_width = 3000.0;
222 cloudAssembly.min_cloud_height = 1100.0;
227 cloudAssembly.z_scale = 1.0;
229 #signal that new routines are used
235 else if (type == "Cumulus (whisp)"){
238 cloudAssembly = local_weather.cloud.new(type, subtype);
242 # characterize the basic texture sheet
243 cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb";
244 cloudAssembly.num_tex_x = 3;
245 cloudAssembly.num_tex_y = 3;
247 #characterize the cloud
248 cloudAssembly.bottom_shade = 0.8;
249 cloudAssembly.n_sprites = 4;
250 cloudAssembly.min_width = 400.0 * mult;
251 cloudAssembly.max_width = 600.0 * mult;
252 cloudAssembly.min_height = 400.0 * mult;
253 cloudAssembly.max_height = 600.0 * mult;
254 cloudAssembly.min_cloud_width = 800;
255 cloudAssembly.min_cloud_height = 800;
256 cloudAssembly.z_scale = 1.0;
258 #signal that new routines are used
263 else if (type == "Cumulus bottom"){
265 cloudAssembly = local_weather.cloud.new(type, subtype);
269 # characterize the basic texture sheet
270 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_bottom_sheet1.rgb";
271 cloudAssembly.num_tex_x = 1;
272 cloudAssembly.num_tex_y = 1;
274 #characterize the cloud
275 cloudAssembly.bottom_shade = 0.4;
276 cloudAssembly.n_sprites = 4;
277 cloudAssembly.min_width = 600.0 * mult;
278 cloudAssembly.max_width = 800.0 * mult;
279 cloudAssembly.min_height = 600.0 * mult;
280 cloudAssembly.max_height = 800.0 * mult;
281 cloudAssembly.min_cloud_width = 1200 * mult * mult;
282 cloudAssembly.min_cloud_height = 800 * mult * mult;
283 cloudAssembly.z_scale = 0.6;
285 #signal that new routines are used
289 else if (type == "Congestus bottom"){
291 cloudAssembly = local_weather.cloud.new(type, subtype);
295 # characterize the basic texture sheet
296 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_bottom_sheet1.rgb";
297 cloudAssembly.num_tex_x = 1;
298 cloudAssembly.num_tex_y = 1;
300 #characterize the cloud
301 cloudAssembly.bottom_shade = 0.4;
302 cloudAssembly.n_sprites = 4;
303 cloudAssembly.min_width = 1100.0 * mult;
304 cloudAssembly.max_width = 1400.0 * mult;
305 cloudAssembly.min_height = 1100.0 * mult;
306 cloudAssembly.max_height = 1400.0 * mult;
307 cloudAssembly.min_cloud_width = 1600 * mult * mult;
308 cloudAssembly.min_cloud_height = 1200 * mult * mult;
309 cloudAssembly.z_scale = 0.4;
311 #signal that new routines are used
315 else if (type == "Stratocumulus bottom"){
317 cloudAssembly = local_weather.cloud.new(type, subtype);
319 # characterize the basic texture sheet
320 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_bottom_sheet1.rgb";
321 cloudAssembly.num_tex_x = 1;
322 cloudAssembly.num_tex_y = 1;
324 #characterize the cloud
325 cloudAssembly.bottom_shade = 0.7;
326 cloudAssembly.n_sprites = 3;
327 cloudAssembly.min_width = 1200.0;
328 cloudAssembly.max_width = 1600.0;
329 cloudAssembly.min_height = 1200.0 ;
330 cloudAssembly.max_height = 1600.0;
331 cloudAssembly.min_cloud_width = 2000 ;
332 cloudAssembly.min_cloud_height = 1700;
333 cloudAssembly.z_scale = 0.4;
335 #signal that new routines are used
339 else if (type == "Cumulonimbus (cloudlet)"){
341 cloudAssembly = local_weather.cloud.new(type, subtype);
343 # characterize the basic texture sheet
346 cloudAssembly.num_tex_x = 2;
347 cloudAssembly.num_tex_y = 2;
350 {cloudAssembly.texture_sheet = "/Models/Weather/cumulonimbus_sheet2.rgb";}
352 {cloudAssembly.texture_sheet = "/Models/Weather/cumulonimbus_sheet1.rgb";}
355 if (subtype == "small") {mult = 0.7;}
357 #characterize the cloud
358 cloudAssembly.bottom_shade = 0.6;
359 cloudAssembly.n_sprites = 5;
360 cloudAssembly.min_width = 1700.0 * mult;
361 cloudAssembly.max_width = 2200.0 * mult;
362 cloudAssembly.min_height = 1700.0 * mult;
363 cloudAssembly.max_height = 2200.0 * mult;
364 cloudAssembly.min_cloud_width = 3500.0 * mult;
365 cloudAssembly.min_cloud_height = 3500.0 * mult;
366 cloudAssembly.z_scale = 1.0;
368 #signal that new routines are used
372 else if (type == "Altocumulus"){
374 cloudAssembly = local_weather.cloud.new(type, subtype);
377 if (subtype == "small") {mult = 0.7;}
380 # characterize the basic texture sheet
381 cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb";
382 cloudAssembly.num_tex_x = 3;
383 cloudAssembly.num_tex_y = 3;
385 #characterize the cloud
386 cloudAssembly.bottom_shade = 0.7;
387 cloudAssembly.n_sprites = 6;
388 cloudAssembly.min_width = 40.0 * mult;
389 cloudAssembly.max_width = 600.0 * mult;
390 cloudAssembly.min_height = 400.0 * mult;
391 cloudAssembly.max_height = 600.0 * mult;
392 cloudAssembly.min_cloud_width = 1000 * mult * mult;
393 cloudAssembly.min_cloud_height = 1000 * mult * mult;
394 cloudAssembly.z_scale = 0.8;
396 #signal that new routines are used
400 else if (type == "Stratus (structured)"){
402 cloudAssembly = local_weather.cloud.new(type, subtype);
405 if (subtype == "small") {mult = 0.7;}
408 # characterize the basic texture sheet
409 cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb";
410 cloudAssembly.num_tex_x = 3;
411 cloudAssembly.num_tex_y = 3;
413 #characterize the cloud
414 cloudAssembly.bottom_shade = 0.4;
415 # cloudAssembly.n_sprites = 25;
416 cloudAssembly.n_sprites = 12;
417 cloudAssembly.min_width = 1700.0 * mult;
418 cloudAssembly.max_width = 2500.0 * mult;
419 cloudAssembly.min_height = 1700.0 * mult;
420 cloudAssembly.max_height = 2500.0 * mult;
421 cloudAssembly.min_cloud_width = 3200.0 * mult * mult;
422 cloudAssembly.min_cloud_height = 500.0 * mult * mult + cloudAssembly.max_height;
423 cloudAssembly.z_scale = 0.3;
425 #signal that new routines are used
429 else if (type == "Stratus structured CS"){
431 cloudAssembly = local_weather.cloud.new(type, subtype);
435 mult = mult * local_weather.cloud_size_scale;
437 # characterize the basic texture sheet
438 cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb";
439 cloudAssembly.num_tex_x = 3;
440 cloudAssembly.num_tex_y = 3;
442 #characterize the cloud
443 cloudAssembly.bottom_shade = 0.4;
444 cloudAssembly.n_sprites = 6;
445 cloudAssembly.min_width = 1000.0 * mult;
446 cloudAssembly.max_width = 1000.0 * mult;
447 cloudAssembly.min_height = 1000.0 * mult;
448 cloudAssembly.max_height = 1000.0 * mult;
449 cloudAssembly.min_cloud_width = 1305 * mult;
450 cloudAssembly.min_cloud_height = 1305.0 * mult;
451 cloudAssembly.z_scale = 0.3;
453 #signal that new routines are used
457 else if (type == "Altocumulus perlucidus"){
460 cloudAssembly = local_weather.cloud.new(type, subtype);
463 if (subtype == "small") {mult = 0.7;}
464 else if (subtype == "huge") {mult = 1.5;}
466 # characterize the basic texture sheet
467 cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb";
468 cloudAssembly.num_tex_x = 3;
469 cloudAssembly.num_tex_y = 3;
471 #characterize the cloud
472 cloudAssembly.bottom_shade = 0.7;
473 cloudAssembly.n_sprites = 25;
474 cloudAssembly.min_width = 1700.0 * mult;
475 cloudAssembly.max_width = 2500.0 * mult;
476 cloudAssembly.min_height = 1700.0 * mult;
477 cloudAssembly.max_height = 2500.0 * mult;
478 cloudAssembly.min_cloud_width = 3200.0 * mult * mult;
479 cloudAssembly.min_cloud_height = 500.0 * mult * mult + cloudAssembly.max_height;
480 cloudAssembly.z_scale = 0.2;
482 #signal that new routines are used
485 else if ((type == "Cumulonimbus") or (type == "Cumulonimbus (rain)")) {
486 if (subtype == "small") {
487 if (rn > 0.5) {path = "Models/Weather/cumulonimbus_small1.xml";}
488 else {path = "Models/Weather/cumulonimbus_small2.xml";}
490 else if (subtype == "large") {
491 if (rn > 0.5) {path = "Models/Weather/cumulonimbus_small1.xml";}
492 else {path = "Models/Weather/cumulonimbus_small2.xml";}
495 else if (type == "Cirrus") {
496 if (subtype == "large") {
497 if (rn > 0.916) {path = "Models/Weather/cirrus1.xml";}
498 else if (rn > 0.833) {path = "Models/Weather/cirrus2.xml";}
499 else if (rn > 0.75) {path = "Models/Weather/cirrus3.xml";}
500 else if (rn > 0.666) {path = "Models/Weather/cirrus4.xml";}
501 else if (rn > 0.583) {path = "Models/Weather/cirrus5.xml";}
502 else if (rn > 0.500) {path = "Models/Weather/cirrus6.xml";}
503 else if (rn > 0.416) {path = "Models/Weather/cirrus7.xml";}
504 else if (rn > 0.333) {path = "Models/Weather/cirrus8.xml";}
505 else if (rn > 0.250) {path = "Models/Weather/cirrus9.xml";}
506 else if (rn > 0.166) {path = "Models/Weather/cirrus10.xml";}
507 else if (rn > 0.083) {path = "Models/Weather/cirrus11.xml";}
508 else {path = "Models/Weather/cirrus12.xml";}
510 else if (subtype == "small") {
511 if (rn > 0.75) {path = "Models/Weather/cirrus_amorphous1.xml";}
512 else if (rn > 0.5) {path = "Models/Weather/cirrus_amorphous2.xml";}
513 else if (rn > 0.25) {path = "Models/Weather/cirrus_amorphous3.xml";}
514 else {path = "Models/Weather/cirrus_amorphous4.xml";}
517 else if (type == "Cirrocumulus") {
518 if (subtype == "small") {
519 if (rn > 0.5) {path = "Models/Weather/cirrocumulus1.xml";}
520 else {path = "Models/Weather/cirrocumulus2.xml";}
522 else if (subtype == "large") {
523 if (rn > 0.875) {path = "Models/Weather/cirrocumulus1.xml";}
524 else if (rn > 0.750){path = "Models/Weather/cirrocumulus4.xml";}
525 else if (rn > 0.625){path = "Models/Weather/cirrocumulus5.xml";}
526 else if (rn > 0.500){path = "Models/Weather/cirrocumulus6.xml";}
527 else if (rn > 0.385){path = "Models/Weather/cirrocumulus7.xml";}
528 else if (rn > 0.250){path = "Models/Weather/cirrocumulus8.xml";}
529 else if (rn > 0.125){path = "Models/Weather/cirrocumulus9.xml";}
530 else {path = "Models/Weather/cirrocumulus10.xml";}
533 else if (type=="Noctilucent") {
534 if (rn>0.75) {path = "Models/Weather/noctilucent7.xml";}
535 else if (rn > 0.5) {path = "Models/Weather/noctilucent8.xml";}
536 else if (rn > 0.25) {path = "Models/Weather/noctilucent9.xml";}
537 else {path = "Models/Weather/noctilucent10.xml";}
539 else if (type == "Cirrocumulus (cloudlet)") {
541 cloudAssembly = local_weather.cloud.new(type, subtype);
544 if (subtype == "small") {mult = 0.6;}
545 else if (subtype == "huge") {mult = 1.5;}
547 # characterize the basic texture sheet
548 cloudAssembly.texture_sheet = "/Models/Weather/cirrocumulus_sheet1.rgb";
549 cloudAssembly.num_tex_x = 3;
550 cloudAssembly.num_tex_y = 3;
552 #characterize the cloud
553 cloudAssembly.bottom_shade = 1.0;
554 cloudAssembly.n_sprites = 8;
555 cloudAssembly.min_width = 700.0 * mult;
556 cloudAssembly.max_width = 1200.0 * mult;
557 cloudAssembly.min_height = 700.0 * mult;
558 cloudAssembly.max_height = 1200.0 * mult;
559 cloudAssembly.min_cloud_width = 1500.0;
560 cloudAssembly.min_cloud_height = 1300.0 * mult;
561 cloudAssembly.z_scale = 0.3;
565 else if (type == "Cirrocumulus (new)") {
567 cloudAssembly = local_weather.cloud.new(type, subtype);
570 if (subtype == "small") {mult = 0.7;}
573 # characterize the basic texture sheet
574 cloudAssembly.texture_sheet = "/Models/Weather/cirrocumulus_sheet1.rgb";
575 cloudAssembly.num_tex_x = 3;
576 cloudAssembly.num_tex_y = 3;
578 #characterize the cloud
579 cloudAssembly.bottom_shade = 1.0;
580 cloudAssembly.n_sprites = 2;
581 cloudAssembly.min_width = 200.0 * mult;
582 cloudAssembly.max_width = 300.0 * mult;
583 cloudAssembly.min_height = 200.0 * mult;
584 cloudAssembly.max_height = 300.0 * mult;
585 cloudAssembly.min_cloud_width = 400.0 * mult;
586 cloudAssembly.min_cloud_height = 400.0 * mult;
587 cloudAssembly.z_scale = 0.5;
589 #signal that new routines are used
593 else if (type == "Fogpatch") {
595 cloudAssembly = local_weather.cloud.new(type, subtype);
598 if (subtype == "small") {mult = 0.7;}
601 mult = mult * local_weather.cloud_size_scale;
603 # characterize the basic texture sheet
604 cloudAssembly.texture_sheet = "/Models/Weather/fogpatch_sheet1.rgb";
605 cloudAssembly.num_tex_x = 1;
606 cloudAssembly.num_tex_y = 1;
608 #characterize the cloud
609 cloudAssembly.bottom_shade = 1.0;
610 cloudAssembly.n_sprites = 1;
611 cloudAssembly.min_width = 300.0 * mult;
612 cloudAssembly.max_width = 300.0 * mult;
613 cloudAssembly.min_height = 300.0 * mult;
614 cloudAssembly.max_height = 300.0 * mult;
615 cloudAssembly.min_cloud_width = 305.0 * mult;
616 cloudAssembly.min_cloud_height = 305.0 * mult;
617 cloudAssembly.z_scale = 0.5;
619 #signal that new routines are used
623 else if (type == "Nimbus") {
625 cloudAssembly = local_weather.cloud.new(type, subtype);
628 if (subtype == "small") {mult = 0.7;}
631 # characterize the basic texture sheet
632 cloudAssembly.texture_sheet = "/Models/Weather/nimbus_sheet1.rgb";
633 cloudAssembly.num_tex_x = 2;
634 cloudAssembly.num_tex_y = 3;
636 #characterize the cloud
637 cloudAssembly.bottom_shade = 0.6;
638 #cloudAssembly.n_sprites = 10;
639 cloudAssembly.n_sprites = 5;
640 cloudAssembly.min_width = 2700.0 * mult;
641 cloudAssembly.max_width = 3000.0 * mult;
642 cloudAssembly.min_height = 2700.0 * mult;
643 cloudAssembly.max_height = 3000.0 * mult;
644 cloudAssembly.min_cloud_width = 3500.0 * mult;
645 cloudAssembly.min_cloud_height = 3200.0 * mult;
646 cloudAssembly.z_scale = 0.4;
647 cloudAssembly.tracer_flag = 1;
649 #signal that new routines are used
652 else if (type == "Stratus") {
654 cloudAssembly = local_weather.cloud.new(type, subtype);
657 if (subtype == "small")
660 cloudAssembly.texture_sheet = "/Models/Weather/cirrocumulus_sheet1.rgb";
661 cloudAssembly.num_tex_x = 3;
662 cloudAssembly.num_tex_y = 3;
663 cloudAssembly.n_sprites = 10;
664 cloudAssembly.z_scale = 0.6;
669 cloudAssembly.texture_sheet = "/Models/Weather/stratus_sheet1.rgb";
670 cloudAssembly.num_tex_x = 3;
671 cloudAssembly.num_tex_y = 2;
672 #cloudAssembly.n_sprites = 10;
673 cloudAssembly.n_sprites = 6;
674 cloudAssembly.z_scale = 0.4;
677 #characterize the cloud
678 cloudAssembly.bottom_shade = 0.4;
679 cloudAssembly.min_width = 2000.0 * mult;
680 cloudAssembly.max_width = 2500.0 * mult;
681 cloudAssembly.min_height = 2000.0 * mult;
682 cloudAssembly.max_height = 2500.0 * mult;
683 cloudAssembly.min_cloud_width = 5000.0;
684 cloudAssembly.min_cloud_height = 2600 * mult; #1.1 * cloudAssembly.max_height;
687 #signal that new routines are used
691 else if (type == "Stratus (thin)") {
693 cloudAssembly = local_weather.cloud.new(type, subtype);
696 if (subtype == "small")
699 cloudAssembly.texture_sheet = "/Models/Weather/cirrocumulus_sheet1.rgb";
700 cloudAssembly.num_tex_x = 3;
701 cloudAssembly.num_tex_y = 3;
702 # cloudAssembly.n_sprites = 20;
703 cloudAssembly.n_sprites = 10;
704 cloudAssembly.z_scale = 0.4;
709 cloudAssembly.texture_sheet = "/Models/Weather/stratus_sheet1.rgb";
710 cloudAssembly.num_tex_x = 3;
711 cloudAssembly.num_tex_y = 2;
712 # cloudAssembly.n_sprites = 10;
713 cloudAssembly.n_sprites = 6;
714 cloudAssembly.z_scale = 0.3;
719 #characterize the cloud
720 cloudAssembly.bottom_shade = 0.8;
721 cloudAssembly.min_width = 1900.0 * mult;
722 cloudAssembly.max_width = 2400.0 * mult;
723 cloudAssembly.min_height = 1900.0 * mult;
724 cloudAssembly.max_height = 2400.0 * mult;
725 cloudAssembly.min_cloud_width = 4200.0;
726 cloudAssembly.min_cloud_height = 2500.0 * mult;
729 #signal that new routines are used
734 else if (type == "Cirrostratus") {
736 cloudAssembly = local_weather.cloud.new(type, subtype);
739 if (subtype == "small") {mult = 0.7;}
742 # characterize the basic texture sheet
743 cloudAssembly.texture_sheet = "/Models/Weather/cirrostratus_sheet1.rgb";
744 cloudAssembly.num_tex_x = 2;
745 cloudAssembly.num_tex_y = 2;
747 #characterize the cloud
748 cloudAssembly.bottom_shade = 1.0;
749 cloudAssembly.n_sprites = 4;
750 cloudAssembly.min_width = 3500.0 * mult;
751 cloudAssembly.max_width = 4000.0 * mult;
752 cloudAssembly.min_height = 3500.0 * mult;
753 cloudAssembly.max_height = 4000.0 * mult;
754 cloudAssembly.min_cloud_width = 8000.0;
755 cloudAssembly.min_cloud_height = 50.0;
756 cloudAssembly.z_scale = 0.3;
758 #signal that new routines are used
762 else if (type == "Cirrostratus (small)") {
764 cloudAssembly = local_weather.cloud.new(type, subtype);
767 if (subtype == "small") {mult = 0.45;}
770 # characterize the basic texture sheet
771 cloudAssembly.texture_sheet = "/Models/Weather/cirrostratus_sheet1.rgb";
772 cloudAssembly.num_tex_x = 2;
773 cloudAssembly.num_tex_y = 2;
775 #characterize the cloud
776 cloudAssembly.bottom_shade = 1.0;
777 cloudAssembly.n_sprites = 2;
778 cloudAssembly.min_width = 3500.0 * mult;
779 cloudAssembly.max_width = 4000.0 * mult;
780 cloudAssembly.min_height = 3500.0 * mult;
781 cloudAssembly.max_height = 4000.0 * mult;
782 cloudAssembly.min_cloud_width = 4500.0 * mult;
783 cloudAssembly.min_cloud_height = 4500.0 * mult;
784 cloudAssembly.z_scale = 0.5;
786 #signal that new routines are used
791 else if (type == "Fog (thin)") {
792 if (subtype == "small") {
793 if (rn > 0.8) {path = "Models/Weather/stratus_thin1.xml";}
794 else if (rn > 0.6) {path = "Models/Weather/stratus_thin2.xml";}
795 else if (rn > 0.4) {path = "Models/Weather/stratus_thin3.xml";}
796 else if (rn > 0.2) {path = "Models/Weather/stratus_thin4.xml";}
797 else {path = "Models/Weather/stratus_thin5.xml";}
799 else if (subtype == "large") {
800 if (rn > 0.8) {path = "Models/Weather/stratus_thin1.xml";}
801 else if (rn > 0.6) {path = "Models/Weather/stratus_thin2.xml";}
802 else if (rn > 0.4) {path = "Models/Weather/stratus_thin3.xml";}
803 else if (rn > 0.2) {path = "Models/Weather/stratus_thin4.xml";}
804 else {path = "Models/Weather/stratus_thin5.xml";}
807 else if (type == "Fog (thick)") {
809 cloudAssembly = local_weather.cloud.new(type, subtype);
812 if (subtype == "small")
815 cloudAssembly.texture_sheet = "/Models/Weather/stratus_sheet1.rgb";
816 cloudAssembly.num_tex_x = 3;
817 cloudAssembly.num_tex_y = 2;
818 cloudAssembly.n_sprites = 5;
819 cloudAssembly.z_scale = 1.0;
824 cloudAssembly.texture_sheet = "/Models/Weather/stratus_sheet1.rgb";
825 cloudAssembly.num_tex_x = 3;
826 cloudAssembly.num_tex_y = 2;
827 cloudAssembly.n_sprites = 5;
828 cloudAssembly.z_scale = 1.0;
831 #characterize the cloud
832 cloudAssembly.bottom_shade = 0.4;
833 cloudAssembly.min_width = 2000.0 * mult;
834 cloudAssembly.max_width = 2500.0 * mult;
835 cloudAssembly.min_height = 2000.0 * mult;
836 cloudAssembly.max_height = 2500.0 * mult;
837 cloudAssembly.min_cloud_width = 5000.0;
838 cloudAssembly.min_cloud_height = 1.1 * cloudAssembly.max_height;
841 #signal that new routines are used
844 else if (type == "Test") {path="Models/Weather/single_cloud.xml";}
845 else if (type == "Box_test") {
846 if (subtype == "standard") {
847 if (rn > 0.8) {path = "Models/Weather/cloudbox1.xml";}
848 else if (rn > 0.6) {path = "Models/Weather/cloudbox2.xml";}
849 else if (rn > 0.4) {path = "Models/Weather/cloudbox3.xml";}
850 else if (rn > 0.2) {path = "Models/Weather/cloudbox4.xml";}
851 else {path = "Models/Weather/cloudbox5.xml";}
853 else if (subtype == "core") {
854 if (rn > 0.8) {path = "Models/Weather/cloudbox_core1.xml";}
855 else if (rn > 0.6) {path = "Models/Weather/cloudbox_core2.xml";}
856 else if (rn > 0.4) {path = "Models/Weather/cloudbox_core3.xml";}
857 else if (rn > 0.2) {path = "Models/Weather/cloudbox_core4.xml";}
858 else {path = "Models/Weather/cloudbox_core5.xml";}
860 else if (subtype == "bottom") {
861 if (rn > 0.66) {path = "Models/Weather/cloudbox_bottom1.xml";}
862 else if (rn > 0.33) {path = "Models/Weather/cloudbox_bottom2.xml";}
863 else if (rn > 0.0) {path = "Models/Weather/cloudbox_bottom3.xml";}
866 else if (type == "Cb_box") {
868 cloudAssembly = local_weather.cloud.new(type, subtype);
870 if (subtype == "standard")
872 if (rand() > 0.5) # use a Congestus texture
877 cloudAssembly.texture_sheet = "/Models/Weather/congestus_sheet1.rgb";
878 cloudAssembly.num_tex_x = 1;
879 cloudAssembly.num_tex_y = 3;
880 cloudAssembly.min_width = 1300.0;
881 cloudAssembly.max_width = 2000.0;
882 cloudAssembly.min_height = 600.0;
883 cloudAssembly.max_height = 900.0;
887 cloudAssembly.texture_sheet = "/Models/Weather/congestus_sheet2.rgb";
888 cloudAssembly.num_tex_x = 1;
889 cloudAssembly.num_tex_y = 2;
890 cloudAssembly.min_width = 1200.0;
891 cloudAssembly.max_width = 1800.0;
892 cloudAssembly.min_height = 700.0;
893 cloudAssembly.max_height = 1000.0;
896 cloudAssembly.n_sprites = 3;
897 cloudAssembly.min_cloud_width = 2200.0;
898 cloudAssembly.min_cloud_height = 1200.0;
899 cloudAssembly.bottom_shade = 0.6;
900 cloudAssembly.z_scale = 1.0;
904 # characterize the basic texture sheet
905 cloudAssembly.texture_sheet = "/Models/Weather/cumulonimbus_sheet2.rgb";
906 cloudAssembly.num_tex_x = 2;
907 cloudAssembly.num_tex_y = 2;
909 #characterize the cloud
910 cloudAssembly.bottom_shade = 0.6;
911 cloudAssembly.n_sprites = 6;
912 cloudAssembly.min_width = 800.0;
913 cloudAssembly.max_width = 1100.0;
914 cloudAssembly.min_height = 800.0;
915 cloudAssembly.max_height = 1100.0;
916 cloudAssembly.min_cloud_width = 3000.0;
917 cloudAssembly.min_cloud_height = 1500.0;
918 cloudAssembly.z_scale = 1.0;
923 else if (subtype == "core")
925 # characterize the basic texture sheet
926 cloudAssembly.texture_sheet = "/Models/Weather/cumulonimbus_sheet1.rgb";
927 cloudAssembly.num_tex_x = 2;
928 cloudAssembly.num_tex_y = 2;
930 #characterize the cloud
931 cloudAssembly.bottom_shade = 0.6;
932 cloudAssembly.n_sprites = 20;
933 cloudAssembly.min_width = 1000.0;
934 cloudAssembly.max_width = 1500.0;
935 cloudAssembly.min_height = 1000.0;
936 cloudAssembly.max_height = 1500.0 ;
937 cloudAssembly.min_cloud_width = 3500.0;
938 cloudAssembly.min_cloud_height = 2000.0;
939 cloudAssembly.z_scale = 1.0;
941 else if (subtype == "bottom")
943 cloudAssembly.texture_sheet = "/Models/Weather/cumulus_bottom_sheet1.rgb";
944 cloudAssembly.num_tex_x = 1;
945 cloudAssembly.num_tex_y = 1;
947 #characterize the cloud
948 cloudAssembly.bottom_shade = 0.4;
949 cloudAssembly.n_sprites = 4;
950 cloudAssembly.min_width = 1100.0;
951 cloudAssembly.max_width = 1400.0;
952 cloudAssembly.min_height = 1100.0;
953 cloudAssembly.max_height = 1400.0;
954 cloudAssembly.min_cloud_width = 1600;
955 cloudAssembly.min_cloud_height = 1200;
956 cloudAssembly.z_scale = 0.4;
960 #signal that new routines are used
967 else {print("Cloud type ", type, " subtype ",subtype, " not available!");}
972 # hash for assembling hard-coded clouds
974 var cloudAssembly = {};