SpEcIeS Posted March 21, 2016 Share Posted March 21, 2016 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 SpEcIeS Link to comment Share on other sites More sharing options...
shadmar Posted March 21, 2016 Share Posted March 21, 2016 Does setting it recursivly work? SetMaterial(material,true) HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
macklebee Posted March 21, 2016 Share Posted March 21, 2016 Does setting it recursivly work? Nope - makes no difference. It appears like there is something wrong with the UV's as there is a hint of blue on the cone/cylinder. If you loaded the orangegrid.mat, you would see a hint of orange. 1 Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted April 10, 2016 Share Posted April 10, 2016 It looks like the code for generating these primitives does not create texture coordinates. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Wchris Posted June 9, 2016 Share Posted June 9, 2016 It looks like the code for generating these primitives does not create texture coordinates. Bump Will this be fixed in current beta ? I have the same problem in C++ but not only cone & cylinder, texturing a box also fails. in fact I can't get setmaterial to work at all. I can load a textured object, but not change the texture with setmaterial. original topic here http://www.leadwerks.com/werkspace/topic/14358-cylinder-and-materials/ PS: if I use material = Material::create(); material->Load('Materials\Developer\bluegrid.mat'); material->SetColor(1,0,0); model->SetMaterial(material); the model is displayed in red, but the texture is not visible PS2 : I think this is why people create model duplicates with different textures (http://www.leadwerks.com/werkspace/topic/14572-physics-bug-when-creating-items/) to achieve what SetMaterial can't ... They try to workaround the issue Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Josh Posted June 9, 2016 Share Posted June 9, 2016 AFAIK boxes work fine. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted June 10, 2016 Share Posted June 10, 2016 I added texcoords to those two primitives. 2 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts