#VRML V2.0 utf8					
# Axes view-controller prototype a component in a 3D data plotting application 
#   for polar grids 
#     - a 30 deg long by 15 deg lat version 
#   Overwrite lib_Axes_ctrl_polar_sp_proto.wrl to implement this version
# Kurt A. Fisher fisherka@csolutions.net  beginner level VRML coder
# 1/2004

#     The limits of this graph box are set dynamically in the prototype.  
#     The axes, the axes labels and the viewpoints are scaled to a 1 unit size. 
#     A transformation resizes the axes to fit the needed size for the world.  
#
#     VRML normally plots with "z" pointing up out of the screen 
#       and the x-y axis plotting on the flat screen. 
#       The positive x-axis is to the right.
#       The positive y-axis is to the top. 
#
#     For display in normal galactic plane (z at top with positive x 
#       pointing out of the screen and towards the galactic center), 
#       A two-fold rotation is used to rotate the axis and world to the 
#       desired normal orientation. 

#       This rotation into normal galactic display is accomplished with 
#       two fold 90 degree rotations - once around the z axis and once around 
#       the x-axis.  Once these rotations are applied, x, y, z in a standard 
#       VRML rotation, if reference from outside the rotated object, are: 
#		Before		x	y	z
#		After		y	z	x

#       Tickmarks are at scaled 0.10 * scaleAxis[0] / scaleData[0] objects
#       E.g. - 0.10 & 6x axis scale up / 2x object scale up = .3 scale 

#  This application was developed for use in triaxial position modeling 
#   of astronomical objects.  Occassional coding references may reflect this bias. 

#  Objects used: 
#	None -  Axes_Ctrl is a root object 

#   Objects outline
#	Controller 		->Control_Panel -> Views 	
#			-> Axes_ctrl_polar view (this file)	
#			-> Data views (Data_Sets) ->
#				Model ->
#				DataSet (external file) -> Plotting object types (lib directory) 

PROTO AXES_CTRL [ 
	exposedField SFVec3f 	scaleAxis			2.0 2.0 2.0 				# Tickmarks are at scaled 0.10 * scaleAxis[0] / scaleData[0] objects 
	exposedField SFColor	axisColor			0.0 0.0 0.0				#  color for the fonts and axes 
	exposedField SFRotation	convertCoordinateSys	0.000 0.000 0.000 0.000		#  Rotate the entire axes object to a new coordinate system; usually leave as 0 0 0 0.00
#							#      E.g. convert frame between galactic, equatorial and horizon systems 
] # end PROTO Fields
# Begin PROTO OBJECT
{

Transform  { 		# rotate the entire object to new coordinate system 
#			x	y	z	rot
	rotation IS convertCoordinateSys
	children [

# BEGIN AXES OBJECT 
# Two-fold rotation of world to normal galactic presentation - looking down postive x axis l=0 to Orion at l=180 
DEF firstWorldRotationX Transform { 
	rotation 1.0 0.0 0.0 -1.571 # first rotation of world around x-axis
	children [

DEF secondWorldRotationZ Transform { 
	rotation 0.0 0.0 1.0 -1.571 # second rotation of world around z-axis
	children [

# SPHERICAL GRID WITH AUTOMATIC SCALING 
DEF XYZaxis Transform {	
			center 0.0 0.0 0.0 
			translation 0.0 0.0 0.0
			scale IS scaleAxis
	children [

# Adjust the inline object scale to a unity size 
DEF setObjSizeOne Transform { 
			center 0.0 0.0 0.0 
			translation 0.0 0.0 0.0
			scale 1.0 1.0 1.0 

	children [

Shape {
	appearance Appearance {					
		material Material {	
#  Syntax - Color is emissive, not diffuse for lineSet object 			
			emissiveColor IS axisColor
		} # end Material 				
	} # end Appearance 		
	geometry IndexedLineSet {
		coord Coordinate {
			point [
0.000,0.000,1.000, # Index 0 Long 0 Lat 90 Zenith point
0.259,0.000,0.966, # Index 1 Long 0 Lat 75 First ring +75 deg
0.224,-0.129,0.966, # Index 2 Long 330 Lat 75
0.129,-0.224,0.966, # Index 3 Long 300 Lat 75
0.000,-0.259,0.966, # Index 4 Long 270 Lat 75
-0.129,-0.224,0.966, # Index 5 Long 240 Lat 75
-0.224,-0.129,0.966, # Index 6 Long 210 Lat 75
-0.259,0.000,0.966, # Index 7 Long 180 Lat 75
-0.224,0.129,0.966, # Index 8 Long 150 Lat 75
-0.129,0.224,0.966, # Index 9 Long 120 Lat 75
0.000,0.259,0.966, # Index 10 Long 90 Lat 75
0.129,0.224,0.966, # Index 11 Long 60 Lat 75
0.224,0.129,0.966, # Index 12 Long 30 Lat 75
0.500,0.000,0.866, # Index 13 Long 0 Lat 60 First ring +60 deg
0.433,-0.250,0.866, # Index 14 Long 330 Lat 60
0.250,-0.433,0.866, # Index 15 Long 300 Lat 60
0.000,-0.500,0.866, # Index 16 Long 270 Lat 60
-0.250,-0.433,0.866, # Index 17 Long 240 Lat 60
-0.433,-0.250,0.866, # Index 18 Long 210 Lat 60
-0.500,0.000,0.866, # Index 19 Long 180 Lat 60
-0.433,0.250,0.866, # Index 20 Long 150 Lat 60
-0.250,0.433,0.866, # Index 21 Long 120 Lat 60
0.000,0.500,0.866, # Index 22 Long 90 Lat 60
0.250,0.433,0.866, # Index 23 Long 60 Lat 60
0.433,0.250,0.866, # Index 24 Long 30 Lat 60
0.707,0.000,0.707, # Index 25 Long 0 Lat 45 Second ring +45 deg
0.612,-0.354,0.707, # Index 26 Long 330 Lat 45
0.354,-0.612,0.707, # Index 27 Long 300 Lat 45
0.000,-0.707,0.707, # Index 28 Long 270 Lat 45
-0.354,-0.612,0.707, # Index 29 Long 240 Lat 45
-0.612,-0.354,0.707, # Index 30 Long 210 Lat 45
-0.707,0.000,0.707, # Index 31 Long 180 Lat 45
-0.612,0.354,0.707, # Index 32 Long 150 Lat 45
-0.354,0.612,0.707, # Index 33 Long 120 Lat 45
0.000,0.707,0.707, # Index 34 Long 90 Lat 45
0.354,0.612,0.707, # Index 35 Long 60 Lat 45
0.612,0.354,0.707, # Index 36 Long 30 Lat 45
0.866,0.000,0.500, # Index 37 Long 0 Lat 30 Third ring +30 deg
0.750,-0.433,0.500, # Index 38 Long 330 Lat 30
0.433,-0.750,0.500, # Index 39 Long 300 Lat 30
0.000,-0.866,0.500, # Index 40 Long 270 Lat 30
-0.433,-0.750,0.500, # Index 41 Long 240 Lat 30
-0.750,-0.433,0.500, # Index 42 Long 210 Lat 30
-0.866,0.000,0.500, # Index 43 Long 180 Lat 30
-0.750,0.433,0.500, # Index 44 Long 150 Lat 30
-0.433,0.750,0.500, # Index 45 Long 120 Lat 30
0.000,0.866,0.500, # Index 46 Long 90 Lat 30
0.433,0.750,0.500, # Index 47 Long 60 Lat 30
0.750,0.433,0.500 # Index 48 Long 30 Lat 30
0.966,0.000,0.259, # Index 49 Long 0 Lat 15 Fourth ring +15 deg
0.837,-0.483,0.259, # Index 50 Long 330 Lat 15
0.483,-0.837,0.259, # Index 51 Long 300 Lat 15
0.000,-0.966,0.259, # Index 52 Long 270 Lat 15
-0.483,-0.837,0.259, # Index 53 Long 240 Lat 15
-0.837,-0.483,0.259, # Index 54 Long 210 Lat 15
-0.966,0.000,0.259, # Index 55 Long 180 Lat 15
-0.837,0.483,0.259, # Index 56 Long 150 Lat 15
-0.483,0.837,0.259, # Index 57 Long 120 Lat 15
0.000,0.966,0.259, # Index 58 Long 90 Lat 15
0.483,0.837,0.259, # Index 59 Long 60 Lat 15
0.837,0.483,0.259, # Index 60 Long 30 Lat 15
1.000,0.000,0.000, # Index 61 Long 0 Lat 0 Fifth ring 0 deg
0.866,-0.500,0.000, # Index 62 Long 330 Lat 0
0.500,-0.866,0.000, # Index 63 Long 300 Lat 0
0.000,-1.000,0.000, # Index 64 Long 270 Lat 0
-0.500,-0.866,0.000, # Index 65 Long 240 Lat 0
-0.866,-0.500,0.000, # Index 66 Long 210 Lat 0
-1.000,0.000,0.000, # Index 67 Long 180 Lat 0
-0.866,0.500,0.000, # Index 68 Long 150 Lat 0
-0.500,0.866,0.000, # Index 69 Long 120 Lat 0
0.000,1.000,0.000, # Index 70 Long 90 Lat 0
0.500,0.866,0.000, # Index 71 Long 60 Lat 0
0.866,0.500,0.000, # Index 72 Long 30 Lat 0
0.966,0.000,-0.259, # Index 73 Long 0 Lat -15 Sixth Ring -15 deg
0.837,-0.483,-0.259, # Index 74 Long 330 Lat -15
0.483,-0.837,-0.259, # Index 75 Long 300 Lat -15
0.000,-0.966,-0.259, # Index 76 Long 270 Lat -15
-0.483,-0.837,-0.259, # Index 77 Long 240 Lat -15
-0.837,-0.483,-0.259, # Index 78 Long 210 Lat -15
-0.966,0.000,-0.259, # Index 79 Long 180 Lat -15
-0.837,0.483,-0.259, # Index 80 Long 150 Lat -15
-0.483,0.837,-0.259, # Index 81 Long 120 Lat -15
0.000,0.966,-0.259, # Index 82 Long 90 Lat -15
0.483,0.837,-0.259, # Index 83 Long 60 Lat -15
0.837,0.483,-0.259, # Index 84 Long 30 Lat -15
0.866,0.000,-0.500, # Index 85 Long 0 Lat -30 Sixth Ring -30 deg
0.750,-0.433,-0.500, # Index 86 Long 330 Lat -30
0.433,-0.750,-0.500, # Index 87 Long 300 Lat -30
0.000,-0.866,-0.500, # Index 88 Long 270 Lat -30
-0.433,-0.750,-0.500, # Index 89 Long 240 Lat -30
-0.750,-0.433,-0.500, # Index 90 Long 210 Lat -30
-0.866,0.000,-0.500, # Index 91 Long 180 Lat -30
-0.750,0.433,-0.500, # Index 92 Long 150 Lat -30
-0.433,0.750,-0.500, # Index 93 Long 120 Lat -30
0.000,0.866,-0.500, # Index 94 Long 90 Lat -30
0.433,0.750,-0.500, # Index 95 Long 60 Lat -30
0.750,0.433,-0.500, # Index 96 Long 30 Lat -30
0.707,0.000,-0.707, # Index 97 Long 0 Lat -45 Seventh Ring -45 deg
0.612,-0.354,-0.707, # Index 98 Long 330 Lat -45
0.354,-0.612,-0.707, # Index 99 Long 300 Lat -45
0.000,-0.707,-0.707, # Index 100 Long 270 Lat -45
-0.354,-0.612,-0.707, # Index 101 Long 240 Lat -45
-0.612,-0.354,-0.707, # Index 102 Long 210 Lat -45
-0.707,0.000,-0.707, # Index 103 Long 180 Lat -45
-0.612,0.354,-0.707, # Index 104 Long 150 Lat -45
-0.354,0.612,-0.707, # Index 105 Long 120 Lat -45
0.000,0.707,-0.707, # Index 106 Long 90 Lat -45
0.354,0.612,-0.707, # Index 107 Long 60 Lat -45
0.612,0.354,-0.707, # Index 108 Long 30 Lat -45
0.500,0.000,-0.866, # Index 109 Long 0 Lat -60 Eighth Ring -60 deg
0.433,-0.250,-0.866, # Index 110 Long 330 Lat -60
0.250,-0.433,-0.866, # Index 111 Long 300 Lat -60
0.000,-0.500,-0.866, # Index 112 Long 270 Lat -60
-0.250,-0.433,-0.866, # Index 113 Long 240 Lat -60
-0.433,-0.250,-0.866, # Index 114 Long 210 Lat -60
-0.500,0.000,-0.866, # Index 115 Long 180 Lat -60
-0.433,0.250,-0.866, # Index 116 Long 150 Lat -60
-0.250,0.433,-0.866, # Index 117 Long 120 Lat -60
0.000,0.500,-0.866, # Index 118 Long 90 Lat -60
0.250,0.433,-0.866, # Index 119 Long 60 Lat -60
0.433,0.250,-0.866, # Index 120 Long 30 Lat -60
0.259,0.000,-0.966, # Index 121 Long 0 Lat -75 Eighth Ring -75 deg
0.224,-0.129,-0.966, # Index 122 Long 330 Lat -75
0.129,-0.224,-0.966, # Index 123 Long 300 Lat -75
0.000,-0.259,-0.966, # Index 124 Long 270 Lat -75
-0.129,-0.224,-0.966, # Index 125 Long 240 Lat -75
-0.224,-0.129,-0.966, # Index 126 Long 210 Lat -75
-0.259,0.000,-0.966, # Index 127 Long 180 Lat -75
-0.224,0.129,-0.966, # Index 128 Long 150 Lat -75
-0.129,0.224,-0.966, # Index 129 Long 120 Lat -75
0.000,0.259,-0.966, # Index 130 Long 90 Lat -75
0.129,0.224,-0.966, # Index 131 Long 60 Lat -75
0.224,0.129,-0.966, # Index 132 Long 30 Lat -75
0.000,0.000,-1.000, # Index 73 Long 0 Lat -90 Anti-Zenith point
			]  # end coordinate Index 
		}  # end indexedLineSet
	} # end Shape 

	] # end children Transform Scale Object to Unity Size 
} # end Transform Scale Object to Unity Size 

	] # end children Transform Group Axes with scaling 
} # end Transform Group Axes with scaling 

	] # end children secondWorldRotationZ - around Z axis 
} # end Transform secondWorldRotationZ around Z axis 

	] # end children firstWorldRotationX - around X axis 
} # end Transform firstWorldRotationX around X axis 
# END OF AXES AND LABELS OBJECT 

	] # children Transform Convert to new coordinate system
} # end Transform Convert to new coordinate system 

 } # end PROTO OBJECT

