Lunarovich Posted May 8, 2015 Share Posted May 8, 2015 When I try to change a camera mode to Camera.Ortographic, I get a "error in function 'SetProjectionMode'.; argument #2 is 'nil'; 'number' expected." function Script:UpdateWorld() if (window:KeyHit(Key.Space)) then if (self.entity:GetProjectionMode()==Camera.Orthographic) then self.entity:SetProjectionMode(Camera.Perspective) self.entity:SetZoom(1) else self.entity:SetProjectionMode(Camera.Ortographic) self.entity:SetZoom(1) end end end Quote Link to comment Share on other sites More sharing options...
diedir Posted May 8, 2015 Share Posted May 8, 2015 if (self.entity:GetProjectionMode()==Camera.[b]Ortho[/b]graphic) then self.entity:SetProjectionMode(Camera.Perspective) self.entity:SetZoom(1) else self.entity:SetProjectionMode(Camera.[b]Orto[/b]graphic) i don't know exactly but isn't it the orthographic word that causes trouble ? Quote AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11 Link to comment Share on other sites More sharing options...
Josh Posted May 8, 2015 Share Posted May 8, 2015 This has been added to the Lua header for the next build. The acual value is 2 for orthographic, 1 for perspective, and 0 for no rendering. Use those until the next build goes out. 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...
macklebee Posted May 8, 2015 Share Posted May 8, 2015 http://www.leadwerks.com/werkspace/topic/12548-get-set-projectionmode-example-error/ 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...
Lunarovich Posted May 8, 2015 Author Share Posted May 8, 2015 OK. Thanx. Got it and got it working A side question: does the orthographic camera render drop shadows? Added point lights with shadows in the FOV of camera but nothing seems to happen... Quote Link to comment Share on other sites More sharing options...
Josh Posted May 9, 2015 Share Posted May 9, 2015 I would not expect any shadows to work with othrographic rendering, as it breaks the lighting calculations. Spot and point might, directional definitely will not. 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...
Lunarovich Posted May 9, 2015 Author Share Posted May 9, 2015 Yeah, I understand. It would be nice though to have drop shadows with ortographic rendering. In that way we could mimic in 3D good old isometric RPG-s (Fallout, Arcanum, etc). Those had art made in 3D model editors and code done in 2D engines. I gave an ortographic camera (30, 30, 0) rotation and a FOV clamped to 0.5 - 7.5. Than I've implemented some camera controls - global horizontal xz plane movement and modifyable FOV to mimic zoom - to replicate Fallout 1 camera. It's a real bliss Missing those shadows though... Quote Link to comment Share on other sites More sharing options...
Josh Posted May 9, 2015 Share Posted May 9, 2015 I would just use a camera far away with a high zoom value. It will look about the same as orthographic rendering. 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...
Lunarovich Posted May 9, 2015 Author Share Posted May 9, 2015 Thanks for the tip. Will give it a shot. Quote Link to comment Share on other sites More sharing options...
Lunarovich Posted May 9, 2015 Author Share Posted May 9, 2015 I've just tried to put camera far away with a high zoom value. There are to problems to the solution: Directional light drop shadows are not rendered if the camera is too far away. Is there a way to tell camera to render shadows even if its very far from objects? Vertical lines are not vertical anymore because of the small perspective deformation, so it creates aliased object edges. How do I set higher AA? Thanks! Quote 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.