RygtY Posted August 14, 2014 Share Posted August 14, 2014 I'm not sure if this is a bug but the SetMousePosition function that takes in three parameters, the x value, y value, and z value, does not properly set the z value of the mouse position. One can test this using this code snippet. self.window = Window:GetCurrent() self.window:SetMousePosition(50.0,50.0,10.0) System:Print(self.window:GetMousePosition():ToString()) The z value still remains 0.0 Quote Link to comment Share on other sites More sharing options...
Josh Posted August 15, 2014 Share Posted August 15, 2014 The extra parameter is left in for future implementation. Quote 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...
RygtY Posted August 15, 2014 Author Share Posted August 15, 2014 Thanks for clearing it up. I guess I'll have to go with an alternative way to perform zooming. Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 15, 2014 Share Posted August 15, 2014 function App:Start() self.window = Window:Create() self.context = Context:Create(self.window) self.world = World:Create() self.camera = Camera:Create() self.camera:Move(0,0,-3) local light = DirectionalLight:Create() light:SetRotation(35,35,0) self.model = Model:Box() self.model:SetColor(0.0,0.0,1.0) self.prevZ = self.camera:GetPosition(true).z self.posZ = 0 return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end self.model:Turn(0,Time:GetSpeed(),0) local div = 5 self.posZ = Math:Curve(self.prevZ + (self.window:GetMousePosition().z/div), self.posZ, div/Time:GetSpeed()) self.camera:SetPosition(0,0, self.posZ) Time:Update() self.world:Update() self.world:Render() self.context:SetBlendMode(Blend.Alpha) self.context:DrawText("Mouse Wheel Position: "..self.window:GetMousePosition().z, 2, 2) self.context:DrawText(string.format("Camera Z Position: %.2f",self.posZ), 2, 22) self.context:SetBlendMode(Blend.Solid) self.context:Sync() return true end Quote 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...
Haydenmango Posted August 15, 2014 Share Posted August 15, 2014 Or http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/camerasetzoom-r207 ? Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.