SetCameraFov

From MaratisWiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Change the camera field of view. Example, Press Up & Down to change the Camera Field of view : Camera = getObject("Camera") -- Scene update function onSceneUpda...")
 
m
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{lua-function|setCameraFov|object, fov}}
 +
 
Change the camera field of view.  
 
Change the camera field of view.  
  
Example, Press Up & Down to change the Camera Field of view :
+
{{lua-function-param|object|object to operate on}}
 +
{{lua-function-param|fov|field of view}}
 +
 
 +
'''Example:''' Press Up & Down to change the Camera Field of view.
  
 
     Camera = getObject("Camera")
 
     Camera = getObject("Camera")
Line 10: Line 15:
 
         if isKeyPressed("UP") then setCameraFov(Camera, cFOV-0.5) end
 
         if isKeyPressed("UP") then setCameraFov(Camera, cFOV-0.5) end
 
     end
 
     end
 +
 +
[[Category:Lua scripting]]
 +
[[Category:Lua function]]
 +
[[Category:Camera]]

Latest revision as of 00:07, 9 February 2014

setCameraFov(object, fov)

Change the camera field of view.

  • object : object to operate on
  • fov : field of view

Example: Press Up & Down to change the Camera Field of view.

   Camera = getObject("Camera")
   -- Scene update
   function onSceneUpdate()
       cFOV = getCameraFov(Camera)
       if isKeyPressed("DOWN") then setCameraFov(Camera, cFOV+0.5) end	 	
       if isKeyPressed("UP") then setCameraFov(Camera, cFOV-0.5) end	 		
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox