#VRML V2.0 utf8

# Queyras's Moutains park VR tour

# CC - Francois Planchu - http://www.francois-planchu.com
# Date : 04-12-2005
# Creative Commons License BY-NC-SA (http://creativecommons.org/licenses/by-nc-sa/3.0)
# - permits   : Reproduction, Distribution, Notice, Derivative Works
# - requires  : Attribution, Share Alike
# - prohibits : Commercial Use

WorldInfo {
  title "Queyras"
  info "Parc régional du Queyras"
}

NavigationInfo {
	#type "WALK"
   	avatarSize [ 0.01 0.3 0.1 ]
   	headlight FALSE
   	speed 0.3
   	visibilityLimit 0
}

DEF LeFond Background {
	skyColor [ 0.0 0.2 0.7 , 0.0 0.5 1.0 , 0.7 0.85 1.0 ]
	skyAngle [ 0.9 , 1.571 ]
}

DirectionalLight {
	on TRUE
	intensity 1
	color 1.0000 1.0000 1.0000
	direction -0.15 -1 -0.15
}

DEF fog Fog {
	color 0.7 0.85 1.0
	visibilityRange 28
	fogType "LINEAR"
}

DEF view_Mont_Dauphin Viewpoint {
  position -19.0 0.34 11.69
  orientation 0 1 0 -1.5
  fieldOfView 0.6024
  description "0 - Mont Dauphin (Gare)"
}

DEF view_Ceillac Viewpoint {
  position -5.8 1.5 13.0
  orientation 0.1373 0.9889 0.05616 -0.7845
  fieldOfView 0.6024
  description "0.1 - Ceillac"
}
DEF view_Col_Fromage Viewpoint {
  position -2.4 2.0 10.0
  orientation 0.511 -0.856 -0.07865 -0.3558
  fieldOfView 0.6024
  description "0.5 - Col Fromage"
}
DEF view_Col_Estronques Viewpoint {
  position -1.0 2.4 10.2
  orientation 0.3689 0.9286 0.03903 -0.8059
  fieldOfView 0.6024
  description "0.7 - Col des Estronques"
}
DEF view_St_Veran Viewpoint {
  position 2.0 1.5 8.2
  orientation 0 -1 0 -4.0
  fieldOfView 0.6024
  description "1 - St Veran"
}
DEF view_Chapelle Viewpoint {
  position 5.0 1.8 11.6
  orientation 0 1 0 -1.5
  fieldOfView 0.6024
  description "1.3 - Chapelle de C."
}
DEF view_Col_Cham Viewpoint {
  position 9.2 2.48 10.9
  orientation 0.1745 0.9833 0.05086 -1
  fieldOfView 0.6024
  description "1.5 - Col de la Cham."
}
DEF view_Ref_Agnel Viewpoint {
  position 8.7 2.46 9.6
  orientation 0.0733 0.9948 0.07141 -1.62
  fieldOfView 0.42
  description "2 - Refuge Agnel"
}
DEF view_Col_Vieux Viewpoint {
  position 12.0 2.55 8.4
  orientation 0.8715 -0.4895 -0.03113 -0.1972
  fieldOfView 0.6024
  description "2.2 - Col Vieux"
}
DEF view_L_Echalp Viewpoint {
  position 12.9 1.38 0.7
  orientation 0 1 0 1.1
  fieldOfView 0.6024
  description "2.5 - L'Echalp"
}
DEF view_Ristolas Viewpoint {
  position 9.2 1.2 1.0
  orientation 0.3275 0.9443 0.03298 -0.2125
  fieldOfView 0.6024
  description "3 - Ristolas"
}
DEF view_Col_Gilly Viewpoint {
  position 10.2 1.99 -2.4
  orientation 0.8944 -0.4462 0.03123 -0.1951
  fieldOfView 0.6024
  description "3.5 - Colette de Gilly"
}
DEF view_Foret Viewpoint {
  position 8.7 1.66 -3.9
  orientation 0.021 -0.9947 -0.101 -2.386
  fieldOfView 0.6024
  description "3.8 - Foret de Gilly"
}
DEF view_Abries Viewpoint {
  position 8.13 1.14 -1.55
  orientation 0 1 0 1.15
  fieldOfView 0.6024
  description "4 - Abries"
}
DEF view_Aguilles Viewpoint {
  position 3.98 1.1 -1.68
  orientation 0 1 0 2.1
  fieldOfView 0.6024
  description "5 - Aiguilles"
}
DEF view_Les_Meyries Viewpoint {
  position -2.7 2.0 -1.0
  orientation 0.01605 -0.9939 -0.1091 -2.821
  fieldOfView 0.6024
  description "5.4 - Les Meyries"
}
DEF view_Souliers Viewpoint {
  position -5.51 1.36 1.5
  orientation 0 1 0 -0.4
  fieldOfView 0.6024
  description "6 - Souliers"
}
DEF view_Lac_de_Souliers Viewpoint {
  position -6.0 2.23 -3
  orientation 0.1092 -0.9882 -0.1073 -1.583
  fieldOfView 0.6024
  description "6.5 - Lac de Souliers"
}
DEF view_Brunissard Viewpoint {
  position -8.7 1.95 -4.1
  orientation 0 -0.99 -0.1 -3.168
  fieldOfView 0.6024
  description "7 - Brunissard"
}
DEF view_Foret_Ar Viewpoint {
  position -9.6 1.83 0.9
  orientation 0 1 0 3.2
  fieldOfView 0.6024
  description "7.4 - Foret d'Arvieux"
}
DEF view_Col_Furfande Viewpoint {
  position -9.9 2.17 4.2
  orientation 0.01 -0.99 -0.13 -3.263
  fieldOfView 0.6024
  description "7.9 - Col de Furfande"
}
DEF view_Ref_Furfande Viewpoint {
  position -11.2 1.9 6.0
  orientation 0.07268 0.9949 0.06957 -1.532
  fieldOfView 0.6024
  description "8 - Refuge de Furfande"
}
DEF view_Les_Escoyeres Viewpoint {
  position -6.1 1.0 5.0
  orientation 0 1 0 -3.8
  fieldOfView 0.6024
  description "8.4 - Les Escoyeres"
}
DEF view_Bramousse Viewpoint {
  position -8.12 0.9 8.12
  orientation 0 1 0 -1.05
  fieldOfView 0.6024
  description "9 - Bramousse"
}
DEF view_Col_de_Bramousse Viewpoint {
  position -4.8 1.9 9.9
  orientation 0.02011 -0.9943 -0.1047 -2.76
  fieldOfView 0.6024
  description "9.5 - Col de Bramousse"
}


DEF view_Vue_generale Viewpoint {
	position 7.63 16.5 23.1
	orientation 0.7888 -0.584 -0.1916 -0.7417
	fieldOfView 0.9865
	description "Vue globale"
}

#----[ Extern prototypes definitions : ]

EXTERNPROTO Timer [
	exposedField SFBool  enabled
	exposedField SFTime  cycleInterval
	exposedField SFTime  startTime
	exposedField SFTime  stopTime
	eventOut     SFTime  finishedTime
	eventOut     SFFloat fraction_changed
	eventOut     SFBool  isActive
	eventOut     SFTime  time
] "TimerPROTO.wrz"

EXTERNPROTO GlueToView [
   eventIn      SFVec3f    set_translation
   eventIn      SFVec3f    set_scale
   exposedField MFNode     children
   exposedField SFRotation rotation
   field        SFVec3f    translation
   field        SFVec3f    scale
   eventOut     SFVec3f    translation_changed
   eventOut     SFVec3f    scale_changed
] "GlueToViewPROTO.wrz"


EXTERNPROTO Village
	[
		field MFString _name
		field SFVec3f _scale
		field SFVec3f _position
		field SFRotation _rotation
		field SFNode _appearance
	]
	"./proto_village.wrl"

EXTERNPROTO Hammeau
	[
			field MFString _name
			field SFVec3f _scale
			field SFVec3f _position
			field SFRotation _rotation
			field SFNode _appearance
	]
	"./proto_hammeau.wrl"

EXTERNPROTO Murs_Chap
	[
		field SFVec3f _scale
		field SFVec3f _position
		field SFRotation _rotation
		field SFNode _appearance
	]
	"./objects/chapelle.wrl"

EXTERNPROTO Pt_Chalet
	[
		field SFVec3f _scale
		field SFVec3f _position
		field SFRotation _rotation
		field SFNode _appearance
	]
	"./objects/pt-chalet.wrl"

EXTERNPROTO Chateau
	[
		field MFString _name
		field SFVec3f _scale
		field SFVec3f _position
		field SFNode _appearance
	]
	"./proto_chateau.wrl"

EXTERNPROTO Label
	[
		field MFString _text
		field SFVec3f _position
		field SFFloat _size
		field SFNode _appearance
	]
	"./objects/label.wrl"

EXTERNPROTO Camera
	[
		field SFVec3f _scale
		field SFVec3f _position
		field SFRotation _rotation
		field SFNode _appearance
	]
	"./objects/camera.wrl"

EXTERNPROTO Binoculars
	[
		field SFVec3f _scale
		field SFVec3f _position
		field SFRotation _rotation
		field SFNode _appearance
	]
	"./objects/binoculars.wrl"

EXTERNPROTO OpenWinSensor
	[
		field SFVec3f _position
		field SFString _url
		field SFString _desc
		field SFString _params
		field SFNode _handler
	]
	"./objects/OpenWinSensor.wrl"

#----[ prototypes definitions : ]

PROTO ActiveBinoculars
	[
		field SFVec3f _position 0 0 0
		field SFString _url ""
	]
{
	OpenWinSensor {
		_position IS _position
		_url IS _url
		_desc "Voir le panoramique"
		_params "height=450,width=744,top=50,left=50,resizable"
		_handler Binoculars { _scale 0.002 0.002 0.002 _position 0 0.1 0 _rotation 0 1 0 -2 }
	}
}

PROTO ActiveCamera
	[
		field SFVec3f _position 0 0 0
		field SFString _url ""
	]
{
	OpenWinSensor {
		_position IS _position
		_url IS _url
		_desc "Voir la photo"
		_handler Camera {}
	}
}

PROTO Refuge
	[
		field MFString _name []
		field SFVec3f _position 0 0 0
		field SFRotation _rotation 0 1 0 0
		field SFNode _appearance Appearance {
									material Material {
												diffuseColor 0.8784 0.3373 0.3373
											 }
						 		}
	]
{
	Transform {
		translation IS _position
		rotation IS _rotation
		scale 0.01 0.01 0.01
		children [
			Label { _text IS _name _position 0 20 0 _appearance IS _appearance}
			Pt_Chalet { _scale 1 1 1 _position 0 0 0 _appearance IS _appearance }
		]
	}
}

PROTO Chapelle
	[
		field MFString _name []
		field SFVec3f _position 0 0 0
		field SFRotation _rotation 0 1 0 0
		field SFNode _appearance Appearance {
									material Material {
												diffuseColor 0.8784 0.3373 0.3373
											 }
						 		}
	]
{
	Transform {
		translation IS _position
		rotation IS _rotation
		scale 0.01 0.01 0.01
		children [
			Label { _text IS _name _position 0 20 0 _appearance IS _appearance}
			Murs_Chap { _scale 1 1 1 _position 0 0 0 _appearance IS _appearance }
		]
	}
}

PROTO LabelPic
	[
		field MFString _text []
		field SFVec3f _position 0 0 0
		field SFNode _appearance Appearance {
									material Material {
												diffuseColor 0 0 0
											 }
								}
	]
{
	Transform {
		translation IS _position
		children [
			Label { _text IS _text _position 0 0.25 0 _size 0.1 _appearance IS _appearance }
			Transform {
				rotation 1 0 0 3.14 # upsidedown
				translation 0 0.15 0
				children [
					Shape {
						appearance IS _appearance
						geometry Cone {
							bottomRadius 0.05
							height 0.1
						}
					}
				]
			}
		]
	}
}

#----[ Queyras park objects : ]

# disable the fog near global view point
DEF overviewProxsensor ProximitySensor {
	center 7.63 16.5 23.1
	size 80 17 80
}
DEF overviewScript Script {
	eventIn SFBool set_fogOff
	field SFNode fog USE fog
	url "javascript:
		function set_fogOff( isOff ) {
			fog.set_bind = !isOff
		}
	"
}
ROUTE overviewProxsensor.isActive TO overviewScript.set_fogOff

DEF Guillestre Village { _name [ "GUILLESTRE" ] _position -14.89 0.282 13.22 }
DEF Mt_Dauphin Village { _name [ "Mont Dauphin" ] _position -17.98 0.005 11.69 }
DEF Eygliers Village { _name [ "Eyglier" ] _position -16.35 0.281 11.19 }
DEF Ceillac Village { _name [ "Ceillac" ] _position -4.8 0.984 12.3 }
DEF St_Veran Village { _name [ "Saint Véran" ] _position 2.973 1.43 8.66 _scale 0.01 0.01 0.01 _rotation 0 1 0 -0.5 }
DEF Le_Villard Hammeau { _name [ "Le Villard" ] _position -3.66 1.195 11.1 _rotation 0 1 0  -0.95 }
DEF Le_Bois_Noir Hammeau { _name [ "Le Bois Noir" ] _position 0.9 1.43 13.11 }
DEF Chateau_Queyras Chateau { _name [ "Château-", "Queyras" ] _position -3.91 0.844 2.11 _scale 0.01 0.01 0.01 }
DEF Chap_Clausis Chapelle { _name [ "Chapelle", "de Clausis" ] _position 7.162 1.7 11.9 _rotation 0 1 0 -1.5701 }
DEF Ref_Agnel Refuge { _name [ "Refuge Agnel" ] _position 10.8 1.957 9.28 }
DEF L_Echalp Refuge { _name [ "L'Echalp" ] _position 12.6 0.98 1.5 }
DEF La_Monta Hammeau { _name [ "La Monta" ] _position 11.7 1.04 0.3 }
DEF Ristolas Hammeau { _name [ "Ristolas" ] _position 9.9 0.87 -0.1 }
DEF Abries Village { _name [ "Abriès" ] _position 7.3 0.84 -2.4 }
DEF Le_Roux Hammeau { _name [ "Le Roux" ] _position 8.68 1.09 -5.38 }
DEF Valpreveyre Hammeau { _name [ "Valpréveyre" ] _position 10.9 1.18 -4.70 }
DEF Aiguilles Village { _name [ "AIGUILLES" ] _position 2.68 0.71 -0.88 }
DEF Le_Lombard Hammeau { _name [ "Le Lombard" ] _position 1.5 1.26 -3.27 }
DEF Chalvet Hammeau { _name [ "Chalvet" ] _position -0.28 1.28 -0.91 _rotation 0 1 0 1.53 }
DEF Les_Meyries Hammeau { _name [ "Les Meyriès" ] _position -2.69 1.19 0.62 _rotation 0 1 0 1.53 }
DEF Ville_vieille Village { _name [ "Ville-", "Vieille" ] _position -1.19 0.70 1.48 }
DEF Molines Village { _name [ "Molines-en", "-Queyras" ] _position 0.90 1.13 5.09 }
DEF Souliers Hammeau { _name [ "Souliers" ] _position -5.41 1.06 0.01 }
DEF Fontgillarde Hammeau { _name [ "Fontgillarde" ] _position 4.51 1.41 5.91 }
DEF La_Chalp_Ste_A Hammeau { _name [ "La Chalp-", "Ste-Agathe" ] _position 1.19 1.14 7.22 }
DEF Montbardon Hammeau { _name [ "Montbardon" ] _position -5.11 0.75 6.01 }
DEF Brunissard Hammeau { _name [ "Brunissard" ] _position -8.7 1.06 -2.1 }
DEF La_Chalp_Ar Hammeau { _name [ "La Chalp" ] _position -8.1 0.98 -0.3 }
DEF Arvieux Village { _name [ "Arvieux" ] _position -7.8 0.84 0.9 }
DEF Refuge_Furfande Refuge { _name [ "Refuge de", "Furfande" ] _position -9.98 1.55 5.49 _rotation 0 1 0 0.765 }
DEF Les_Escoyeres Hammeau { _name [ "Les Escoyères" ] _position -7.56 0.84 6.10 }
DEF Bramousse Hammeau { _name [ "Bramousse" ] _position -6.92 0.71 7.82 _rotation 0 1 0 -1.275 }
DEF Le_Coin Hammeau { _name[ "Le Coin" ] _position -15.6 0.42 10.5 }
DEF Gros Refuge { _name[ "Gros" ] _position -13.5 0.66 11.3 }
DEF St_Clement Village { _name[ "St-Clément-", "sur-Durance" ] _position -21.2 0.05 14.6 _rotation 0 1 0 3.06 }
DEF St_Crepin Village { _name[ "Saint Crépin" ] _position -18.6 0.14 7.8 }
DEF Champcella Village { _name[ "Champcella" ] _position -21.6 0.43 5.8 _rotation 0 1 0 3.06 }
DEF La_Roche Village { _name[ "La Roche-", "de-Rame" ] _position -20.7 0.14 3.0 }
DEF L_Argentiere Village { _name[ "L'ARGENTIÈRE", "-LA-BESSE" ] _position -22.8 0.28 -2.7 }
DEF Les_Vigneaux Village { _name[ "Les Vigneaux" ] _position -24.0 0.28 -5.7 }
DEF St_Martin_de_Q Village { _name[ "Saint-Martin-", "de-Queyrieres" ] _position -20.5 0.32 -7.8 }
DEF Villar_St_P Village { _name[ "Villar-Saint-", "Pancrace" ] _position -17.1 0.29 -11.4 }
DEF Puy_St_A Village { _name[ "Puy-Saint-", "André" ] _position -19.3 0.86 -12.2 _rotation 0 1 0 3.06 }
DEF Briancon Village { _name[ "BRIANÇON" ] _position -16.2 0.42 -14.1 }
DEF Cervieres Village { _name[ "Cervières" ] _position -9.3 0.84 -11.1 }
DEF Les_Fonts_de_Cer Hammeau { _name[ "Les-Fonts-de", "-Cervières" ] _position -1.5 1.45 -7.8 }
DEF Thuras Hammeau { _name[ "Thuras" ] _position 0.6 2.53 -12.9 }
DEF Argentiera Hammeau { _name[ "Argentiera" ] _position 7.8 1.38 -13.5 _rotation 0 1 0 1.53 }
DEF Ribba Village { _name[ "Ribba" ] _position 16.6 1.122 -11.1 }
DEF Bobbio Village { _name[ "BOBBIO-", "PELLICE" ] _position 22.8 0.14 -3.6 }
DEF Ciabot_del_pra Hammeau { _name[ "Ciabot-", "del-Pra" ] _position 16.5 1.04 0.0 }
DEF Refuge_Granero Refuge { _name[ "Refuge", "Granero" ] _position 17.1 1.75 5.4 }
DEF Refuge_du_Viso Refuge { _name[ "Refuge", "du Viso" ] _position 17.7 2.06 8.4 }
DEF Piano_del_Re Hammeau { _name[ "Piano-", "del-Re" ] _position 21.6 1.3 8.7 }

