 local shader_dir = "./shaders/"
 
 -- object used for created spotLight clones per spotlight
 local spot_light_obj = E.create_object(media_dir .. "spotLight.obj")
 E.set_entity_flags(spot_light_obj, E.entity_flag_hidden, true)
 
 function vec3(x, y, z)
  	local vec = { }
 	vec.x, vec.y, vec.z = x, y, z
 	vec.r, vec.g, vec.b = x, y, z
 	return vec
 end
 
 function vec4(x, y, z, w)
  	local vec = { }
 	vec.x, vec.y, vec.z, vec.w = x, y, z, w
 	vec.r, vec.g, vec.b, vec.a = x, y, z, w
 	return vec
 end

function create_point_shader(obj)
 	local brushes = { }
  	for i = 0, E.get_mesh_count(obj) - 1, 1 do
		table.insert(brushes, E.get_mesh(obj, i))
	end
	
	for i,v in ipairs(brushes) do
		E.set_brush_vert_shader(v, shader_dir .. "ceiling.vert")
		E.set_brush_frag_shader(v, shader_dir .. "ceiling.frag")
		
		E.set_brush_uniform_sampler(v, "colorMap", 0)
	end
 	
 	local point_shader = {
 		["type"] = "point";
 		["pointCount"] = 0;
 		["brushes"] = brushes;
 	}
 	
 	return point_shader
 end
 
  function add_point_light(point_shader, point_light)
 	point_shader.pointCount = point_shader.pointCount + 1
 	local i = string.format("%i", point_shader.pointCount - 1)
 	
 	for t,v in ipairs(point_shader.brushes) do
	  	E.set_brush_uniform_vector(v, "pointCount", point_shader.pointCount)
		E.set_brush_uniform_vector(v, "pointPos[" .. i .. "]", point_light.pos.x, point_light.pos.y, point_light.pos.z)
	end
 end

