macklebee Posted July 29, 2018 Share Posted July 29, 2018 Transform Plane's lua example in the documentation causes an error and fails the program due to the transformed plane returning as nil. I assume its related to also the inability to use the Plane functions in lua as there is no way to define a plane. This code: --Create a window window = Window:Create() context = Context:Create(window) world = World:Create() local camera = Camera:Create() camera:Move(0,0,-3) local light = DirectionalLight:Create() light:SetRotation(35,35,0) --Create a model model = Model:Box() model:SetColor(0.0,0.0,1.0) model:SetPosition(3,0,0) while true do if window:Closed() or window:KeyHit(Key.Escape) then return false end Time:Update() world:Update() world:Render() --We're going to transform the plane (1,0,0,0) from global space to the model's local space --Because the model is positioned at (3,0,0) the plane will be at (1,0,0,3) in local space (relative to the model). local p = Transform:Plane(1,0,0,0,nil,model) context:SetBlendMode(Blend.Alpha) context:DrawText(p:ToString(),2,2) context:SetBlendMode(Blend.Solid) context:Sync() end will error with "attempt to call method 'ToString' (a nil value)" implying the tranformed plane was not returned. 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 February 26, 2019 Share Posted February 26, 2019 The function is working fine but the Plane class has some oddities...fixing now. 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