ActiveBinoculars { _url "panorama/panoramique.html?sit=gilly" _position 10.85 1.9 -2.08 }
ActiveBinoculars { _url "panorama/panoramique.html?sit=souliers" _position -6.297 2.35 -3.966 }
ActiveBinoculars { _url "panorama/panoramique.html?sit=furfande" _position -10.0 1.60 2.69 }

ActiveCamera { _url "./photos/01_Ceillac.jpg" _position -3.35 1.3 10.806  }

LabelPic { _text [ "Pain de sucre", "3208 m" ] _position 12.6 2.648 9.6 }
LabelPic { _text [ "Monte Viso", "3841 m" ] _position 20.4 2.895 12.6 }
LabelPic { _text [ "Tête des Toillies", "3176 m" ] _position 8.7 2.672 13.8 }
LabelPic { _text [ "Pic Caramantran", "3026 m" ] _position 9.9 2.496 11.4 }
LabelPic { _text [ "Monte Granero", "3171 m" ] _position 18.9 2.648 6.9 }
LabelPic { _text [ "Grand Queyras", "3114 m" ] _position 9.3 2.613 6.6 }
LabelPic { _text [ "Pic de Château", "Renard 2989 m" ] _position 5.4 2.438 8.7 }
LabelPic { _text [ "Tête du Pelvas", "2929 m" ] _position 13.5 2.367 -1.8 }
LabelPic { _text [ "Sommet Bucher", "2254 m" ] _position -1.8 1.688 4.2 }
LabelPic { _text [ "Pic du Bréal", "Traversier 2989 m" ] _position -11.7 2.367 1.5 }
LabelPic { _text [ "Tête de Fouran", "2459 m" ] _position -24.3 2.25 10.8 }
LabelPic { _text [ "Pic de Montbrisson", "2825 m" ] _position -24.3 2.379 -9.9 }
LabelPic { _text [ "Pic du Haut", "Mouriare 2810 m" ] _position -15.3 2.285 -3.0 }
LabelPic { _text [ "Grand Peygu", "2796 m" ] _position -11.4 2.25 -7.2 }
LabelPic { _text [ "Grand Pic de", "Rochebrune 3325 m" ] _position -3.9 2.801 -4.8 }
LabelPic { _text [ "Pic du Grand Glaiza", "3286 m" ] _position 3.6 2.789 -8.4 }
LabelPic { _text [ "Bric Froid", "3302 m" ] _position 7.8 2.813 -10.2 }

#------[ Using dynamic load for the mountains faceSet ]

DEF loadingGroup Group {
	children [
		DEF loadingPanel GlueToView {
			children [
				DEF text Shape {
					geometry Text {
					  string ["Loading..."]
					  fontStyle FontStyle {
						 family "SANS"
						 size 2
						 justify "MIDDLE"
					  }
					}
					appearance Appearance {
						material DEF textMat Material {
							#diffuseColor 0.2 0.2 1
							diffuseColor 1 1 1
							#emissiveColor 0.2 0.2 1
							emissiveColor 0.2 0.4 0.9
						}
					}
				}
				DEF panel Transform {
					translation 0 0 -1
					children [
						Shape {
							geometry Box {
								size 20 10 0.1
							}
							appearance Appearance {
								material DEF panelMat Material {
									diffuseColor 0 0 0
								}
							}
						}
					]
				}
			]
		}
		DEF trigger TimeSensor { loop TRUE }	#use this timeSensor as a trigger for the loading one
		DEF loadTimer Timer { cycleInterval 5 }

		DEF S Script {
			eventIn SFTime start
			eventIn SFTime deleteThisNode
			field SFNode timer USE loadTimer
			field SFNode trigger USE trigger
			field SFNode loadingGroup USE loadingGroup

			url "javascript:
				function start( startTime ) {
					timer.set_startTime = startTime;
					trigger.set_stopTime = startTime;
				}
				function deleteThisNode( endTime ) {
					loadingGroup.set_children = new MFNode(); //delete this node at the loading end (no longer need it)
				}
			"
		}
	]
	ROUTE loadTimer.fraction_changed TO textMat.set_transparency
	ROUTE loadTimer.fraction_changed TO panelMat.set_transparency
	ROUTE loadTimer.finishedTime TO S.deleteThisNode
	ROUTE trigger.time TO S.start
}

DEF mountainsGroup Group {}

DEF mainScript Script {
	field MFString sourceURL ["mountains.wrz"]
	field SFNode targetNode USE mountainsGroup

	url "javascript:
		function initialize() {
			Browser.createVrmlFromURL( sourceURL, targetNode, 'addChildren' );
		}
	"
}