Class KX_Camera -- Blender Game Engine 2.49b



 
   




setViewport

setViewport( left, bottom, right, top)

setViewport allows you to display more than one camera view in the game window at the same time.

Note:
Bottom left corner of the game window is (0,0)
Top right corner of the game window is (game window width, game window height)

left (side)
Type:  integer
bottom (side)
Type:  integer
right (side)
Type:  integer
top (side)
Type:  integer

Sample Code

# Create a rear view mirror

# need to get game window size so...
import Rasterizer

# get current scene
scene = GameLogic.getCurrentScene()

# get  list of objects in scene
objList = scene.objects

# get 2nd camera named "RearView"
viewCam = objList["OBRearView"]

# set the sides of the rear view mirror
left = Rasterizer.getWindowWidth() * 1/4
bottom = Rasterizer.getWindowHeight() * 3/4
right = Rasterizer.getWindowWidth() * 3/4
top = Rasterizer.getWindowHeight() * 95/100

# set picture in picture size
viewCam.setViewport( left, bottom, right, top)

# use rear view mirror
viewCam.useViewport = True

 
Game developers can use the game engine to create casual video games, first and third person shooters, role playing games, racing simulations and more. The game engine can be used to make both 2D games and 3D games.  Beginning game developers will only need basic knowledge of game design and programming to create rich and complex game models with photo realistic textures to add detail to the graphics of the video game.  Today's games need more than good looking low polygon game models.  Use normal maps and photo realistic textures to create high quality game models.