Search the Community
Showing results for tags 'cylinder'.
-
It would seem that when using code that materials are not being loaded for cylinders and cones: function App:Start() --Create a window self.window = Window:Create() self.context = Context:Create(self.window) self.world = World:Create() self.camera = Camera:Create() self.camera:SetRotation(35,0,0) self.camera:Move(0,0,-1.2) local light = DirectionalLight:Create() light:SetRotation(35,35,0) material = Material:Load("Materials/Developer/bluegrid.mat") box = Model:Box() box:SetMaterial(material) box:SetScale(0.1,0.1,0.1) box:SetPosition(0,0.55,-0.8) sphere = Model:Sphere() sphere:SetMaterial(material) sphere:SetScale(0.1,0.1,0.1) sphere:SetPosition(0.15,0.55,-0.8) --materials not loading for Cylinder or Cone cylinder = Model:Cylinder() cylinder:SetMaterial(material) cylinder:SetScale(0.15,0.65,0.15) cylinder:SetPosition(-0.6,0,0) cone = Model:Cone() cone:SetMaterial(material) cone:SetScale(0.15,0.65,0.15) cone:SetPosition(-1,0,0) return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end Time:Update() self.world:Update() self.world:Render() self.context:Sync() return true end
-
Created a script this morning to load a cylinder with an attached script, however the material does not seem to load for the cylinder, or a cone, shaped CSG. Spheres and boxes load without issue. Not really sure why the materials are not loading, but I am hoping someone could clear this up. function Script:Use(entity) local bottle = Model:Cylinder() local material = Material:Load("Materials/Developer/bluegrid.mat") bottle:SetMaterial(material) bottle:SetScale(0.15,0.65,0.15) bottle:SetPosition(-4.4,1.6,1.9) local shape = Shape:Cylinder() bottle:SetShape(shape) bottle:SetMass(1) bottle:SetScript("Scripts/Functions/PickupHealth.lua") end