function ViewportWindow.new(k)local w=setmetatable({},ViewportWindow)w.SurfaceGUI=k w.Camera=Instance.new("\067\097\109\101\114\097",k)w.ViewportFrame=VPF:Clone()w.ViewportFrame.Name="\087\111\114\108\100\070\114\097\109\101"w.ViewportFrame.ZIndex=2 w.ViewportFrame.LightDirection=-game.Lighting:GetSunDirection()w.ViewportFrame.CurrentCamera=w.Camera w.ViewportFrame.Parent=k w.SkyboxFrame=VPF:Clone()w.SkyboxFrame.Name="\083\107\121\098\111\120\070\114\097\109\101"w.SkyboxFrame.ZIndex=1 w.SkyboxFrame.Ambient=Color3.new(1,1,1)w.SkyboxFrame.LightColor=Color3.new(0,0,0)w.SkyboxFrame.CurrentCamera=w.Camera w.SkyboxFrame.Parent=k return w end function ViewportWindow.fromPart(k,w,u)local R=Instance.new("\083\117\114\102\097\099\101\071\117\105")R.Face=w R.CanvasSize=Vector2.new(1024,1024)R.SizingMode=Enum.SurfaceGuiSizingMode.FixedSize R.Adornee=k R.ClipsDescendants=true R.Parent=u return ViewportWindow.new(R)end
-- Contructors

function ViewportWindow.new(surfaceGUI)
	local self = setmetatable({}, ViewportWindow)

	self.SurfaceGUI = surfaceGUI
	self.Camera = Instance.new("Camera", surfaceGUI)
	self.ViewportFrame = VPF:Clone()
	self.ViewportFrame.Name = "WorldFrame"
	self.ViewportFrame.ZIndex = 2
	self.ViewportFrame.LightDirection = -game.Lighting:GetSunDirection()
	self.ViewportFrame.CurrentCamera = self.Camera
	self.ViewportFrame.Parent = surfaceGUI

	self.SkyboxFrame = VPF:Clone()
	self.SkyboxFrame.Name = "SkyboxFrame"
	self.SkyboxFrame.ZIndex = 1
	self.SkyboxFrame.Ambient = Color3.new(1, 1, 1)
	self.SkyboxFrame.LightColor = Color3.new(0, 0, 0)
	self.SkyboxFrame.CurrentCamera = self.Camera
	self.SkyboxFrame.Parent = surfaceGUI

	return self
end

function ViewportWindow.fromPart(part, normalId, parent)
	local surfaceGUI = Instance.new("SurfaceGui")
	surfaceGUI.Face = normalId
	surfaceGUI.CanvasSize = Vector2.new(1024, 1024)
	surfaceGUI.SizingMode = Enum.SurfaceGuiSizingMode.FixedSize
	surfaceGUI.Adornee = part
	surfaceGUI.ClipsDescendants = true
	surfaceGUI.Parent = parent

	return ViewportWindow.new(surfaceGUI)
end
