#version 3.7;

#declare Radiosity = true;
#declare Palms = true;
#declare Grass = true;
#declare ChopperPresence = true;
#declare yvHel = 0.1;//Degré d'enfoncement de l' heliport	

global_settings{ assumed_gamma 1.0
	#if( Radiosity )
		#default{ finish{ ambient 0 } }
		#declare P_start = 64 / image_width;
		#declare P_end_final = 2 / image_width;
		
		radiosity{
			pretrace_start P_start
			pretrace_end   P_end_final
			error_bound 0.1
			minimum_reuse 0.01
			nearest_count 9
			count 800
			recursion_limit 1
			always_sample off
			low_error_factor 0.5
			brightness 1
			normal on
			media on
		}
	#end
}

#include "colors.inc"
#include "skies.inc"

#if( Palms )
	#include "includes/palmA.inc"
	#include "includes/palmB.inc"    
#end

#if( ChopperPresence )
	#declare ModelSubDir = "includes/uh64d/";
	#include concat(ModelSubDir, "uh64d_geom.inc")
#end

#include "includes/sceneTextures.inc"
#include "includes/objects.inc"

//#declare vectTransHelices = transform{translate <0.2636986, -23.21706, -0.1960156>};

camera{
	location <10, 6, -16> 
	look_at <0, 4, 4>
    right image_width / image_height * x
    up y
}

light_source{< 8, 7, -2>*100000 color srgb < 1, 1, 0.95> }

object{Ocean}
         
sky_sphere{ S_Cloud1 }

object{Heliport translate <-2, 0.2, 2> texture{HeliportTexture} translate -yvHel*y}//centre héliport : -2x, 0y, 2z

object{H_letter translate <-2, 0.2, 2> texture{WhiteTexture} translate -yvHel*y}

object{HelicoBeach_hf}

#if( Grass )
	MakeGrass(HelicoBeach_hf, 0.075, 16, 0.025, 0.3)
#end
	
#if( Palms )
	object{PalmB scale 6 translate <11, 0, 1>}
	object{PalmA rotate 120* y scale 7 translate <-9, 0, -4>}
#end

//Left side island
union{
	  object{IslandNum1_hf}
	  #if( Grass )
			MakeGrass(IslandNum1_hf, 0.1, 10, 0.3, 0.3)
	  #end
	  #if( Palms )
			object{PalmA scale 8}
	  #end
	  transform{IslandNum1Trans}
	 }
	

//Right side island
union{
	  object{IslandNum2_hf}
	  #if( Grass )
			MakeGrass(IslandNum2_hf, 0.1, 10, 0.2, 0.3)
	  #end
	  #if( Palms )
	      object{PalmB scale 10 translate -3.5 * x}
		  object{PalmA scale 8 translate 4 * x}
	  #end
	  transform{IslandNum2Trans}
	 }

//Volcano island
union{
		object{VolcanoIsland_hf}
		#if( Grass )
			MakeGrass(VolcanoIsland_hf, 0.5, 150, 1.2, 2.5)
		#end
		//Place des Palms sur l'ile volcanique en bordure(cette macro est faite pour ça ne pas l'utiliser autrement
		PlacePalm(8,   0,    3.8, 4.3)//A
		PlacePalm(9,   -2,   3.8, 3.5)//B
		PlacePalm(8,  -3,    3.8, 3.5)//C
		PlacePalm(7,  -4.5,  3.5, 3.5)//D
		PlacePalm(8,  -5,    3.8, 2.5)//E
		PlacePalm(10, -5,    3.8, 1.5)//F
		PlacePalm(8,  -4,    3.8, 1.3)//G
		PlacePalm(11, -3,    3.8, 0.5)//H
		PlacePalm(8,  -2.2,  3.8, -0.1)//I
		PlacePalm(8,   -1.2, 3.8, -0.4)//J
		PlacePalm(9,   -0.3, 3.8, -0.8)//K
		PlacePalm(8,   0.4,  3.8, -1.5)//L
		PlacePalm(7,   1,    3.8, -2.5)//M
		PlacePalm(8,   1.5,  3.8, -2)//N
		PlacePalm(11,  2,    3.8, -2)//O
		PlacePalm(8,   2,    3.8, -3)//P
		PlacePalm(9,   2,    3.8, -4)//Q
		PlacePalm(8,   2.5,    3.8, -5.5)//R
		PlacePalm(12,  3,  3.8, -6)//S
		PlacePalm(8,   3.5,    3.8, -5.5)//T
		PlacePalm(6,   4.3,  3.8, -5)//U
		PlacePalm(8,   4.8,  3.8, -4)//V
		PlacePalm(5,   5,  3.8, -3.5)//W
		PlacePalm(9,   5.3,  3.8, -2.8)//X
		PlacePalm(12,  5.5,    3.8, -1.8)//Y
		
		//Place des Palms sur l'ile volcanique au centre
		PlacePalm(9, -2.1,  3.8, 1.7)//Entre B et I						
		PlacePalm(12, -3    ,3.8, 2  )//Entre C et H						
		PlacePalm(10.5, -4.25 ,3.8, 2.4)//Entre D et G						
		
		transform{VolcanoIslandTrans}
}

//Volcano
union{
		object{Volcano_hf  }
		#if( Grass )
			MakeVolcanoGrass(Volcano_hf, 0.25, 100, 1, 0.3)
		#end
		translate <3.5 * 20, 0, 1.5 * 20>
		transform{ VolcanoIslandTrans}
}

#declare scaleHelico = 0.2;

#if( ChopperPresence )
	  object{ Complete_UH64D_Model
		scale scaleHelico
		translate 14.94496 * scaleHelico * y 
		translate (0.2 + 0.4 + yvHel)*y
		translate <-1, 0.16, 5.5>
	 }	
#end