Skip to content

CreateCamera

Narta Xaymar Dirks edited this page Oct 28, 2026 · 6 revisions
Blitz3D

CreateCamera

CreateCamera:Int32 parent:Int32=0
Parameter Mode Type Default Description
parent In Int32 0 Entity the camera follows, or 0 for none. Defaults to 0.

Returns: The handle of the new camera.

Description

Creates a camera and returns its handle. A camera is an entity, so it moves, turns and parents like any other, and every camera in the world draws its view when RenderWorld runs. Without a camera the world renders nothing.

A new camera sits at the origin, looks down the positive Z axis, covers the whole graphics buffer, clears the buffer to black and sees from 1 to 1000 units away. With a parent the camera follows that entity, but moving the camera never moves the parent.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 1, -6
RotateEntity camera, 10, 0, 0
light = CreateLight()
RotateEntity light, 45, 45, 0
cube = CreateCube()
TurnEntity cube, 20, 35, 0
EntityColor cube, 240, 160, 40
RenderWorld
Flip
WaitKey

Media

CreateCamera

Related Commands

CameraClsColor, CameraClsMode, CameraCulling, CameraCullingSource, CameraFogColor, CameraFogMode, CameraFogRange, CameraProject

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally