CameraViewPort
CameraViewPort CameraIndex, X1, Y1, X2, Y2
 
Parameters:

    CameraIndex = The Index of the Camera that you wish to set
    X1 = The TOP left hand X coordinate of the cameras view port
    Y1 = The TOP left hand Y coordinate of the cameras view port
    X2 = The BOTTOM right hand X coordinate of the cameras view port
    Y2 = The BOTTOM right hand Y coordinate of the cameras view port
Returns: NONE
 

      CameraViewPort sets the rendering boundaries (the size) of a cameras draw area. By default these boundaries will be inherited from the size of the current rendering surface when the camera was created. So if the current render surface was the screen when the camera was created, the cameras viewport size will be 0,0,ScreenWidth,ScreenHeight by default



FACTS:


      * The top left hand coordinate in the cameras view port, relates to the cameras actualy position in world space.

      * Cameras inherit their default viewport settingss from the surface their attached when their created. (the screen or image)



Mini Tutorial:


      This example creates a camera, adjusts it size to a custom view port, activates the Auto CLS an sets it's CLS colour to a bright green colour, before drawing a circle to the scene buffer then finally displaying the camera.


  
; create camera 1.  Which will attach itself to
; the screen
  CreateCamera 1
  
; Set the Cameras View port area to 100x,100x to 200,200
  CameraViewPort 1,100,100,200,200
  
; Activate the camera Auto CLS
  CameraCls 1,on
  
; Set the Cameras Auto CLS colour to Bright green colour
  CameraClsColour 1,RGB(0,255,0)
  
; Direct All gfx to the Scene buffer so the camera
; has something to view.
  CaptureToScene
  
; Draw a white circle the Scene
  Circle 50,50,40,1
  
; Draw the camera and whatever it can see
  DrawCamera 1
  
; Show the user the screen.
  Sync
  
; wait for a key press, before ending
  WaitKey
  



This example would output.

  
  no output
  


 
Related Info: GetCameraViewPortX1 | GetCameraViewPortX2 | GetCameraViewPortY1 | GetCameraViewPortY2 | ImageViewPort | RendertoImage | RenderToScreen | ScreenViewPort :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com