function create_spot_light(pos, dir, y_rot, perturb_y)
 	local spot_light = {
 		["pos"] = { ["x"] = pos.x; ["y"] = pos.y; ["z"] = pos.z; };
 		["dir"] = { ["x"] = dir.x; ["y"] = dir.y; ["z"] = dir.z; };
 		["perturb_y"] = perturb_y;
 	}
 	
 	local spot_obj = E.create_clone(spot_light_obj)
 	E.set_entity_position(spot_obj, pos.x, pos.y, pos.z)
 	E.set_entity_rotation(spot_obj, 0, y_rot, 0)
 	E.set_entity_scale(spot_obj, 0.4, 0.4, 0.4)
 	E.parent_entity(spot_obj, spotLightDirLight)
 	
 	return spot_light, spot_obj
 end
 
 wall = 1
 med_ren_floor = 2
 function create_spot_shader(obj, type, normal_map)
 	local shader_file_v = shader_dir .. "painting.vert"
 	local shader_file_f = shader_dir .. "painting.frag"
 	
 	if type and type == wall then
 		shader_file_v = shader_dir .. "wall.vert"
 		shader_file_f = shader_dir .. "wall.frag"
 	elseif type and type == med_ren_floor then
 		shader_file_v = shader_dir .. "medrenfloor.vert"
 		shader_file_f = shader_dir .. "medrenfloor.frag"
 	end
 
 	local brushes = { }
  	for i = 0, E.get_mesh_count(obj) - 1, 1 do
		table.insert(brushes, E.get_mesh(obj, i))
	end
	
	for i,v in ipairs(brushes) do
		E.set_brush_vert_shader(v, shader_file_v)
		E.set_brush_frag_shader(v, shader_file_f)
		E.set_brush_uniform_sampler(v, "colorMap", 0)
		
		if type and type ~= painting then
			E.set_brush_image(v, normal_map, 1)
		 	E.set_brush_uniform_sampler(v, "normalMap", 1)
		end
	end
 	
 	local spot_shader = {
 		["type"] = "spot";
 		["spotCount"] = 0;
 		["brushes"] = brushes;
 		["obj"] = obj;
 	}
 	
 	return spot_shader
 end
 
 --[[function add_normal_map(shader, image)
 	--local shader_file_v = shader_dir .. "spotLightNormalMap.vert"
 	--local shader_file_f = shader_dir .. "spotLightNormalMap.frag"
 	
-- 	--if shader.type == "point" then
 		shader_file_v = shader_dir .. "pointLightNormalMap.vert"
 		shader_file_f = shader_dir .. "pointLightNormalMap.frag"
 	end
 	
	 for i,v in ipairs(shader.brushes) do
		E.set_brush_vert_shader(v, shader_file_v)
		E.set_brush_frag_shader(v, shader_file_f)
	 	E.set_brush_image(v, image, 1)
	 	E.set_brush_uniform_sampler(v, "normalMap", 1)
	 end
 end]]
 
 function add_spot_light(spot_shader, spot_light, painting_rot_y)
 
 	spot_shader.spotCount = spot_shader.spotCount + 1
 	local i = string.format("%i", spot_shader.spotCount - 1)
 	
 	local category = E.get_entity_geom_attr(spot_shader.obj, E.geom_attr_category)
 	local translated_spot_pos_x, translated_spot_pos_y, translated_spot_pos_z
 	local my_spot_dir_x = spot_light.dir.x
 	local my_spot_dir_z = spot_light.dir.z
 	if category == category_painting then
		
		local pos_x, pos_y, pos_z = painting_positions[spot_shader.obj].pos_x, painting_positions[spot_shader.obj].pos_y, painting_positions[spot_shader.obj].pos_z
		translated_spot_pos_x, translated_spot_pos_y, translated_spot_pos_z = spot_light.pos.x - pos_x, spot_light.pos.y - pos_y, spot_light.pos.z - pos_z
		
		if painting_rot_y == 90 or painting_rot_y == -270 then
			translated_spot_pos_x, translated_spot_pos_z = -translated_spot_pos_z, translated_spot_pos_x
			my_spot_dir_x = -spot_light.dir.z
			my_spot_dir_z = spot_light.dir.x
		elseif painting_rot_y == 180 or painting_rot_y == -180  then
			translated_spot_pos_x, translated_spot_pos_z = -translated_spot_pos_x, -translated_spot_pos_z
			my_spot_dir_x = -spot_light.dir.x
			my_spot_dir_z = -my_spot_dir_z
		elseif painting_rot_y == 270 or painting_rot_y == -90  then
			translated_spot_pos_x, translated_spot_pos_z = translated_spot_pos_z, -translated_spot_pos_x
			my_spot_dir_x = spot_light.dir.z
			my_spot_dir_z = -spot_light.dir.x
		end
		
	end

 	for t,v in ipairs(spot_shader.brushes) do
	  	E.set_brush_uniform_vector(v, "spotCount", spot_shader.spotCount)
		
		if category == category_painting then
			local translated_spot_dir_x, translated_spot_dir_y, translated_spot_dir_z = normalize_3d(my_spot_dir_x, spot_dir_y, my_spot_dir_z)
			
			E.set_brush_uniform_vector(v, "spotPos[" .. i .. "]", translated_spot_pos_x, translated_spot_pos_y, translated_spot_pos_z)
			E.set_brush_uniform_vector(v, "spotDir[" .. i .. "]", translated_spot_dir_x, translated_spot_dir_y, translated_spot_dir_z)
		else
			E.set_brush_uniform_vector(v, "spotPos[" .. i .. "]", spot_light.pos.x, spot_light.pos.y, spot_light.pos.z)
			local norm_spot_x, norm_spot_y, norm_spot_z = normalize_3d(spot_light.dir.x, spot_light.dir.y, spot_light.dir.z)
			E.set_brush_uniform_vector(v, "spotDir[" .. i .. "]", norm_spot_x, norm_spot_y, norm_spot_z)
		end
	end
 end
    
    -- create world
	world = E.create_pivot()
	spotLightDirLight = E.create_light(E.light_type_directional)
	E.set_entity_position(spotLightDirLight, 0, -1, 0)
	E.parent_entity(spotLightDirLight, world)

	-- create museum
	local museum = E.create_object()
	local floor = E.create_object()

        --CenCeiling =      E.create_object(media_dir .. "19thCenCeiling.obj")
        local CenCeilingWest =      E.create_object(media_dir .. "19thCenCeilingWest.obj")
        local CenCeilingMiddle =      E.create_object(media_dir .. "19thCenCeilingMiddle.obj")
        local CenCeilingEast =      E.create_object(media_dir .. "19thCenCeilingEast.obj")
        local CenEast =         E.create_object(media_dir .. "19thCenEast.obj")
        --CenFloor =        E.create_object(media_dir .. "19thCenFloor.obj")
        local CenFloorSouth =        E.create_object(media_dir .. "19thCenFloorSouth.obj")
        local CenFloorNorthWest =        E.create_object(media_dir .. "19thCenFloorNorthWest.obj")
        local CenFloorNorthEast =        E.create_object(media_dir .. "19thCenFloorNorthEast.obj")
        local CenFloorEast =        E.create_object(media_dir .. "19thCenFloorEast.obj")
        local CenFloorWest =        E.create_object(media_dir .. "19thCenFloorWest.obj")
        --CenNorth =        E.create_object(media_dir .. "19thCenNorth.obj")
        local CenNorthWest =        E.create_object(media_dir .. "19thCenNorthWest.obj")
        local CenNorthEast =        E.create_object(media_dir .. "19thCenNorthEast.obj")
        local CenSouth =        E.create_object(media_dir .. "19thCenSouth.obj")
        local CenWest =         E.create_object(media_dir .. "19thCenWest.obj")
        local EntryWayCenMod =  E.create_object(media_dir .. "EntryWay19thMod.obj")
        local EntryWayCenGuard =  E.create_object(media_dir .. "EntryWay19thGuard.obj")

        local EntryCeiling =    E.create_object(media_dir .. "EntryCeiling.obj")
        local EntryEastEast =   E.create_object(media_dir .. "EntryEastEast.obj")
        local EntryEastWest =   E.create_object(media_dir .. "EntryEastWest.obj")
        local EntryFloor =      E.create_object(media_dir .. "EntryFloor.obj")
        local EntryNorth =      E.create_object(media_dir .. "EntryNorth.obj")
        local EntrySouthNorth = E.create_object(media_dir .. "EntrySouthNorth.obj")
        local EntrySouthSouth = E.create_object(media_dir .. "EntrySouthSouth.obj")
        local EntryWest =       E.create_object(media_dir .. "EntryWest.obj")
        local EntryWayEntryMed =	E.create_object(media_dir .. "EntryWayEntryMed.obj")
        local EntryWayEntryGift =	E.create_object(media_dir .. "EntryWayEntryGift.obj")

        local GiftCeiling =     E.create_object(media_dir .. "GiftCeiling.obj")
        local GiftEast =        E.create_object(media_dir .. "GiftEast.obj")
        local GiftFloor =       E.create_object(media_dir .. "GiftFloor.obj")
        local GiftNorth =       E.create_object(media_dir .. "GiftNorth.obj")
        local GiftSouth =       E.create_object(media_dir .. "GiftSouth.obj")
        local GiftWest =        E.create_object(media_dir .. "GiftWest.obj")
        local GiftBookcase = 	E.create_object(media_dir .. "GiftBookcase.obj")

        local GuardCeiling =    E.create_object(media_dir .. "GuardCeiling.obj")
        local GuardEast =       E.create_object(media_dir .. "GuardEast.obj")
        local GuardFloor =      E.create_object(media_dir .. "GuardFloor.obj")
        local GuardNorth =      E.create_object(media_dir .. "GuardNorth.obj")
        local GuardSouth =      E.create_object(media_dir .. "GuardSouth.obj")
        local GuardWest =       E.create_object(media_dir .. "GuardWest.obj")

        --MedCeiling =      E.create_object(media_dir .. "MedCeiling.obj")
        local MedCeilingNorth = E.create_object(media_dir .. "MedCeilingNorth.obj")
        local MedCeilingSouth = E.create_object(media_dir .. "MedCeilingSouth.obj")
        local MedEast =         E.create_object(media_dir .. "MedEast.obj")
        local MedFloorEast =    E.create_object(media_dir .. "MedFloorEast.obj")
        local MedFloorSouth =   E.create_object(media_dir .. "MedFloorSouth.obj")
        local MedFloorWest =    E.create_object(media_dir .. "MedFloorWest.obj")
        local MedNorth =        E.create_object(media_dir .. "MedNorth.obj")
        local MedSouth =        E.create_object(media_dir .. "MedSouth.obj")
        local MedWest =         E.create_object(media_dir .. "MedWest.obj")
        local EntryWayMedRen =  E.create_object(media_dir .. "EntryWayMedRen.obj")

        --ModCeiling =      E.create_object(media_dir .. "ModCeiling.obj")
        local ModCeilingSouth =      E.create_object(media_dir .. "ModCeilingSouth.obj")
        local ModCeilingMiddle =      E.create_object(media_dir .. "ModCeilingMiddle.obj")
        local ModCeilingNorth =      E.create_object(media_dir .. "ModCeilingNorth.obj")
        --ModEast =         E.create_object(media_dir .. "ModEast.obj")
        local ModEastSouth =         E.create_object(media_dir .. "ModEastSouth.obj")
        local ModEastNorth =         E.create_object(media_dir .. "ModEastNorth.obj")
        --ModFloor =        E.create_object(media_dir .. "ModFloor.obj")
        local ModFloorSouth =        E.create_object(media_dir .. "ModFloorSouth.obj")
        local ModFloorEastSouth =    E.create_object(media_dir .. "ModFloorEastSouth.obj")
        local ModFloorEastNorth =    E.create_object(media_dir .. "ModFloorEastNorth.obj")
        local ModFloorWestSouth =    E.create_object(media_dir .. "ModFloorWestSouth.obj")
        local ModFloorWestNorth =    E.create_object(media_dir .. "ModFloorWestNorth.obj")
        local ModNorth =        E.create_object(media_dir .. "ModNorth.obj")
        local ModSouth =        E.create_object(media_dir .. "ModSouth.obj")
        --ModWest =         E.create_object(media_dir .. "ModWest.obj")
        local ModWestSouth =         E.create_object(media_dir .. "ModWestSouth.obj")
        local ModWestNorth =         E.create_object(media_dir .. "ModWestNorth.obj")

        --RenCeiling =      E.create_object(media_dir .. "RenCeiling.obj")
        local RenCeilingNorth = E.create_object(media_dir .. "RenCeilingNorth.obj")
        local RenCeilingSouth = E.create_object(media_dir .. "RenCeilingSouth.obj")
        local RenEast =         E.create_object(media_dir .. "RenEast.obj")
        --RenFloor =        E.create_object(media_dir .. "RenFloor.obj")
        --RenFloorNorth =   E.create_object(media_dir .. "RenFloorNorth.obj")
        local RenFloorNorthWest =   E.create_object(media_dir .. "RenFloorNorthWest.obj")
        local RenFloorEast =    E.create_object(media_dir .. "RenFloorEast.obj")
        --RenFloorWest =    E.create_object(media_dir .. "RenFloorWest.obj")
        local RenFloorSouthWest =    E.create_object(media_dir .. "RenFloorSouthWest.obj")
        local RenNorth =        E.create_object(media_dir .. "RenNorth.obj")
        local RenSouth =        E.create_object(media_dir .. "RenSouth.obj")
        --RenWest =         E.create_object(media_dir .. "RenWest.obj")
        local RenWestNorth =         E.create_object(media_dir .. "RenWestNorth.obj")
        local RenWestSouth =         E.create_object(media_dir .. "RenWestSouth.obj")
        local EntryWayRen19thCen =	E.create_object(media_dir .. "EntryWayRen19thCen.obj")
		
		
		local EntryBench =	E.create_object(media_dir .. "EntryBench.obj")
        local EntryChair=	E.create_object(media_dir .. "EntryChair.obj")
        local EntryDocentDesk=	E.create_object(media_dir .. "EntryDocentDesk.obj")
        local EntryDocentChair=	E.create_object(media_dir .. "EntryDocentChair.obj")
        --EntryDocentDeskLamp=	E.create_object(media_dir .. "EntryDocentDeskLamp.obj")
       	local EntryTrash=	E.create_object(media_dir .. "EntryTrashCan.obj")
        --GiftBookShelf1=	E.create_object(media_dir .. "bookcaseMain.obj")
        --GiftBookShelf2=	E.create_clone(GiftBookShelf1)
        --GiftBookShelf3=	E.create_clone(GiftBookShelf1)
        --GiftBookShelf = E.create_object(media_dir .. "
        local GiftDesk=	E.create_object(media_dir .. "GiftDesk.obj")
        local GuardDesk=	E.create_object(media_dir .. "GuardDesk.obj")
        local GuardChair=	E.create_object(media_dir .. "GuardChair.obj")
        --GuardTrash=	E.create_object(media_dir .. "GuardTrash.obj")
		--Scenery1 = 	E.create_object(media_dir .. "
		
        -- create collision boxes/walls
        local north_boundary_wall = E.create_object()
        local east_boundary_wall = E.create_object()
        local south_boundary_wall = E.create_object()
        local west_boundary_wall = E.create_object()
        local north_ren_wall = E.create_object()
        local north_ren_medieval_wall = E.create_object()
        local north_medieval_wall = E.create_object()
        local south_giftshop_left_wall = E.create_object()
        local south_giftshop_right_wall = E.create_object()
        local north_giftshop_wall = E.create_object()
        local west_modern_wall = E.create_object()
        local west_guard_wall = E.create_object()
        local east_19thcen_wall = E.create_object()
        local west_entry_wall = E.create_object()
        local west_medieval_wall = E.create_object()
        local west_giftshop_wall = E.create_object()
        --[[guard_desk = E.create_object()
        entry_bench = E.create_object()
        entry_chair = E.create_object()
        entry_docent_desk = E.create_object()
        entry_docent_chair = E.create_object()
        gift_desk = E.create_object()]]

		local spot_height = 11
		local spot_d_from_wall = 6.8

        -- create interior
        walk_sound = E.load_sound(media_dir .. "walking.ogg")
        theme = E.load_sound(media_dir .. "theme.ogg")
        crowd = E.load_sound(media_dir .. "crowd.ogg")
        
        -- create non playable characters
        Wilhelm_Winckelmann = E.create_pivot()
        Wilhelm_Winckelmann_Idle = E.create_object(media_dir .. "Male08Pose1.obj")
        Wilhelm_Winckelmann_Talking = E.create_object(media_dir .. "Male08Pose2.obj")
        E.set_entity_flags(Wilhelm_Winckelmann_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Wilhelm_Winckelmann_Idle, Wilhelm_Winckelmann)
        E.parent_entity(Wilhelm_Winckelmann_Talking, Wilhelm_Winckelmann)
        
        Lacy_Lane = E.create_pivot()
        Lacy_Lane_Idle = E.create_object(media_dir .. "Female10Pose1.obj")
        Lacy_Lane_Talking = E.create_object(media_dir .. "Female10Pose2.obj")
        E.set_entity_flags(Lacy_Lane_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Lacy_Lane_Idle, Lacy_Lane)
        E.parent_entity(Lacy_Lane_Talking, Lacy_Lane)
        
        Samuel_Harris = E.create_pivot()
        Samuel_Harris_Idle = E.create_object(media_dir .. "Samuel_Harris_Idle.obj")
        Samuel_Harris_Talking = E.create_object(media_dir .. "Samuel_Harris_Talking.obj")
        E.set_entity_flags(Samuel_Harris_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Samuel_Harris_Idle, Samuel_Harris)
        E.parent_entity(Samuel_Harris_Talking, Samuel_Harris)
        --Samuel_Harris =       E.create_object(media_dir .. "Male01.obj")

        Martha_Stewart = E.create_pivot()
        Martha_Stewart_Idle = E.create_object(media_dir .. "Martha_Stewart_Idle.obj")
        Martha_Stewart_Talking = E.create_object(media_dir .. "Martha_Stewart_Talking.obj")
        E.set_entity_flags(Martha_Stewart_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Martha_Stewart_Idle, Martha_Stewart)
        E.parent_entity(Martha_Stewart_Talking, Martha_Stewart)
        --Martha_Stewart =      E.create_object(media_dir .. "Female01Mod.obj")
        
        Abigail_Stewart =     E.create_object(media_dir .. "Female03Mod2.obj")
        
        Dillon_White = E.create_pivot()
        Dillon_White_Idle = E.create_object(media_dir .. "Male07Mod.obj")
        Dillon_White_Talking = E.create_object(media_dir .. "Dillon_White_Talking.obj")
        E.set_entity_flags(Dillon_White_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Dillon_White_Idle, Dillon_White)
        E.parent_entity(Dillon_White_Talking, Dillon_White)
        --Dillon_White =        E.create_object(media_dir .. "Male07Mod.obj")
        
        Bob_Cassady = E.create_pivot()
        Bob_Cassady_Idle = E.create_object(media_dir .. "Male04Mod.obj")
        Bob_Cassady_Talking = E.create_object(media_dir .. "Bob_Cassady_Talking.obj")
        E.set_entity_flags(Bob_Cassady_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Bob_Cassady_Idle, Bob_Cassady)
        E.parent_entity(Bob_Cassady_Talking, Bob_Cassady)
        --Bob_Cassady =         E.create_object(media_dir .. "Male04Mod.obj")
        
        Raquel_Ramirez = E.create_pivot()
        Raquel_Ramirez_Idle = E.create_object(media_dir .. "Female02Mod.obj")
        Raquel_Ramirez_Talking = E.create_object(media_dir .. "Raquel_Ramirez_Idle.obj")
        E.set_entity_flags(Raquel_Ramirez_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Raquel_Ramirez_Idle, Raquel_Ramirez)
        E.parent_entity(Raquel_Ramirez_Talking, Raquel_Ramirez)
        --Raquel_Ramirez =      E.create_object(media_dir .. "Female02Mod.obj")
        
        Chin_Li = E.create_pivot()
        Chin_Li_Idle = E.create_object(media_dir .. "Male06Mod.obj")
        Chin_Li_Talking = E.create_object(media_dir .. "Chin_Li_Talking.obj")
        E.set_entity_flags(Chin_Li_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Chin_Li_Idle, Chin_Li)
        E.parent_entity(Chin_Li_Talking, Chin_Li)
        --Chin_Li =             E.create_object(media_dir .. "Male06Mod.obj")
        
        Claire_dAvignon = E.create_pivot()
        Claire_dAvignon_Idle = E.create_object(media_dir .. "Female09Mod.obj")
        Claire_dAvignon_Talking = E.create_object(media_dir .. "Claire_dAvignon_Talking.obj")
        E.set_entity_flags(Claire_dAvignon_Talking, E.entity_flag_hidden, true)
        E.parent_entity(Claire_dAvignon_Idle, Claire_dAvignon)
        E.parent_entity(Claire_dAvignon_Talking, Claire_dAvignon)
        --Claire_dAvignon =     E.create_object(media_dir .. "Female09Mod.obj")
        
        Giorgio_Venturi =     E.create_object(media_dir .. "Male10Mod.obj")
        Shelley_Stevenson =   E.create_object(media_dir .. "Female08Mod.obj")
        --Obudon_Salameki =     E.create_object(media_dir .. "Male03Mod.obj")
        Clem_Bergreen =       E.create_object(media_dir .. "Male02Mod.obj")
        Unknown_Name =        E.create_object(media_dir .. "Male09ModSm.obj")
        --Bijo_Patel =          E.create_object(media_dir .. "Male05Mod.obj")


        -- create paintings
	        painting1 =  E.create_object(media_dir .. "CASSATT.obj")
	        painting2 =  E.create_object(media_dir .. "CEZANNE.obj")
	        painting3 =  E.create_object(media_dir .. "CHURCH.obj")
	        painting4 =  E.create_object(media_dir .. "COURBET.obj")
	        painting5 =  E.create_object(media_dir .. "DAVID.obj")
	        painting6 =  E.create_object(media_dir .. "DEGAS.obj")
	        painting7 =  E.create_object(media_dir .. "GAUGUIN.obj")
	        painting8 =  E.create_object(media_dir .. "LAUTREC.obj")
	        painting9 =  E.create_object(media_dir .. "MANET.obj")
	        painting10 = E.create_object(media_dir .. "MONET.obj")
	        painting11 = E.create_object(media_dir .. "RENOIR.obj")
	        painting12 = E.create_object(media_dir .. "TURNER.obj")
	        painting13 = E.create_object(media_dir .. "INNES.obj")
	        painting14 = E.create_object(media_dir .. "GOGH.obj")
	        --painting15 = E.create_object()--media_dir .. "Flemish?.obj")
	        painting16 = E.create_object(media_dir .. "2Miniature.obj")
	        painting17 = E.create_object(media_dir .. "12StaineGlass.obj")
	        painting18 = E.create_object(media_dir .. "3Miniature.obj")
	        painting19 = E.create_object(media_dir .. "14Leaf.obj")
	        painting20 = E.create_object(media_dir .. "1Leaf.obj")
	        painting21 = E.create_object(media_dir .. "16Leaf.obj")
	        painting22 = E.create_object(media_dir .. "5Cross.obj")
	        painting23 = E.create_object(media_dir .. "6StainedGlass.obj")
	        painting24 = E.create_object(media_dir .. "4Fresco.obj")
	        painting25 = E.create_object(media_dir .. "7Panel.obj")
	        painting26 = E.create_object(media_dir .. "10Leaf.obj")
	        painting27 = E.create_object(media_dir .. "11Leaf.obj")
	        painting28 = E.create_object(media_dir .. "7Italy.obj")
	        painting29 = E.create_object(media_dir .. "13StainedGlass.obj")
	        painting30 = E.create_object(media_dir .. "CHAGALL.obj")
	        painting31 = E.create_object(media_dir .. "PICASSO.obj")
	        painting32 = E.create_object(media_dir .. "dechirico.obj")
	        painting33 = E.create_object(media_dir .. "kandinsky.obj")
	        painting34 = E.create_object(media_dir .. "MONDRIAN.obj")
	        painting35 = E.create_object(media_dir .. "POLLOCK.obj")
	        painting36 = E.create_object(media_dir .. "RICHTER.obj")
	        painting37 = E.create_object(media_dir .. "OFILI.obj")
	        painting38 = E.create_object(media_dir .. "STRUTH.obj")
	        painting39 = E.create_object(media_dir .. "dekooning.obj")
	        painting40 = E.create_object(media_dir .. "WARHOL.obj")
	        painting41 = E.create_object(media_dir .. "SCHNABEL.obj")
	        painting42 = E.create_object(media_dir .. "KIEFER.obj")
	        painting43 = E.create_object(media_dir .. "GG.obj")
	        painting44 = E.create_object(media_dir .. "Vasari.obj")
	        painting45 = E.create_object(media_dir .. "BRUEGEL.obj")
	        painting46 = E.create_object(media_dir .. "TROY.obj")
	        painting47 = E.create_object(media_dir .. "tintoretto.obj")
	        painting48 = E.create_object(media_dir .. "rembrandt.obj")
	        painting49 = E.create_object(media_dir .. "POUSSIN.obj")
	        painting50 = E.create_object(media_dir .. "ElGreco.obj")
	        painting51 = E.create_object(media_dir .. "LaTour.obj")
	        painting52 = E.create_object(media_dir .. "Angelico.obj")
	        painting53 = E.create_object(media_dir .. "WEST.obj")
	        painting54 = E.create_object(media_dir .. "VERMEER.obj")
	        painting55 = E.create_object(media_dir .. "botticelli.obj")
	        painting56 = E.create_object(media_dir .. "Aelst.obj")
	        painting57 = E.create_object(media_dir .. "MANFREDI.obj")
	        painting58 = E.create_object(media_dir .. "COPLEY.obj")
	        painting59 = E.create_object(media_dir .. "caravaggio2.obj")
	        painting60 = E.create_object(media_dir .. "caravaggio1.obj")
		

	-- set relationships
		
	E.parent_entity(world, camera)
	--E.parent_entity(world, MedSpot6)
	E.parent_entity(museum, world)
	E.parent_entity(floor, world)

		local CenRoom = E.create_pivot()
        --E.parent_entity(CenCeiling, CenRoom)
        E.parent_entity(CenCeilingWest, CenRoom)
        E.parent_entity(CenCeilingMiddle, CenRoom)
        E.parent_entity(CenCeilingEast, CenRoom)
        E.parent_entity(CenEast, CenRoom)
        --E.parent_entity(CenFloor, CenRoom)
        E.parent_entity(CenFloorSouth, CenRoom)
        E.parent_entity(CenFloorNorthWest, CenRoom)
        E.parent_entity(CenFloorNorthEast, CenRoom)
        E.parent_entity(CenFloorEast, CenRoom)
        E.parent_entity(CenFloorWest, CenRoom)
        --E.parent_entity(CenNorth, CenRoom)
        E.parent_entity(CenNorthWest, CenRoom)
        E.parent_entity(CenNorthEast, CenRoom)
        E.parent_entity(CenSouth, CenRoom)
        E.parent_entity(CenWest, CenRoom)
        E.parent_entity(EntryWayCenMod, CenRoom)
        E.parent_entity(EntryWayCenGuard, CenRoom)
        E.parent_entity(CenRoom, museum)

		local EntryRoom = E.create_pivot()
        E.parent_entity(EntryCeiling, EntryRoom)
        E.parent_entity(EntryEastEast, EntryRoom)
        E.parent_entity(EntryEastWest, EntryRoom)
        E.parent_entity(EntryFloor, EntryRoom)
        E.parent_entity(EntryNorth, EntryRoom)
        E.parent_entity(EntrySouthNorth, EntryRoom)
        E.parent_entity(EntrySouthSouth, EntryRoom)
        E.parent_entity(EntryWest, EntryRoom)
        E.parent_entity(EntryWayEntryMed, EntryRoom)
        E.parent_entity(EntryWayEntryGift, EntryRoom)
        E.parent_entity(EntryBench, EntryRoom)
        E.parent_entity(EntryChair, EntryRoom)
        E.parent_entity(EntryDocentDesk, EntryRoom)
        E.parent_entity(EntryDocentChair, EntryRoom)
        --E.parent_entity(EntryDocentDeskLamp, EntryRoom)
        E.parent_entity(EntryTrash, EntryRoom)
		E.parent_entity(EntryRoom, museum)
		
		local GiftRoom = E.create_pivot()
        E.parent_entity(GiftCeiling, GiftRoom)
        E.parent_entity(GiftEast, GiftRoom)
        E.parent_entity(GiftFloor, GiftRoom)
        E.parent_entity(GiftNorth, GiftRoom)
        E.parent_entity(GiftSouth, GiftRoom)
        E.parent_entity(GiftWest, GiftRoom)
        E.parent_entity(GiftBookcase, GiftRoom)
        --E.parent_entity(GiftBookShelf2, GiftRoom)
        --E.parent_entity(GiftBookShelf3, GiftRoom)
        E.parent_entity(GiftDesk, GiftRoom)
        E.parent_entity(GiftRoom, museum)

		local GuardRoom = E.create_pivot()
        E.parent_entity(GuardCeiling, GuardRoom)
        E.parent_entity(GuardEast, GuardRoom)
        E.parent_entity(GuardFloor, GuardRoom)
        E.parent_entity(GuardNorth, GuardRoom)
        E.parent_entity(GuardSouth, GuardRoom)
        E.parent_entity(GuardWest, GuardRoom)
        E.parent_entity(GuardDesk, GuardRoom)
        E.parent_entity(GuardChair, GuardRoom)
        E.parent_entity(GuardRoom, museum)

		local MedRoom = E.create_pivot()
        --E.parent_entity(MedCeiling, MedRoom)
        E.parent_entity(MedCeilingNorth, MedRoom)
        E.parent_entity(MedCeilingSouth, MedRoom)
        E.parent_entity(MedEast, MedRoom)
        --E.parent_entity(MedFloor, MedRoom)
        E.parent_entity(MedFloorEast, MedRoom)
        E.parent_entity(MedFloorSouth, MedRoom)
        E.parent_entity(MedFloorWest, MedRoom)
        E.parent_entity(MedNorth, MedRoom)
        E.parent_entity(MedSouth, MedRoom)
        E.parent_entity(MedWest, MedRoom)
        E.parent_entity(EntryWayMedRen, MedRoom)
        E.parent_entity(MedRoom, museum)

		local ModRoom = E.create_pivot()
 --       E.parent_entity(ModCeiling, ModRoom)
        E.parent_entity(ModCeilingSouth, ModRoom)
        E.parent_entity(ModCeilingMiddle, ModRoom)
        E.parent_entity(ModCeilingNorth, ModRoom)
--        E.parent_entity(ModEast, ModRoom)
        E.parent_entity(ModEastSouth, ModRoom)
        E.parent_entity(ModEastNorth, ModRoom)
--        E.parent_entity(ModFloor, ModRoom)
        E.parent_entity(ModFloorSouth, ModRoom)
        E.parent_entity(ModFloorEastSouth, ModRoom)
        E.parent_entity(ModFloorEastNorth, ModRoom)
        E.parent_entity(ModFloorWestSouth, ModRoom)
        E.parent_entity(ModFloorWestNorth, ModRoom)
        E.parent_entity(ModNorth, ModRoom)
        E.parent_entity(ModSouth, ModRoom)
--        E.parent_entity(ModWest, ModRoom)
        E.parent_entity(ModWestSouth, ModRoom)
        E.parent_entity(ModWestNorth, ModRoom)
        E.parent_entity(ModRoom, museum)

		local RenRoom = E.create_pivot()
        --E.parent_entity(RenCeiling, RenRoom)
        E.parent_entity(RenCeilingNorth, RenRoom)
        E.parent_entity(RenCeilingSouth, RenRoom)
        E.parent_entity(RenEast, RenRoom)
        --E.parent_entity(RenFloor, RenRoom)
        --E.parent_entity(RenFloorNorth, RenRoom)
        E.parent_entity(RenFloorNorthWest, RenRoom)
        E.parent_entity(RenFloorEast, RenRoom)
        --E.parent_entity(RenFloorWest, RenRoom)
        E.parent_entity(RenFloorSouthWest, RenRoom)
        E.parent_entity(RenNorth, RenRoom)
        E.parent_entity(RenSouth, RenRoom)
        --E.parent_entity(RenWest, RenRoom)
        E.parent_entity(RenWestNorth, RenRoom)
        E.parent_entity(RenWestSouth, RenRoom)
        E.parent_entity(EntryWayRen19thCen, RenRoom)
        E.parent_entity(RenRoom, museum)
        
       	E.parent_entity(north_boundary_wall, museum)
	E.parent_entity(east_boundary_wall, museum)
	E.parent_entity(south_boundary_wall, museum)
	E.parent_entity(west_boundary_wall, museum)
	E.parent_entity(north_ren_wall, museum)
	E.parent_entity(north_ren_medieval_wall, museum)
	E.parent_entity(north_medieval_wall, museum)
	E.parent_entity(south_giftshop_left_wall, museum)
	E.parent_entity(south_giftshop_right_wall, museum)
	E.parent_entity(north_giftshop_wall, museum)
	E.parent_entity(west_modern_wall, museum)
	E.parent_entity(west_guard_wall, museum)
	E.parent_entity(east_19thcen_wall, museum)
	E.parent_entity(west_entry_wall, museum)
	E.parent_entity(west_medieval_wall, museum)
	E.parent_entity(west_giftshop_wall, museum)
	
	E.parent_entity(Wilhelm_Winckelmann, museum)
	E.parent_entity(Lacy_Lane, museum)
	E.parent_entity(Samuel_Harris, museum)
	E.parent_entity(Martha_Stewart, museum)
	E.parent_entity(Abigail_Stewart, museum)
        E.parent_entity(Dillon_White, museum)
        E.parent_entity(Bob_Cassady, museum)
        E.parent_entity(Raquel_Ramirez, museum)
        E.parent_entity(Chin_Li, museum)
        E.parent_entity(Claire_dAvignon, museum)
        E.parent_entity(Giorgio_Venturi, museum)
        E.parent_entity(Shelley_Stevenson, museum)
        --E.parent_entity(Obudon_Salameki, museum)
        E.parent_entity(Clem_Bergreen, museum)
        E.parent_entity(Unknown_Name, museum)
        --E.parent_entity(Bijo_Patel, museum)
        
        
	        E.parent_entity(painting1,  CenRoom)
	        E.parent_entity(painting2,  CenRoom)
	        E.parent_entity(painting3,  CenRoom)
	        E.parent_entity(painting4,  CenRoom)
	        E.parent_entity(painting5,  CenRoom)
	        E.parent_entity(painting6,  CenRoom)
	        E.parent_entity(painting7,  CenRoom)
	        E.parent_entity(painting8,  CenRoom)
	        E.parent_entity(painting9,  CenRoom)
	        E.parent_entity(painting10, CenRoom)
	        E.parent_entity(painting11, CenRoom)
	        E.parent_entity(painting12, CenRoom)
	        E.parent_entity(painting13, CenRoom)
	        E.parent_entity(painting14, CenRoom)
        
        
        --E.parent_entity(painting15, MedRoom)
        E.parent_entity(painting16, MedRoom)
        E.parent_entity(painting17, MedRoom)
        E.parent_entity(painting18, MedRoom)
        E.parent_entity(painting19, MedRoom)
        E.parent_entity(painting20, MedRoom)
        E.parent_entity(painting21, MedRoom)
        E.parent_entity(painting22, MedRoom)
        E.parent_entity(painting23, MedRoom)
        E.parent_entity(painting24, MedRoom)
        E.parent_entity(painting25, MedRoom)
        E.parent_entity(painting26, MedRoom)
        E.parent_entity(painting27, MedRoom)
        E.parent_entity(painting28, MedRoom)
        E.parent_entity(painting29, MedRoom)
        
        E.parent_entity(painting30, ModRoom)
        E.parent_entity(painting31, ModRoom)
        E.parent_entity(painting32, ModRoom)
        E.parent_entity(painting33, ModRoom)
        E.parent_entity(painting34, ModRoom)
        E.parent_entity(painting35, ModRoom)
        E.parent_entity(painting36, ModRoom)
        E.parent_entity(painting37, ModRoom)
        E.parent_entity(painting38, ModRoom)
        E.parent_entity(painting39, ModRoom)
        E.parent_entity(painting40, ModRoom)
        E.parent_entity(painting41, ModRoom)
        E.parent_entity(painting42, ModRoom)
        E.parent_entity(painting43, ModRoom)
        
        
        E.parent_entity(painting44, RenRoom)
        E.parent_entity(painting45, RenRoom)
        E.parent_entity(painting46, RenRoom)
        E.parent_entity(painting47, RenRoom)
        E.parent_entity(painting48, RenRoom)
        E.parent_entity(painting49, RenRoom)
        E.parent_entity(painting50, RenRoom)
        E.parent_entity(painting51, RenRoom)
        E.parent_entity(painting52, RenRoom)
        E.parent_entity(painting53, RenRoom)
        E.parent_entity(painting54, RenRoom)
        E.parent_entity(painting55, RenRoom)
        E.parent_entity(painting56, RenRoom)
        E.parent_entity(painting57, RenRoom)
        E.parent_entity(painting58, RenRoom)
        E.parent_entity(painting59, RenRoom)
        E.parent_entity(painting60, RenRoom)

        E.set_entity_position(museum, 0, 0, 0)

	local wall_width = 0.5
	-- set collision box position and information
	E.set_entity_geom_type(floor, E.geom_type_plane, 0, 1, 0, 0)
	E.set_entity_geom_attr(floor, E.geom_attr_category, category_floor)
	E.set_entity_geom_attr(floor, E.geom_attr_collider, category_player)
	E.set_entity_geom_attr(floor, E.geom_attr_response, category_none)

    E.set_entity_position(north_boundary_wall, 80, 6, 40)
	E.set_entity_geom_type(north_boundary_wall, E.geom_type_box, 0, 12, 80)
	E.set_entity_geom_attr(north_boundary_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(north_boundary_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(north_boundary_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(north_boundary_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(north_boundary_wall, E.geom_attr_response, category_none)

	E.set_entity_position(east_boundary_wall, 40, 6, 80)
	E.set_entity_geom_type(east_boundary_wall, E.geom_type_box, 80, 12, 0)
	E.set_entity_geom_attr(east_boundary_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(east_boundary_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(east_boundary_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(east_boundary_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(east_boundary_wall, E.geom_attr_response, category_none)

	E.set_entity_position(south_boundary_wall, 0, 6, 40)
	E.set_entity_geom_type(south_boundary_wall, E.geom_type_box, 0, 12, 80)
	E.set_entity_geom_attr(south_boundary_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(south_boundary_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(south_boundary_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(south_boundary_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(south_boundary_wall, E.geom_attr_response, category_none)

	E.set_entity_position(west_boundary_wall, 40, 6, 0)
	E.set_entity_geom_type(west_boundary_wall, E.geom_type_box, 80, 12, 0)
	E.set_entity_geom_attr(west_boundary_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(west_boundary_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(west_boundary_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(west_boundary_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(west_boundary_wall, E.geom_attr_response, category_none)
	
	E.set_entity_position(north_ren_wall, 20, 6, 1.5)
	E.set_entity_geom_type(north_ren_wall, E.geom_type_box, wall_width, 12, 3)
	E.set_entity_geom_attr(north_ren_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(north_ren_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(north_ren_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(north_ren_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(north_ren_wall, E.geom_attr_response, category_none)
	
        E.set_entity_position(north_ren_medieval_wall, 20, 6, 40)
	E.set_entity_geom_type(north_ren_medieval_wall, E.geom_type_box, wall_width, 12, 52)
	E.set_entity_geom_attr(north_ren_medieval_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(north_ren_medieval_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(north_ren_medieval_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(north_ren_medieval_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(north_ren_medieval_wall, E.geom_attr_response, category_none)

        E.set_entity_position(north_medieval_wall, 20, 6, 78.5)
	E.set_entity_geom_type(north_medieval_wall, E.geom_type_box, wall_width, 12, 3)
	E.set_entity_geom_attr(north_medieval_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(north_medieval_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(north_medieval_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(north_medieval_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(north_medieval_wall, E.geom_attr_response, category_none)

	E.set_entity_position(south_giftshop_left_wall, 50, 6, 55.295)
	E.set_entity_geom_type(south_giftshop_left_wall, E.geom_type_box, wall_width, 12, 11.0917)
	E.set_entity_geom_attr(south_giftshop_left_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(south_giftshop_left_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(south_giftshop_left_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(south_giftshop_left_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(south_giftshop_left_wall, E.geom_attr_response, category_none)
	
	E.set_entity_position(south_giftshop_right_wall, 50, 6, 72.4375)
	E.set_entity_geom_type(south_giftshop_right_wall, E.geom_type_box, wall_width, 12, 15.125)
	E.set_entity_geom_attr(south_giftshop_right_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(south_giftshop_right_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(south_giftshop_right_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(south_giftshop_right_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(south_giftshop_right_wall, E.geom_attr_response, category_none)

	E.set_entity_position(north_giftshop_wall, 60, 6, 55.125)
	E.set_entity_geom_type(north_giftshop_wall, E.geom_type_box, wall_width, 12, 49.75)
	E.set_entity_geom_attr(north_giftshop_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(north_giftshop_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(north_giftshop_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(north_giftshop_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(north_giftshop_wall, E.geom_attr_response, category_none)

        E.set_entity_position(west_modern_wall, 78.5062, 6, 30)
	E.set_entity_geom_type(west_modern_wall, E.geom_type_box, 2.9875, 12, wall_width)
	E.set_entity_geom_attr(west_modern_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(west_modern_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(west_modern_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(west_modern_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(west_modern_wall, E.geom_attr_response, category_none)
	
	E.set_entity_position(west_guard_wall, 59.0875, 6, 30)
	E.set_entity_geom_type(west_guard_wall, E.geom_type_box, 7.96663, 12, wall_width)
	E.set_entity_geom_attr(west_guard_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(west_guard_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(west_guard_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(west_guard_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(west_guard_wall, E.geom_attr_response, category_none)

	E.set_entity_position(east_19thcen_wall, 35.6854, 6, 30)
	E.set_entity_geom_type(east_19thcen_wall, E.geom_type_box, 30.8708, 12, wall_width)
	E.set_entity_geom_attr(east_19thcen_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(east_19thcen_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(east_19thcen_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(east_19thcen_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(east_19thcen_wall, E.geom_attr_response, category_none)

	E.set_entity_position(west_entry_wall, 38.2688, 6, 40)
	E.set_entity_geom_type(west_entry_wall, E.geom_type_box, 42.9625, 12, wall_width)
	E.set_entity_geom_attr(west_entry_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(west_entry_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(west_entry_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(west_entry_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(west_entry_wall, E.geom_attr_response, category_none)

	E.set_entity_position(west_medieval_wall, 1.48125, 6, 40)
	E.set_entity_geom_type(west_medieval_wall, E.geom_type_box, 2.9625, 12, wall_width)
	E.set_entity_geom_attr(west_medieval_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(west_medieval_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(west_medieval_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(west_medieval_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(west_medieval_wall, E.geom_attr_response, category_none)
	
	E.set_entity_position(west_giftshop_wall, 1.48125, 6, 40)
	E.set_entity_geom_type(west_giftshop_wall, E.geom_type_box, 2.9625, 12, wall_width)
	E.set_entity_geom_attr(west_giftshop_wall, E.geom_attr_mass, 100)
	E.set_entity_geom_attr(west_giftshop_wall, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(west_giftshop_wall, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(west_giftshop_wall, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(west_giftshop_wall, E.geom_attr_response, category_none)

    --[[guard_desk = E.create_object()
    E.set_entity_position(guard_desk, 25, 2.5, 37)
	E.set_entity_geom_type(guard_desk, E.geom_type_box, 8, 3, 6)
	E.set_entity_geom_attr(guard_desk, E.geom_attr_mass, 50)
	E.set_entity_geom_attr(guard_desk, E.geom_attr_friction, 0)
	E.set_entity_geom_attr(guard_desk, E.geom_attr_category, category_walls)
	E.set_entity_geom_attr(guard_desk, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(guard_desk, E.geom_attr_response, category_none)
	
    entry_bench = E.create_object()
    entry_chair = E.create_object()
    entry_docent_desk = E.create_object()
    entry_docent_chair = E.create_object()
    gift_desk = E.create_object()]]

	-- set interior position and collision
	E.loop_sound(theme)
	E.set_sound_amplitude(theme, 0.9)
	E.set_sound_frequency(theme, 0.5)

	E.loop_sound(crowd)
	E.set_sound_amplitude(crowd, 0.1)
	E.set_sound_frequency(crowd, 0.5)
	
	local view_dir_x, tmp, view_dir_z = E.get_entity_z_vector(camera)
	view_dir_x, view_dir_z = -view_dir_x, -view_dir_z
	local view_dir_y
	view_dir_x, view_dir_y, view_dir_z = normalize_3d(view_dir_x, 0, view_dir_z)
	local d_from_cam = 10
	
	local pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z = player_pos.x + view_dir_x * d_from_cam, player_pos.y + view_dir_y * d_from_cam, player_pos.z + view_dir_z * d_from_cam

	local min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Wilhelm_Winckelmann_Idle)
	local w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
        -- set npc positions and information
	E.set_entity_position(Wilhelm_Winckelmann, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
    E.set_entity_rotation(Wilhelm_Winckelmann, 0, -9, 0)
        E.set_entity_geom_type(Wilhelm_Winckelmann, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Wilhelm_Winckelmann, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Wilhelm_Winckelmann, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Wilhelm_Winckelmann, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Lacy_Lane_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Lacy_Lane, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
        E.set_entity_geom_type(Lacy_Lane, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Lacy_Lane, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Lacy_Lane, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Lacy_Lane, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Samuel_Harris_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Samuel_Harris, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Samuel_Harris, 0, 90, 0 )
        E.set_entity_geom_type(Samuel_Harris, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Samuel_Harris, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Samuel_Harris, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Samuel_Harris, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Martha_Stewart_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
        E.set_entity_position(Martha_Stewart, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
        E.set_entity_rotation(Martha_Stewart, 0, -18, 0 )
        E.set_entity_geom_type(Martha_Stewart, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Martha_Stewart, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Martha_Stewart, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Martha_Stewart, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Abigail_Stewart)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Abigail_Stewart, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
        E.set_entity_rotation(Abigail_Stewart, 0, 12, 0 )
        E.set_entity_geom_type(Abigail_Stewart, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Abigail_Stewart, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Abigail_Stewart, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Abigail_Stewart, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Dillon_White_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Dillon_White, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Dillon_White, 0, -95, 0 )
        E.set_entity_geom_type(Dillon_White, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Dillon_White, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Dillon_White, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Dillon_White, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Bob_Cassady_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Bob_Cassady, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Bob_Cassady, 0, 98, 0 )
        E.set_entity_geom_type(Bob_Cassady, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Bob_Cassady, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Bob_Cassady, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Bob_Cassady, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Raquel_Ramirez_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Raquel_Ramirez, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Raquel_Ramirez, 0, 83, 0 )
        E.set_entity_geom_type(Raquel_Ramirez, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Raquel_Ramirez, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Raquel_Ramirez, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Raquel_Ramirez, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Chin_Li_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Chin_Li, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Chin_Li, 0, 5, 0 )
        E.set_entity_geom_type(Chin_Li, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Chin_Li, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Chin_Li, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Chin_Li, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Claire_dAvignon_Idle)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Claire_dAvignon, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Claire_dAvignon, 0, -80, 0 )
        E.set_entity_geom_type(Claire_dAvignon, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Claire_dAvignon, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Claire_dAvignon, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Claire_dAvignon, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Giorgio_Venturi)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Giorgio_Venturi, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Giorgio_Venturi, 0, -105, 0 )
        E.set_entity_geom_type(Giorgio_Venturi, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Giorgio_Venturi, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Giorgio_Venturi, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Giorgio_Venturi, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Shelley_Stevenson)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Shelley_Stevenson, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Shelley_Stevenson, 0, 62, 0 )
        E.set_entity_geom_type(Shelley_Stevenson, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Shelley_Stevenson, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Shelley_Stevenson, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Shelley_Stevenson, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Clem_Bergreen)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Clem_Bergreen, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Clem_Bergreen, 0, 80, 0 )
        E.set_entity_geom_type(Clem_Bergreen, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Clem_Bergreen, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Clem_Bergreen, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Clem_Bergreen, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(Unknown_Name)
	w,h,thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(Unknown_Name, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_rotation(Unknown_Name, 0, 200, 0 )
        E.set_entity_geom_type(Unknown_Name, E.geom_type_box, w, h, thickness)
        E.set_entity_geom_attr(Unknown_Name, E.geom_attr_category, category_person)
	E.set_entity_geom_attr(Unknown_Name, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(Unknown_Name, E.geom_attr_response, category_none)


	E.set_sound_emitter(crowd, Samuel_Harris)
	E.set_sound_emitter(crowd, Martha_Stewart)
	E.set_sound_emitter(crowd, Abigail_Stewart)
	E.set_sound_emitter(crowd, Dillon_White)
	E.set_sound_emitter(crowd, Bob_Cassady)
	E.set_sound_emitter(crowd, Raquel_Ramirez)
	E.set_sound_emitter(crowd, Chin_Li)
	E.set_sound_emitter(crowd, Claire_dAvignon)
	E.set_sound_emitter(crowd, Giorgio_Venturi)
	E.set_sound_emitter(crowd, Shelley_Stevenson)
	--E.set_sound_emitter(crowd, Obudon_Salameki)
	E.set_sound_emitter(crowd, Clem_Bergreen)
	E.set_sound_emitter(crowd, Unknown_Name)
	
	
        -- set painting positions and information
        -- 19th century room      3rd room

	-- store painting positions for use in shaders in this file and for actual positioning in place_objects.lua
	painting_positions = {
 		[painting1] = { };
 		[painting2] = { };
 		[painting3] = { };
 		[painting4] = { };
 		[painting5] = { };
 		[painting6] = { };
 		[painting7] = { };
 		[painting8] = { };
 		[painting9] = { };
 		[painting10] = { };
 		[painting11] = { };
 		[painting12] = { };
 		[painting13] = { };
 		[painting14] = { };
 		--[painting15] = { };
 		[painting16] = { };
 		[painting17] = { };
 		[painting18] = { };
 		[painting19] = { };
 		[painting20] = { };
 		[painting21] = { };
 		[painting22] = { };
 		[painting23] = { };
 		[painting24] = { };
 		[painting25] = { };
 		[painting26] = { };
 		[painting27] = { };
 		[painting28] = { };
 		[painting29] = { };
 		[painting30] = { };
 		[painting31] = { };
 		[painting32] = { };
 		[painting33] = { };
 		[painting34] = { };
 		[painting35] = { };
 		[painting36] = { };
 		[painting37] = { };
 		[painting38] = { };
 		[painting39] = { };
 		[painting40] = { };
 		[painting41] = { };
 		[painting42] = { };
 		[painting43] = { };
 		[painting44] = { };
 		[painting45] = { };
 		[painting46] = { };
 		[painting47] = { };
 		[painting48] = { };
 		[painting49] = { };
 		[painting50] = { };
 		[painting51] = { };
 		[painting52] = { };
 		[painting53] = { };
 		[painting54] = { };
 		[painting55] = { };
 		[painting56] = { };
 		[painting57] = { };
 		[painting58] = { };
 		[painting59] = { };
 		[painting60] = { };
 	};
 	
 	local min_x, max_x, min_y, max_y, min_z, max_z, tmp, thickness, w, h -- used in sizing
 	
   --[[ min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(GiftBookCase1)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	E.set_entity_position(GiftBookCase1, 55, h / 2, 80 - thickness / 2)
	E.set_entity_rotation(GiftBookCase1, 0, 180, 0)
	E.set_entity_position(GiftBookCase2, 55, h / 2, 50 + thickness / 2)
	E.set_entity_position(GiftBookCase3, 55, 1.5 * h, 50 + thickness / 2)]]

	local eye_level = 5.0

    min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting1)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
    painting_positions[painting1].pos_x, painting_positions[painting1].pos_y, painting_positions[painting1].pos_z = 24.1, 5, thickness / 2
	E.set_entity_position(painting1, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting1, E.geom_type_box, w, h, thickness)
    E.set_entity_geom_attr(painting1, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting1, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting1, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting2)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting2].pos_x, painting_positions[painting2].pos_y, painting_positions[painting2].pos_z = 30.1, 5, thickness / 2
	E.set_entity_position(painting2, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting2, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting2, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting2, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting2, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting3)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting3].pos_x, painting_positions[painting3].pos_y, painting_positions[painting3].pos_z = 38.7, 5, thickness / 2
	E.set_entity_position(painting3, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting3, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting3, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting3, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting3, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting4)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting4].pos_x, painting_positions[painting4].pos_y, painting_positions[painting4].pos_z = 47.8, 5, thickness / 2
	E.set_entity_position(painting4, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
    E.set_entity_geom_type(painting4, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting4, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting4, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting4, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting5)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting5].pos_x, painting_positions[painting5].pos_y, painting_positions[painting5].pos_z = 59.1, 5, thickness / 2
	E.set_entity_position(painting5, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting5, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting5, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting5, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting5, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting6)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting6].pos_x, painting_positions[painting6].pos_y, painting_positions[painting6].pos_z = 67.1, 5, thickness / 2
	E.set_entity_position(painting6, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting6, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting6, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting6, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting6, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting7)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting7].pos_x, painting_positions[painting7].pos_y, painting_positions[painting7].pos_z = 73.6, 5, thickness / 2
	E.set_entity_position(painting7, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting7, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting7, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting7, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting7, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting8)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting8].pos_x, painting_positions[painting8].pos_y, painting_positions[painting8].pos_z = 80 - thickness / 2, 5, 7.32
	E.set_entity_position(painting8, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting8, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting8, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting8, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting8, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting9)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting9].pos_x, painting_positions[painting9].pos_y, painting_positions[painting9].pos_z = 80 - thickness / 2, 5, 15
	E.set_entity_position(painting9, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting9, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting9, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting9, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting9, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting10) -- repositioned to south wall...out of clock-wise order
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting10].pos_x, painting_positions[painting10].pos_y, painting_positions[painting10].pos_z = 40, 5, 29.75 - thickness / 2
	E.set_entity_position(painting10, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting10, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting10, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting10, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting10, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting11)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting11].pos_x, painting_positions[painting11].pos_y, painting_positions[painting11].pos_z = 80 - thickness / 2, 5, 22.03
	E.set_entity_position(painting11, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting11, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting11, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting11, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting11, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting12)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting12].pos_x, painting_positions[painting12].pos_y, painting_positions[painting12].pos_z = 30, 5, 29.75 - thickness / 2
	E.set_entity_position(painting12, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting12, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting12, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting12, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting12, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting13)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting13].pos_x, painting_positions[painting13].pos_y, painting_positions[painting13].pos_z = 20.25 + thickness / 2, 5, 24.31
	E.set_entity_position(painting13, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting13, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting13, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting13, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting13, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting14)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting14].pos_x, painting_positions[painting14].pos_y, painting_positions[painting14].pos_z = 20.25 + thickness / 2, 5, 18.66
	E.set_entity_position(painting14, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting14, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting14, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting14, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting14, E.geom_attr_response, category_none)
        -- medieval room    1st room
    --[[19.75 - thickness / 2, 5, 43.9
	E.set_entity_position(painting15, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting15, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting15, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting15, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting15, E.geom_attr_response, category_none)]]

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting16)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting16].pos_x, painting_positions[painting16].pos_y, painting_positions[painting16].pos_z = 19.75 - thickness / 2, eye_level, 44.1
	E.set_entity_position(painting16, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting16, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting16, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting16, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting16, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting17)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting17].pos_x, painting_positions[painting17].pos_y, painting_positions[painting17].pos_z = 19.75 - thickness / 2, eye_level, 50.26
	E.set_entity_position(painting17, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting17, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting17, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting17, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting17, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting18)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting18].pos_x, painting_positions[painting18].pos_y, painting_positions[painting18].pos_z = 19.75 - thickness / 2, eye_level, 55.6
	E.set_entity_position(painting18, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting18, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting18, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting18, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting18, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting19)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting19].pos_x, painting_positions[painting19].pos_y, painting_positions[painting19].pos_z = 19.75 - thickness / 2, eye_level, 58
	E.set_entity_position(painting19, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting19, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting19, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting19, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting19, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting20)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting20].pos_x, painting_positions[painting20].pos_y, painting_positions[painting20].pos_z = 19.75 - thickness / 2, eye_level, 61.7
	E.set_entity_position(painting20, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting20, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting20, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting20, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting20, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting21)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting21].pos_x, painting_positions[painting21].pos_y, painting_positions[painting21].pos_z = 15.8, eye_level, 80 - thickness / 2
	E.set_entity_position(painting21, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting21, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting21, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting21, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting21, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting22)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting22].pos_x, painting_positions[painting22].pos_y, painting_positions[painting22].pos_z = 10, 6, 80 - thickness / 2
	E.set_entity_position(painting22, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting22, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting22, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting22, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting22, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting23)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting23].pos_x, painting_positions[painting23].pos_y, painting_positions[painting23].pos_z = 4, eye_level, 80 - thickness / 2
	E.set_entity_position(painting23, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting23, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting23, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting23, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting23, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting24)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting24].pos_x, painting_positions[painting24].pos_y, painting_positions[painting24].pos_z = thickness / 2, 6, 72
	E.set_entity_position(painting24, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting24, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting24, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting24, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting24, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting25)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting25].pos_x, painting_positions[painting25].pos_y, painting_positions[painting25].pos_z = thickness / 2, eye_level, 62.2
	E.set_entity_position(painting25, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting25, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting25, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting25, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting25, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting26)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting26].pos_x, painting_positions[painting26].pos_y, painting_positions[painting26].pos_z = thickness / 2, eye_level, 57.3
	E.set_entity_position(painting26, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting26, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting26, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting26, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting26, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting27)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting27].pos_x, painting_positions[painting27].pos_y, painting_positions[painting27].pos_z = thickness / 2, eye_level, 53.45
	E.set_entity_position(painting27, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting27, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting27, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting27, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting27, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting28)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting28].pos_x, painting_positions[painting28].pos_y, painting_positions[painting28].pos_z = thickness / 2, eye_level, 49.679
	E.set_entity_position(painting28, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting28, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting28, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting28, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting28, E.geom_attr_response, category_none)

	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting29)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting29].pos_x, painting_positions[painting29].pos_y, painting_positions[painting29].pos_z = thickness / 2, eye_level, 44.38
	E.set_entity_position(painting29, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting29, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting29, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting29, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting29, E.geom_attr_response, category_none)
	
        -- modern room   4th room
    min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting30)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
    painting_positions[painting30].pos_x, painting_positions[painting30].pos_y, painting_positions[painting30].pos_z = 80 - thickness / 2, 5, 34.76
	E.set_entity_position(painting30, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting30, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting30, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting30, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting30, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting31)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting31].pos_x, painting_positions[painting31].pos_y, painting_positions[painting31].pos_z = 80 - thickness / 2, 5, 39.66
	E.set_entity_position(painting31, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting31, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting31, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting31, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting31, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting32)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting32].pos_x, painting_positions[painting32].pos_y, painting_positions[painting32].pos_z = 80 - thickness / 2, 5, 45.56
	E.set_entity_position(painting32, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting32, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting32, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting32, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting32, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting33)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting33].pos_x, painting_positions[painting33].pos_y, painting_positions[painting33].pos_z = 80 - thickness / 2, 5, 52.945
	E.set_entity_position(painting33, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting33, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting33, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting33, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting33, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting34)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting34].pos_x, painting_positions[painting34].pos_y, painting_positions[painting34].pos_z = 80 - thickness / 2, 5, 58.06
	E.set_entity_position(painting34, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting34, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting34, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting34, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting34, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting35)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting35].pos_x, painting_positions[painting35].pos_y, painting_positions[painting35].pos_z = 80 - thickness / 2, 5, 66.86
	E.set_entity_position(painting35, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting35, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting35, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting35, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting35, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting36)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting36].pos_x, painting_positions[painting36].pos_y, painting_positions[painting36].pos_z = 80 - thickness / 2, 5, 74.96
	E.set_entity_position(painting36, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting36, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting36, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting36, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting36, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting37)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting37].pos_x, painting_positions[painting37].pos_y, painting_positions[painting37].pos_z = 70.1, 6, 80 - thickness / 2
	E.set_entity_position(painting37, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting37, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting37, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting37, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting37, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting38)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting38].pos_x, painting_positions[painting38].pos_y, painting_positions[painting38].pos_z = 60.25 + thickness / 2, 5, 75.094
	E.set_entity_position(painting38, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting38, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting38, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting38, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting38, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting39)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting39].pos_x, painting_positions[painting39].pos_y, painting_positions[painting39].pos_z = 60.25 + thickness / 2, 5, 70.76
	E.set_entity_position(painting39, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting39, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting39, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting39, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting39, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting40)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting40].pos_x, painting_positions[painting40].pos_y, painting_positions[painting40].pos_z = 60.25 + thickness / 2, 5, 66.16
	E.set_entity_position(painting40, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting40, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting40, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting40, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting40, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting41)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting41].pos_x, painting_positions[painting41].pos_y, painting_positions[painting41].pos_z = 60.25 + thickness / 2, 6, 55.28
	E.set_entity_position(painting41, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting41, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting41, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting41, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting41, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting42)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting42].pos_x, painting_positions[painting42].pos_y, painting_positions[painting42].pos_z = 60.25 + thickness / 2, 6, 41.48
	E.set_entity_position(painting42, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting42, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting42, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting42, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting42, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting43)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting43].pos_x, painting_positions[painting43].pos_y, painting_positions[painting43].pos_z = 60.25 + thickness / 2, 5, 34.58
	E.set_entity_position(painting43, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting43, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting43, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting43, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting43, E.geom_attr_response, category_none)
	
        -- ren baroque room  2nd room
    min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting44)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
    painting_positions[painting44].pos_x, painting_positions[painting44].pos_y, painting_positions[painting44].pos_z = thickness / 2, 6, 35.7
	E.set_entity_position(painting44, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting44, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting44, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting44, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting44, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting45)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting45].pos_x, painting_positions[painting45].pos_y, painting_positions[painting45].pos_z = thickness / 2, 9, 29.5
	E.set_entity_position(painting45, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting45, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting45, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting45, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting45, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting46)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting46].pos_x, painting_positions[painting46].pos_y, painting_positions[painting46].pos_z = thickness / 2, 4, 29.5
	E.set_entity_position(painting46, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting46, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting46, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting46, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting46, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting47)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting47].pos_x, painting_positions[painting47].pos_y, painting_positions[painting47].pos_z = thickness / 2, 6, 20.9
	E.set_entity_position(painting47, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting47, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting47, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting47, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting47, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting48)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting48].pos_x, painting_positions[painting48].pos_y, painting_positions[painting48].pos_z = thickness / 2, 6, 13.6
	E.set_entity_position(painting48, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting48, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting48, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting48, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting48, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting49)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting49].pos_x, painting_positions[painting49].pos_y, painting_positions[painting49].pos_z = thickness / 2, 6, 8.9
	E.set_entity_position(painting49, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting49, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting49, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting49, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting49, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting50)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting50].pos_x, painting_positions[painting50].pos_y, painting_positions[painting50].pos_z = thickness / 2, 6, 3.5
	E.set_entity_position(painting50, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting50, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting50, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting50, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting50, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting51)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting51].pos_x, painting_positions[painting51].pos_y, painting_positions[painting51].pos_z = 2.3, 6, thickness / 2
	E.set_entity_position(painting51, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting51, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting51, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting51, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting51, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting52)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting52].pos_x, painting_positions[painting52].pos_y, painting_positions[painting52].pos_z = 2.3, 3.5, thickness / 2
	E.set_entity_position(painting52, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting52, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting52, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting52, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting52, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting53)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting53].pos_x, painting_positions[painting53].pos_y, painting_positions[painting53].pos_z = 9.2, 6, thickness / 2
	E.set_entity_position(painting53, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting53, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting53, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting53, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting53, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting54)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting54].pos_x, painting_positions[painting54].pos_y, painting_positions[painting54].pos_z = 15, 6, thickness / 2
	E.set_entity_position(painting54, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting54, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting54, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting54, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting54, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting55)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting55].pos_x, painting_positions[painting55].pos_y, painting_positions[painting55].pos_z = 18, 6, thickness / 2
	E.set_entity_position(painting55, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting55, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting55, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting55, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting55, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting56)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting56].pos_x, painting_positions[painting56].pos_y, painting_positions[painting56].pos_z = 16.5, 3, thickness / 2
	E.set_entity_position(painting56, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting56, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting56, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting56, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting56, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting57)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting57].pos_x, painting_positions[painting57].pos_y, painting_positions[painting57].pos_z = 19.75 - thickness / 2, 6, 17.7
	E.set_entity_position(painting57, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting57, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting57, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting57, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting57, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting58)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting58].pos_x, painting_positions[painting58].pos_y, painting_positions[painting58].pos_z = 19.75 - thickness / 2, 6, 26.1
	E.set_entity_position(painting58, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting58, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting58, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting58, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting58, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting59)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting59].pos_x, painting_positions[painting59].pos_y, painting_positions[painting59].pos_z = 19.75 - thickness / 2, 9.5, 33
	E.set_entity_position(painting59, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting59, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting59, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting59, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting59, E.geom_attr_response, category_none)
	
	min_x, min_y, min_z, max_x, max_y, max_z = E.get_entity_bound(painting60)
    w, h, thickness = max_x - min_x, max_y - min_y, max_z - min_z
	painting_positions[painting60].pos_x, painting_positions[painting60].pos_y, painting_positions[painting60].pos_z = 19.75 - thickness / 2, 4, 35.4
	E.set_entity_position(painting60, pos_in_frustum_x, pos_in_frustum_y, pos_in_frustum_z)
	E.set_entity_geom_type(painting60, E.geom_type_box, w, h, thickness)
	E.set_entity_geom_attr(painting60, E.geom_attr_category, category_painting)
	E.set_entity_geom_attr(painting60, E.geom_attr_collider, category_player + category_picker)
	E.set_entity_geom_attr(painting60, E.geom_attr_response, category_none)

 	-- bind shaders

		spot_dir_y = -0.75
		
		-- medieval room
		local MedSpotLight1 = create_spot_light(vec3(20 - spot_d_from_wall,spot_height,50), vec3(1, spot_dir_y, 0), -90)
		local MedSpotLight2 = create_spot_light(vec3(20 - spot_d_from_wall,spot_height,60), vec3(1, spot_dir_y, 0), -90)
		local MedSpotLight3 = create_spot_light(vec3(10,spot_height,80 - spot_d_from_wall), vec3(0, spot_dir_y, 1), 180)
		local MedSpotLight4 = create_spot_light(vec3(spot_d_from_wall,spot_height,70), vec3(-1, spot_dir_y, 0.25), 90 + 14.036243, -14.036243)
		local MedSpotLight5 = create_spot_light(vec3(spot_d_from_wall,spot_height,60), vec3(-1, spot_dir_y, 0), 90)
		local MedSpotLight6 = create_spot_light(vec3(spot_d_from_wall,spot_height,50), vec3(-1, spot_dir_y, -0.14), 90 - 7.9696103, 7.9696103)
		
		local MedEastSpotShader = create_spot_shader(MedEast, wall, E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local MedFloorEastSpotShader = create_spot_shader(MedFloorEast)
		local MedFloorSouthSpotShader = create_spot_shader(MedFloorSouth)
		local MedFloorWestSpotShader = create_spot_shader(MedFloorWest)
		local MedNorthSpotShader = create_spot_shader(MedNorth, wall, E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local MedSouthSpotShader = create_spot_shader(MedSouth, wall, E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local MedWestSpotShader = create_spot_shader(MedWest, wall, E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local EntryWayMedRenSpotShader = create_spot_shader(EntryWayMedRen)
		
		local MedCeilingNorthPointShader = create_point_shader(MedCeilingNorth)
		local MedCeilingSouthPointShader = create_point_shader(MedCeilingSouth)
		

		add_spot_light(MedEastSpotShader, MedSpotLight1)
		add_spot_light(MedEastSpotShader, MedSpotLight2)
		add_spot_light(MedFloorEastSpotShader, MedSpotLight1)
		add_spot_light(MedFloorEastSpotShader, MedSpotLight2)
		
		add_spot_light(MedSouthSpotShader, MedSpotLight3)
		add_spot_light(MedSouthSpotShader, MedSpotLight4)
		add_spot_light(MedFloorSouthSpotShader, MedSpotLight3)
		add_spot_light(MedFloorSouthSpotShader, MedSpotLight4)
		
		add_spot_light(MedWestSpotShader, MedSpotLight4)
		add_spot_light(MedWestSpotShader, MedSpotLight5)
		add_spot_light(MedWestSpotShader, MedSpotLight6)
		add_spot_light(MedFloorWestSpotShader, MedSpotLight4)
		add_spot_light(MedFloorWestSpotShader, MedSpotLight5)
		add_spot_light(MedFloorWestSpotShader, MedSpotLight6)
		
		add_spot_light(MedNorthSpotShader, MedSpotLight6)
		
		add_point_light(MedCeilingNorthPointShader, MedSpotLight1)
		add_point_light(MedCeilingNorthPointShader, MedSpotLight2)
		--add_point_light(MedCeilingNorthPointShader, MedSpotLight3)
		add_point_light(MedCeilingNorthPointShader, MedSpotLight5)
		add_point_light(MedCeilingNorthPointShader, MedSpotLight6)
		
		--add_point_light(MedCeilingSouthPointShader, MedSpotLight2)
		add_point_light(MedCeilingSouthPointShader, MedSpotLight3)
		add_point_light(MedCeilingSouthPointShader, MedSpotLight4)
		add_point_light(MedCeilingSouthPointShader, MedSpotLight5)
		--add_point_light(MedCeilingSouthPointShader, MedSpotLight6)
        
        --local MedPainting15Shader = create_spot_shader(painting15)
        local MedPainting16Shader = create_spot_shader(painting16)
        local MedPainting17Shader = create_spot_shader(painting17)
        local MedPainting18Shader = create_spot_shader(painting18)
        local MedPainting19Shader = create_spot_shader(painting19)
        local MedPainting20Shader = create_spot_shader(painting20)
        local MedPainting21Shader = create_spot_shader(painting21)
        local MedPainting22Shader = create_spot_shader(painting22)
        local MedPainting23Shader = create_spot_shader(painting23)
        local MedPainting24Shader = create_spot_shader(painting24)
        local MedPainting25Shader = create_spot_shader(painting25)
        local MedPainting26Shader = create_spot_shader(painting26)
        local MedPainting27Shader = create_spot_shader(painting27)
        local MedPainting28Shader = create_spot_shader(painting28)
        local MedPainting29Shader = create_spot_shader(painting29)
        
       -- local test_spot = create_spot_light(vec3(0,0,2), vec3(0, 0, -1), 90)
		--add_spot_light(MedPainting15Shader, MedSpotLight1)
		add_spot_light(MedPainting16Shader, MedSpotLight1, 270)
		add_spot_light(MedPainting17Shader, MedSpotLight1, 270)
		add_spot_light(MedPainting18Shader, MedSpotLight1, 270)
		--add_spot_light(MedPainting19Shader, MedSpotLight1, 270)
		
		add_spot_light(MedPainting17Shader, MedSpotLight2, 270)
		add_spot_light(MedPainting18Shader, MedSpotLight2, 270)
		add_spot_light(MedPainting19Shader, MedSpotLight2, 270)
		add_spot_light(MedPainting20Shader, MedSpotLight2, 270)
		
		add_spot_light(MedPainting21Shader, MedSpotLight3, 180)
        add_spot_light(MedPainting22Shader, MedSpotLight3, 180)
        add_spot_light(MedPainting23Shader, MedSpotLight3, 180)
		
        add_spot_light(MedPainting24Shader, MedSpotLight4, 90)
        --add_spot_light(MedPainting25Shader, MedSpotLight4, 90)

        add_spot_light(MedPainting24Shader, MedSpotLight5, 90)
        add_spot_light(MedPainting25Shader, MedSpotLight5, 90)
        add_spot_light(MedPainting26Shader, MedSpotLight5, 90)
        add_spot_light(MedPainting27Shader, MedSpotLight5, 90)
        
        --add_spot_light(MedPainting26Shader, MedSpotLight6, 90)
        add_spot_light(MedPainting27Shader, MedSpotLight6, 90)
        add_spot_light(MedPainting28Shader, MedSpotLight6, 90)
        add_spot_light(MedPainting29Shader, MedSpotLight6, 90)

		--ren room
		local RenSpotLight1 = create_spot_light(vec3(20 - spot_d_from_wall,spot_height,20), vec3(1, spot_dir_y, 0.22), -90 - 12.40741, 12.40741)
		local RenSpotLight2 = create_spot_light(vec3(20 - spot_d_from_wall,spot_height,30), vec3(1, spot_dir_y, 0.25), -90 - 14.036243, 14.036243)
		local RenSpotLight3 = create_spot_light(vec3(spot_d_from_wall,spot_height,30), vec3(-1, spot_dir_y, 0.15), 90 + 8.53067561, -8.53067561)
		local RenSpotLight4 = create_spot_light(vec3(spot_d_from_wall,spot_height,20), vec3(-1, spot_dir_y, -0.11), 90 - 6.2772984896, 6.2772984896)
		local RenSpotLight5 = create_spot_light(vec3(spot_d_from_wall,spot_height,10), vec3(-1, spot_dir_y, -0.22), 90 - 12.40741, 12.40741)
		local RenSpotLight6 = create_spot_light(vec3(9,spot_height,spot_d_from_wall), vec3(-0.24, spot_dir_y, -1), 15.495733, -15.495733)
		local RenSpotLight7 = create_spot_light(vec3(11,spot_height,spot_d_from_wall), vec3(0.22, spot_dir_y, -1), -12.40741, 12.40741)
		
		local RenEastSpotShader = create_spot_shader(RenEast, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		--local RenFloorNorthSpotShader = create_spot_shader(RenFloorNorth)
		local RenFloorNorthWestSpotShader = create_spot_shader(RenFloorNorthWest)
		local RenFloorEastSpotShader = create_spot_shader(RenFloorEast)
		--local RenFloorWestSpotShader = create_spot_shader(RenFloorWest)
		local RenFloorSouthWestSpotShader = create_spot_shader(RenFloorSouthWest)
		--local RenWestSpotShader = create_spot_shader(RenWest)
		local RenWestNorthSpotShader = create_spot_shader(RenWestNorth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local RenWestSouthSpotShader = create_spot_shader(RenWestSouth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local RenNorthSpotShader = create_spot_shader(RenNorth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local RenSouthSpotShader = create_spot_shader(RenSouth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		local EntryWayRen19thCenSpotShader = create_spot_shader(EntryWayRen19thCen)
		
		--local RenCeilingPointShader = create_point_shader(RenCeiling)
		local RenCeilingNorthPointShader = create_point_shader(RenCeilingNorth)
		local RenCeilingSouthPointShader = create_point_shader(RenCeilingSouth)

		add_spot_light(RenEastSpotShader, RenSpotLight1)
		add_spot_light(RenEastSpotShader, RenSpotLight2)
		add_spot_light(RenEastSpotShader, RenSpotLight7)
		add_spot_light(RenFloorEastSpotShader, RenSpotLight1)
		add_spot_light(RenFloorEastSpotShader, RenSpotLight2)
		
		add_spot_light(RenSouthSpotShader, RenSpotLight2)
		add_spot_light(RenSouthSpotShader, RenSpotLight3)
		
		add_spot_light(RenWestSouthSpotShader, RenSpotLight3)
		add_spot_light(RenWestSouthSpotShader, RenSpotLight4)
		add_spot_light(RenWestNorthSpotShader, RenSpotLight4)
		add_spot_light(RenWestNorthSpotShader, RenSpotLight5)
		add_spot_light(RenWestNorthSpotShader, RenSpotLight6)
		add_spot_light(RenFloorSouthWestSpotShader, RenSpotLight3)
		add_spot_light(RenFloorSouthWestSpotShader, RenSpotLight4)
		add_spot_light(RenFloorSouthWestSpotShader, RenSpotLight5)
		
		add_spot_light(RenNorthSpotShader, RenSpotLight5)
		add_spot_light(RenFloorNorthWestSpotShader, RenSpotLight5)
		add_spot_light(RenNorthSpotShader, RenSpotLight6)
		add_spot_light(RenFloorNorthWestSpotShader, RenSpotLight6)
		add_spot_light(RenNorthSpotShader, RenSpotLight7)
		add_spot_light(RenFloorNorthWestSpotShader, RenSpotLight7)
		
		add_point_light(RenCeilingNorthPointShader, RenSpotLight1)
		add_point_light(RenCeilingNorthPointShader, RenSpotLight4)
		add_point_light(RenCeilingNorthPointShader, RenSpotLight5)
		add_point_light(RenCeilingNorthPointShader, RenSpotLight6)
		add_point_light(RenCeilingNorthPointShader, RenSpotLight7)
		
		add_point_light(RenCeilingSouthPointShader, RenSpotLight1)
		add_point_light(RenCeilingSouthPointShader, RenSpotLight2)
		add_point_light(RenCeilingSouthPointShader, RenSpotLight3)
		add_point_light(RenCeilingSouthPointShader, RenSpotLight4)
        
        local RenPainting44Shader = create_spot_shader(painting44)
        local RenPainting45Shader = create_spot_shader(painting45)
        local RenPainting46Shader = create_spot_shader(painting46)
        local RenPainting47Shader = create_spot_shader(painting47)
        local RenPainting48Shader = create_spot_shader(painting48)
        local RenPainting49Shader = create_spot_shader(painting49)
        local RenPainting50Shader = create_spot_shader(painting50)
        local RenPainting51Shader = create_spot_shader(painting51) 
        local RenPainting52Shader = create_spot_shader(painting52)
        local RenPainting53Shader = create_spot_shader(painting53)
        local RenPainting54Shader = create_spot_shader(painting54)
        RenPainting55Shader = create_spot_shader(painting55)
        RenPainting56Shader = create_spot_shader(painting56)
        RenPainting57Shader = create_spot_shader(painting57)
        RenPainting58Shader = create_spot_shader(painting58) -- only 200 local variables allowed?
        RenPainting59Shader = create_spot_shader(painting59)
        RenPainting60Shader = create_spot_shader(painting60)
        
		add_spot_light(RenPainting57Shader, RenSpotLight1, 270)
		add_spot_light(RenPainting58Shader, RenSpotLight1, 270)
		
		add_spot_light(RenPainting58Shader, RenSpotLight2, 270)
		add_spot_light(RenPainting59Shader, RenSpotLight2, 270)
		add_spot_light(RenPainting60Shader, RenSpotLight2, 270)
		
		add_spot_light(RenPainting44Shader, RenSpotLight3, 90)
        add_spot_light(RenPainting45Shader, RenSpotLight3, 90)
        add_spot_light(RenPainting46Shader, RenSpotLight3, 90)
        add_spot_light(RenPainting47Shader, RenSpotLight3, 90)
		
        --add_spot_light(RenPainting46Shader, RenSpotLight4, 90)
        add_spot_light(RenPainting47Shader, RenSpotLight4, 90)
        add_spot_light(RenPainting48Shader, RenSpotLight4, 90)

        --add_spot_light(RenPainting47Shader, RenSpotLight5, 90)
        add_spot_light(RenPainting48Shader, RenSpotLight5, 90)
        add_spot_light(RenPainting49Shader, RenSpotLight5, 90)
        add_spot_light(RenPainting50Shader, RenSpotLight5, 90)
        --add_spot_light(RenPainting51Shader, RenSpotLight5, 0)
        add_spot_light(RenPainting52Shader, RenSpotLight5, 0)
        
        add_spot_light(RenPainting49Shader, RenSpotLight6, 90)
        add_spot_light(RenPainting51Shader, RenSpotLight6, 0)
        add_spot_light(RenPainting52Shader, RenSpotLight6, 0)
        add_spot_light(RenPainting53Shader, RenSpotLight6, 0)
        --add_spot_light(RenPainting54Shader, RenSpotLight6, 0)
        --add_spot_light(RenPainting55Shader, RenSpotLight6, 0)
        --add_spot_light(RenPainting56Shader, RenSpotLight6, 0)
        
        add_spot_light(RenPainting53Shader, RenSpotLight7, 0)
        add_spot_light(RenPainting54Shader, RenSpotLight7, 0)
        add_spot_light(RenPainting55Shader, RenSpotLight7, 0)
        add_spot_light(RenPainting56Shader, RenSpotLight7, 0)
        
        		
		CenSpotLight1 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,10), vec3(1, spot_dir_y, 0), -90)
		CenSpotLight2 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,20), vec3(1, spot_dir_y, 0), -90)
		--CenSpotLight3 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,30), vec3(1, spot_dir_y, 0), -90)
		CenSpotLight3 = create_spot_light(vec3(40,spot_height,30 - spot_d_from_wall), vec3(0, spot_dir_y, 1), 180)
		CenSpotLight4 = create_spot_light(vec3(30,spot_height,30 - spot_d_from_wall), vec3(0, spot_dir_y, 1), 180)
		CenSpotLight5 = create_spot_light(vec3(20 + spot_d_from_wall,spot_height,20), vec3(-1, spot_dir_y, 0.25), 90 + 14.036243, -14.036243)
		CenSpotLight6 = create_spot_light(vec3(30,spot_height,spot_d_from_wall), vec3(-0.14, spot_dir_y, -1), 7.9696103, -7.9696103)
		CenSpotLight7 = create_spot_light(vec3(40,spot_height,spot_d_from_wall), vec3(-0.15, spot_dir_y, -1), 8.53067561, -8.53067561)
		CenSpotLight8 = create_spot_light(vec3(50,spot_height,spot_d_from_wall), vec3(-0.22, spot_dir_y, -1), 12.40741, -12.40741)
		CenSpotLight9 = create_spot_light(vec3(60,spot_height,spot_d_from_wall), vec3(-0.11, spot_dir_y, -1), 6.2772984896, -6.2772984896)
		CenSpotLight10 = create_spot_light(vec3(70,spot_height,spot_d_from_wall), vec3(0.11, spot_dir_y, -1), -6.2772984896, 6.2772984896)
		
		CenEastSpotShader = create_spot_shader(CenEast, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		CenSouthSpotShader = create_spot_shader(CenSouth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		CenWestSpotShader = create_spot_shader(CenWest, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		CenNorthWestSpotShader = create_spot_shader(CenNorthWest, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		CenNorthEastSpotShader = create_spot_shader(CenNorthEast, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		EntryWayCenModSpotShader = create_spot_shader(EntryWayCenMod)
		EntryWayCenGuardSpotShader = create_spot_shader(EntryWayCenGuard)
		--add_normal_map(CenNorthEastSpotShader, E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		CenFloorSouthSpotShader = create_spot_shader(CenFloorSouth)
		CenFloorNorthWestSpotShader = create_spot_shader(CenFloorNorthWest)
		CenFloorNorthEastSpotShader = create_spot_shader(CenFloorNorthEast)
		CenFloorEastSpotShader = create_spot_shader(CenFloorEast)
		CenFloorWestSpotShader = create_spot_shader(CenFloorWest)
		
		--CenCeilingPointShader = create_point_shader(CenCeiling)
		CenCeilingWestPointShader = create_point_shader(CenCeilingWest)
		CenCeilingMiddlePointShader = create_point_shader(CenCeilingMiddle)
		CenCeilingEastPointShader = create_point_shader(CenCeilingEast)

		add_spot_light(CenEastSpotShader, CenSpotLight1)
		add_spot_light(CenEastSpotShader, CenSpotLight2)
		add_spot_light(CenFloorEastSpotShader, CenSpotLight1)
		add_spot_light(CenFloorEastSpotShader, CenSpotLight2)
		
		add_spot_light(CenSouthSpotShader, CenSpotLight3)
		add_spot_light(CenSouthSpotShader, CenSpotLight4)
		add_spot_light(CenSouthSpotShader, CenSpotLight5)
		add_spot_light(CenWestSpotShader, CenSpotLight5)
		add_spot_light(CenWestSpotShader, CenSpotLight6)
		add_spot_light(CenFloorSouthSpotShader, CenSpotLight3)
		add_spot_light(CenFloorSouthSpotShader, CenSpotLight4)
		--add_spot_light(CenFloorSouthSpotShader, CenSpotLight5)
		
		add_spot_light(CenFloorWestSpotShader, CenSpotLight4)
		add_spot_light(CenFloorWestSpotShader, CenSpotLight5)
		add_spot_light(CenFloorWestSpotShader, CenSpotLight6)
		
		add_spot_light(CenNorthWestSpotShader, CenSpotLight6)
		add_spot_light(CenNorthWestSpotShader, CenSpotLight7)
		add_spot_light(CenNorthWestSpotShader, CenSpotLight8)
		add_spot_light(CenFloorNorthWestSpotShader, CenSpotLight6)
		add_spot_light(CenFloorNorthWestSpotShader, CenSpotLight7)
		add_spot_light(CenFloorNorthWestSpotShader, CenSpotLight8)
		
		add_spot_light(CenNorthEastSpotShader, CenSpotLight8)
		add_spot_light(CenNorthEastSpotShader, CenSpotLight9)
		add_spot_light(CenNorthEastSpotShader, CenSpotLight10)
		add_spot_light(CenFloorNorthEastSpotShader, CenSpotLight8)
		add_spot_light(CenFloorNorthEastSpotShader, CenSpotLight9)
		add_spot_light(CenFloorNorthEastSpotShader, CenSpotLight10)
		
		add_spot_light(CenFloorEastSpotShader, CenSpotLight10)
		add_spot_light(CenEastSpotShader, CenSpotLight10)

		add_point_light(CenCeilingWestPointShader, CenSpotLight3)
		add_point_light(CenCeilingWestPointShader, CenSpotLight4)
		add_point_light(CenCeilingWestPointShader, CenSpotLight5)
		add_point_light(CenCeilingWestPointShader, CenSpotLight6)
		add_point_light(CenCeilingWestPointShader, CenSpotLight7)
		
		add_point_light(CenCeilingMiddlePointShader, CenSpotLight3)
		add_point_light(CenCeilingMiddlePointShader, CenSpotLight7)
		add_point_light(CenCeilingMiddlePointShader, CenSpotLight8)
		add_point_light(CenCeilingMiddlePointShader, CenSpotLight9)
		
		add_point_light(CenCeilingEastPointShader, CenSpotLight9)
		add_point_light(CenCeilingEastPointShader, CenSpotLight10)
		add_point_light(CenCeilingEastPointShader, CenSpotLight1)
		add_point_light(CenCeilingEastPointShader, CenSpotLight2)
        
        --CenSpotLight1ObjShader = create_point_shader(CenSpotLight1Obj)
        
        CenPainting1Shader = create_spot_shader(painting1)
        CenPainting2Shader = create_spot_shader(painting2)
        CenPainting3Shader = create_spot_shader(painting3)
        CenPainting4Shader = create_spot_shader(painting4)
        CenPainting5Shader = create_spot_shader(painting5)
        CenPainting6Shader = create_spot_shader(painting6)
        CenPainting7Shader = create_spot_shader(painting7)
        CenPainting8Shader = create_spot_shader(painting8)
        CenPainting9Shader = create_spot_shader(painting9)
        CenPainting10Shader = create_spot_shader(painting10)
        CenPainting11Shader = create_spot_shader(painting11)
        CenPainting12Shader = create_spot_shader(painting12)
        CenPainting13Shader = create_spot_shader(painting13)
        CenPainting14Shader = create_spot_shader(painting14)
        
		add_spot_light(CenPainting8Shader, CenSpotLight1, 270)
		add_spot_light(CenPainting9Shader, CenSpotLight1, 270)
		
		add_spot_light(CenPainting9Shader, CenSpotLight2, 270)
		add_spot_light(CenPainting11Shader, CenSpotLight2, 270)
		
		add_spot_light(CenPainting10Shader, CenSpotLight3, 180)
		add_spot_light(CenPainting12Shader, CenSpotLight3, 180)
		
        --add_spot_light(CenPainting10Shader, CenSpotLight4, 180)
        add_spot_light(CenPainting12Shader, CenSpotLight4, 180)

        add_spot_light(CenPainting13Shader, CenSpotLight5, 90)
        add_spot_light(CenPainting14Shader, CenSpotLight5, 90)
        
        add_spot_light(CenPainting1Shader, CenSpotLight6, 0)
        add_spot_light(CenPainting2Shader, CenSpotLight6, 0)
        add_spot_light(CenPainting3Shader, CenSpotLight6, 0)
        
        add_spot_light(CenPainting2Shader, CenSpotLight7, 0)
        add_spot_light(CenPainting3Shader, CenSpotLight7, 0)
        add_spot_light(CenPainting4Shader, CenSpotLight7, 0)
        
        add_spot_light(CenPainting3Shader, CenSpotLight8, 0)
        add_spot_light(CenPainting4Shader, CenSpotLight8, 0)
        add_spot_light(CenPainting5Shader, CenSpotLight8, 0)
        
        add_spot_light(CenPainting4Shader, CenSpotLight9, 0)
        add_spot_light(CenPainting5Shader, CenSpotLight9, 0)
        add_spot_light(CenPainting6Shader, CenSpotLight9, 0)
        add_spot_light(CenPainting7Shader, CenSpotLight9, 0)
        
        add_spot_light(CenPainting6Shader, CenSpotLight10, 0)
        add_spot_light(CenPainting7Shader, CenSpotLight10, 0)
        add_spot_light(CenPainting8Shader, CenSpotLight10, 0)
        add_spot_light(CenPainting9Shader, CenSpotLight10, 0)
        
        
        --Modern Room
		ModSpotLight1 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,40), vec3(1, spot_dir_y, 0), -90)
		ModSpotLight2 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,50), vec3(1, spot_dir_y, 0), -90)
		ModSpotLight3 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,60), vec3(1, spot_dir_y, 0), -90)
		ModSpotLight4 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,70), vec3(1, spot_dir_y, 0), -90)
		--ModSpotLight3 = create_spot_light(vec3(80 - spot_d_from_wall,spot_height,30), vec3(1, spot_dir_y, 0), -90)
		ModSpotLight5 = create_spot_light(vec3(70,spot_height,80 - spot_d_from_wall), vec3(0, spot_dir_y, 1), 180)
		ModSpotLight6 = create_spot_light(vec3(60 + spot_d_from_wall,spot_height,70), vec3(-1, spot_dir_y, 0), 90)
		ModSpotLight7 = create_spot_light(vec3(60 + spot_d_from_wall,spot_height,60), vec3(-1, spot_dir_y, 0), 90)
		ModSpotLight8 = create_spot_light(vec3(60 + spot_d_from_wall,spot_height,50), vec3(-1, spot_dir_y, 0), 90)
		ModSpotLight9 = create_spot_light(vec3(60 + spot_d_from_wall,spot_height,40), vec3(-1, spot_dir_y, 0), 90)
		
		ModEastSouthSpotShader = create_spot_shader(ModEastSouth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		ModEastNorthSpotShader = create_spot_shader(ModEastNorth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		ModSouthSpotShader = create_spot_shader(ModSouth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		ModWestSouthSpotShader = create_spot_shader(ModWestSouth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		ModWestNorthSpotShader = create_spot_shader(ModWestNorth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		ModNorthSpotShader = create_spot_shader(ModNorth, wall,  E.create_image(media_dir .. "plaster1normdrkscale2.jpg"))
		ModFloorSouthSpotShader = create_spot_shader(ModFloorSouth)
		ModFloorEastNorthSpotShader = create_spot_shader(ModFloorEastNorth)
		ModFloorEastSouthSpotShader = create_spot_shader(ModFloorEastSouth)
		ModFloorWestNorthSpotShader = create_spot_shader(ModFloorWestNorth)
		ModFloorWestSouthSpotShader = create_spot_shader(ModFloorWestSouth)
		
		--ModCeilingPointShader = create_point_shader(ModCeiling)
		ModCeilingSouthPointShader = create_point_shader(ModCeilingSouth)
		ModCeilingMiddlePointShader = create_point_shader(ModCeilingMiddle)
		ModCeilingNorthPointShader = create_point_shader(ModCeilingNorth)

		add_spot_light(ModEastNorthSpotShader, ModSpotLight1)
		add_spot_light(ModEastNorthSpotShader, ModSpotLight2)
		add_spot_light(ModEastNorthSpotShader, ModSpotLight3)
		add_spot_light(ModFloorEastNorthSpotShader, ModSpotLight1)
		add_spot_light(ModFloorEastNorthSpotShader, ModSpotLight2)
		add_spot_light(ModFloorEastNorthSpotShader, ModSpotLight3)
		
		add_spot_light(ModEastSouthSpotShader, ModSpotLight2)
		add_spot_light(ModEastSouthSpotShader, ModSpotLight3)
		add_spot_light(ModEastSouthSpotShader, ModSpotLight4)
		add_spot_light(ModFloorEastSouthSpotShader, ModSpotLight2)
		add_spot_light(ModFloorEastSouthSpotShader, ModSpotLight3)
		add_spot_light(ModFloorEastSouthSpotShader, ModSpotLight4)
		
		add_spot_light(ModSouthSpotShader, ModSpotLight4)
		add_spot_light(ModSouthSpotShader, ModSpotLight5)
		add_spot_light(ModSouthSpotShader, ModSpotLight6)
		add_spot_light(ModFloorSouthSpotShader, ModSpotLight4)
		add_spot_light(ModFloorSouthSpotShader, ModSpotLight5)
		add_spot_light(ModFloorSouthSpotShader, ModSpotLight6)
		
		add_spot_light(ModWestSouthSpotShader, ModSpotLight6)
		add_spot_light(ModWestSouthSpotShader, ModSpotLight7)
		add_spot_light(ModFloorWestSouthSpotShader, ModSpotLight6)
		add_spot_light(ModFloorWestSouthSpotShader, ModSpotLight7)
		--add_spot_light(ModFloorSouthSpotShader, ModSpotLight5)
		
		add_spot_light(ModWestNorthSpotShader, ModSpotLight8)
		add_spot_light(ModWestNorthSpotShader, ModSpotLight9)
		add_spot_light(ModFloorWestNorthSpotShader, ModSpotLight8)
		add_spot_light(ModFloorWestNorthSpotShader, ModSpotLight9)
		--add_spot_light(ModFloorWestSpotShader, ModSpotLight6)
		
		add_spot_light(ModNorthSpotShader, ModSpotLight9)

		add_point_light(ModCeilingNorthPointShader, ModSpotLight1)
		add_point_light(ModCeilingNorthPointShader, ModSpotLight2)
		add_point_light(ModCeilingNorthPointShader, ModSpotLight8)
		add_point_light(ModCeilingNorthPointShader, ModSpotLight9)
		--add_point_light(ModCeilingNorthPointShader, ModSpotLight7)
		
		add_point_light(ModCeilingMiddlePointShader, ModSpotLight2)
		add_point_light(ModCeilingMiddlePointShader, ModSpotLight3)
		add_point_light(ModCeilingMiddlePointShader, ModSpotLight7)
		add_point_light(ModCeilingMiddlePointShader, ModSpotLight8)
		--add_point_light(ModCeilingMiddlePointShader, ModSpotLight7)
		
		add_point_light(ModCeilingSouthPointShader, ModSpotLight3)
		add_point_light(ModCeilingSouthPointShader, ModSpotLight4)
		add_point_light(ModCeilingSouthPointShader, ModSpotLight5)
		add_point_light(ModCeilingSouthPointShader, ModSpotLight6)
		add_point_light(ModCeilingSouthPointShader, ModSpotLight7)
		--add_point_light(ModCeilingSouthPointShader, ModSpotLight2)
        
        ModPainting30Shader = create_spot_shader(painting30)
        ModPainting31Shader = create_spot_shader(painting31)
        ModPainting32Shader = create_spot_shader(painting32)
        ModPainting33Shader = create_spot_shader(painting33)
        ModPainting34Shader = create_spot_shader(painting34)
        ModPainting35Shader = create_spot_shader(painting35)
        ModPainting36Shader = create_spot_shader(painting36)
        ModPainting37Shader = create_spot_shader(painting37)
        ModPainting38Shader = create_spot_shader(painting38)
        ModPainting39Shader = create_spot_shader(painting39)
        ModPainting40Shader = create_spot_shader(painting40)
        ModPainting41Shader = create_spot_shader(painting41)
        ModPainting42Shader = create_spot_shader(painting42)
        ModPainting43Shader = create_spot_shader(painting43)

        
		add_spot_light(ModPainting30Shader, ModSpotLight1, 270)
		add_spot_light(ModPainting31Shader, ModSpotLight1, 270)
		add_spot_light(ModPainting32Shader, ModSpotLight1, 270)
		
		add_spot_light(ModPainting32Shader, ModSpotLight2, 270)
		add_spot_light(ModPainting33Shader, ModSpotLight2, 270)
		--add_spot_light(ModPainting34Shader, ModSpotLight2, 270)
		
		add_spot_light(ModPainting33Shader, ModSpotLight3, 270)
		add_spot_light(ModPainting34Shader, ModSpotLight3, 270)
		add_spot_light(ModPainting35Shader, ModSpotLight3, 270)
		
		add_spot_light(ModPainting35Shader, ModSpotLight4, 270)
		add_spot_light(ModPainting36Shader, ModSpotLight4, 270)
		
        --add_spot_light(ModPainting10Shader, ModSpotLight4, 180)
        add_spot_light(ModPainting37Shader, ModSpotLight5, 180)
        
        add_spot_light(ModPainting38Shader, ModSpotLight6, 90)
        add_spot_light(ModPainting39Shader, ModSpotLight6, 90)
        add_spot_light(ModPainting40Shader, ModSpotLight6, 90)
        
        add_spot_light(ModPainting40Shader, ModSpotLight7, 90)
        add_spot_light(ModPainting41Shader, ModSpotLight7, 90)
        
        add_spot_light(ModPainting41Shader, ModSpotLight8, 90)
        add_spot_light(ModPainting42Shader, ModSpotLight8, 90)
        
        add_spot_light(ModPainting42Shader, ModSpotLight9, 90)
        add_spot_light(ModPainting43Shader, ModSpotLight9, 90)
	
	-- EntryRoom
	
	-- GiftShop
	
	-- GuardRoom
	
	-- make all colliding things visible for debuggin
	if debug then
			
	   	wall_wireframes = true
		npc_wireframes = true
		painting_wireframes = true
		object_wireframes = true
		
		E.set_entity_flags(floor, E.entity_flag_visible_geom, wall_wireframes)
	
		E.set_entity_flags(north_boundary_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(east_boundary_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(south_boundary_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(west_boundary_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(north_ren_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(north_ren_medieval_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(north_medieval_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(south_giftshop_left_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(south_giftshop_right_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(north_giftshop_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(west_modern_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(west_guard_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(east_19thcen_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(west_entry_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(west_medieval_wall, E.entity_flag_visible_geom, wall_wireframes)
		E.set_entity_flags(west_giftshop_wall, E.entity_flag_visible_geom, wall_wireframes)
	
	        E.set_entity_flags(Wilhelm_Winckelmann, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Lacy_Lane, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Samuel_Harris, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Martha_Stewart, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Abigail_Stewart, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Dillon_White, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Bob_Cassady, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Raquel_Ramirez, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Chin_Li, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Claire_dAvignon, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Giorgio_Venturi, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Shelley_Stevenson, E.entity_flag_visible_geom, npc_wireframes)
	       -- E.set_entity_flags(Obudon_Salameki, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Clem_Bergreen, E.entity_flag_visible_geom, npc_wireframes)
	        E.set_entity_flags(Unknown_Name, E.entity_flag_visible_geom, npc_wireframes)
	        --E.set_entity_flags(Bijo_Patel, E.entity_flag_visible_geom, npc_wireframes)
	        
	        E.set_entity_flags(painting1, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting2, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting3, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting4, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting5, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting6, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting7, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting8, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting9, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting10, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting11, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting12, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting13, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting14, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting15, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting16, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting17, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting18, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting19, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting20, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting21, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting22, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting23, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting24, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting25, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting26, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting27, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting28, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting29, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting30, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting31, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting32, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting33, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting34, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting35, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting36, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting37, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting38, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting39, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting40, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting41, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting42, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting43, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting44, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting45, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting46, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting47, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting48, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting49, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting50, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting51, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting52, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting53, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting54, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting55, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting56, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting57, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting58, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting59, E.entity_flag_visible_geom, painting_wireframes)
	        E.set_entity_flags(painting60, E.entity_flag_visible_geom, painting_wireframes)
    end