dofile(LockOn_Options.common_script_path.."elements_defs.lua")
SetScale(FOV)



--[[

{"rotate_using_parameter",0,1}
{"parameter_in_range",0,0.9,1.1},
{"change_color_when_parameter_equal_to_number", 0, 1, 1.0,1.0,0.0},

radar_SZ_AZIMUTH.element_params  	= {"SCAN_ZONE_ORIGIN_AZIMUTH",}
		

                               {"text_using_parameter",0,0},
                               {"opacity_using_parameter",1,1,0}} --first index is for element_params (starting with 0) , second for formats ( starting with 0)
		
		]]
		
		-- {{0,0},{1,0},{1,1},{0,1}}







small_pos = {0.0029,-.973,-2.225}	--Left Right, Up Down, For Aft
pivot = {-1.613,-.418,-3.693}	--Left Right, Up Down, For Aft
rot = {0,0,13.77}
mat = MakeMaterial(nil,{2,2,2,255})

big 				= CreateElement "ceTexPoly"
big.name 			= "big"
big.primitivetype 	= "triangles"
big.vertices 		= {{-.002,.14},{.002,.14},{.005,-.05},{-.005,-.05}}
big.indices			= {0,1,2,2,3,0}
big.init_pos		= pivot --Left Right, Up Down, For Aft
big.init_rot		= rot
big.material		= MakeMaterial(nil,{80,80,80,255})
--small.h_clip_relation = h_clip_relations.REWRITE_LEVEL
--total_field_of_view.parent_element	= parent.name
big.change_opacity	= false
big.collimated 		= false
big.isvisible		= true
big.element_params = {"ROTSMALL", "OPACITY"} -- Param Handle from Needle.lua logic file. Element Params tie into controllers. "NEEDLE" to "ROTATE"   "OPACITY" to "OPACIRTPARAM"
big.controllers = {
								{"rotate_using_parameter",0,1},
								{"opacity_using_parameter",1,1,0}}
								
Add(big)

small 				= CreateElement "ceTexPoly"
small.name 			= "small"
small.primitivetype 	= "triangles"
small.vertices 		= {{-.002,.212},{.002,.212},{.005,-.04},{-.005,-.04}}
small.indices			= {0,1,2,2,3,0}
small.init_pos		= pivot --Left Right, Up Down, For Aft
small.init_rot		= rot
small.material		= MakeMaterial(nil,{2,2,2,255})
--small.h_clip_relation = h_clip_relations.REWRITE_LEVEL
--total_field_of_view.parent_element	= parent.name
small.change_opacity	= false
small.collimated 		= false
small.isvisible		= true
small.element_params = {"ROT", "OPACITY"} -- Param Handle from Needle.lua logic file. Element Params tie into controllers. "NEEDLE" to "ROTATE"   "OPACITY" to "OPACIRTPARAM"
small.controllers = {
								{"rotate_using_parameter",0,1},
								{"opacity_using_parameter",1,1,0}}
								
Add(small)


pivotbig 				= CreateElement "ceTexPoly"
pivotbig.name 			= "pivotbig"
pivotbig.primitivetype 	= "triangles"
pivotbig.vertices 		= {{-.025,.025},{.025,.025},{.025,-.025},{-.025,-.025}}
pivotbig.indices			= {0,1,2,2,3,0}
pivotbig.init_pos		= pivot --Left Right, Up Down, For Aft
pivotbig.init_rot		= rot
pivotbig.tex_coords	 = {{0,0},{1,0},{1,1},{0,1}}
pivotbig.material		= MakeMaterial(LockOn_Options.script_path.."ThunderBirds/marathon/circle.tga",{2,2,2,255})
--pivotbig.h_clip_relation = h_clip_relations.REWRITE_LEVEL
--total_field_of_view.parent_element	= parent.name
pivotbig.change_opacity	= false -- not sure
pivotbig.collimated 		= false --not sure
pivotbig.isvisible		= true -- not sure
pivotbig.element_params = {"ROT", "OPACITY"} -- Param Handle from Needle.lua logic file. Element Params tie into controllers. "NEEDLE" to "ROTATE"         "OPACITY" to "OPACIRTPARAM"
pivotbig.controllers = {
								{"rotate_using_parameter",0,1},
								{"opacity_using_parameter",1,1,0}}
								
								
