Class KX_Camera -- Blender Game Engine 2.49b



 
   







boxInsideFrusturm

boxInsideFrusturm(box)

Tests the given box against the view frustum

Note:
box is an array of box's corner positions.  Uses world coordinates.

Returns:  INSIDE, OUTSIDE or INTERSECT

box:
Type:  a matrix (float values)

Sample Code

# get the current scene
scene = GameLogic.getCurrentScene()

# get the active camera
cam = scene.active_camera

################ Box to test

# create an empty array
box = [ ]

# enter the position of the corner vertices (world coordinates)
box.append([ -1.0, -1.0, -1.0])
box.append([ -1.0, -1.0,  1.0])
box.append([ -1.0,  1.0, -1.0])
box.append([ -1.0,  1.0,  1.0])
box.append([  1.0, -1.0, -1.0])
box.append([  1.0, -1.0,  1.0])
box.append([  1.0,  1.0, -1.0])
box.append([  1.0,  1.0,  1.0])

# camera inside box?
if cam.boxInsideFrustum(box) != cam.OUTSIDE:
# box is inside
# your code here
else:
# box is outside
# your code here

 
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.