Add(pivotbig)




pivotins 				= CreateElement "ceTexPoly" -- gold
pivotins.name 			= "pivotins"
pivotins.primitivetype 	= "triangles"
pivotins.vertices 		= {{-.015,.015},{.015,.015},{.015,-.015},{-.015,-.015}}
pivotins.indices			= {0,1,2,2,3,0}
pivotins.init_pos		= pivot --Left Right, Up Down, For Aft
pivotins.init_rot		= rot
pivotins.tex_coords	 = {{0,0},{1,0},{1,1},{0,1}}
pivotins.material		= MakeMaterial(LockOn_Options.script_path.."ThunderBirds/marathon/circle.tga",{20,30,30,255})
--pivotinb.h_clip_relation = h_clip_relations.REWRITE_LEVEL
--total_field_of_view.parent_element	= parent.name
pivotins.change_opacity	= false -- not sure
pivotins.collimated 		= false --not sure
pivotins.isvisible		= true -- not sure
pivotins.element_params = {"ROT", "OPACITY"} -- Param Handle from Needle.lua logic file. Element Params tie into controllers. "NEEDLE" to "ROTATE"         "OPACITY" to "OPACIRTPARAM"
pivotins.controllers = {
								{"rotate_using_parameter",0,1},
								{"opacity_using_parameter",1,1,0}}
								
								
Add(pivotins)

pivotinb2 				= CreateElement "ceTexPoly" -- gray
pivotinb2.name 			= "pivotinb2"
pivotinb2.primitivetype 	= "triangles"
pivotinb2.vertices 		= {{-.008,.008},{.008,.008},{.008,-.008},{-.008,-.008}}
pivotinb2.indices			= {0,1,2,2,3,0}
pivotinb2.init_pos		= pivot --Left Right, Up Down, For Aft
pivotinb2.init_rot		= rot
pivotinb2.tex_coords	 = {{0,0},{1,0},{1,1},{0,1}}
pivotinb2.material		= MakeMaterial(LockOn_Options.script_path.."ThunderBirds/marathon/circle.tga",{30,30,30,255})
--pivotinb.h_clip_relation = h_clip_relations.REWRITE_LEVEL
--total_field_of_view.parent_element	= parent.name
pivotinb2.change_opacity	= false -- not sure
pivotinb2.collimated 		= false --not sure
pivotinb2.isvisible		= true -- not sure
pivotinb2.element_params = {"ROT", "OPACITY"} -- Param Handle from Needle.lua logic file. Element Params tie into controllers. "NEEDLE" to "ROTATE"         "OPACITY" to "OPACIRTPARAM"
pivotinb2.controllers = {
								{"rotate_using_parameter",0,1},
								{"opacity_using_parameter",1,1,0}}
								
								
Add(pivotinb2)

--[[

the TGA file should only be grayscale (and alpha). the color is defined by the Material property
this defines the color :   HUD_MATERIAL    = MakeMaterial(nil,{243, 116, 13, 255})  (r,g,b,opacity)
element.material         = HUD_MATERIAL  gives it the color
or you can go direct:          element.material =  MakeMaterial(nil,{243, 116, 13, 255})




local full_radius =  108 -- is this the radius of "HUD/net view field"? Units (pixels or angular units)?
local grid_shift  = -35 -- explain shift?
local grid_radius =  full_radius + grid_shift
local BASE_COLOR  = {255,0  ,0,255}
local BASE_COLOR2 = {0  ,255,0,255} --128,165,0,120
local GRID_   			= MakeMaterial("Bazar/Textures/AvionicsCommon.tga",BASE_COLOR2) -- image of the fixed net
local BASE_COLOR_MAT    = MakeMaterial(nil,BASE_COLOR)

]]
