Skip to content

SetCameraViewMatrix

Narta Xaymar Dirks edited this page Nov 25, 2026 · 3 revisions

SetCameraViewMatrix

SetCameraViewMatrix:Void camera:Int32, matrix:FloatMatrix4x3
Parameter Mode Type Default Description
camera In Int32 required Camera handle.
matrix In FloatMatrix4x3 required The view matrix, from the world to the camera.

Description

Lets a camera look at the world through a view matrix of its own, instead of from where the camera entity is. It stays until ResetCameraViewMatrix; moving or turning the camera entity meanwhile does not change the picture. This is a BlitzLLVM extension.

The matrix goes from the world to the camera: 4 columns of 3 numbers, the first three are the axes and the fourth is the move. The camera looks down its +Z, with X to the right and Y up, as a camera entity does. Mirrors in the world, CameraPick, CameraProject and culling use the matrix. The entity itself, and what is attached to it, stays where it is.

It is meant for views that an entity can't have, such as a reflected view for a mirror (which has a scale of -1 along one axis).

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
cube = CreateCube()
PositionEntity cube, 0, 0, 5
; A camera 3 to the left of the origin: the world moves 3 to the right.
Local view:FloatMatrix4x3 = FloatMatrix4x3(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0)
SetCameraViewMatrix camera, view
RenderWorld
Flip

Related Commands

GetCameraViewMatrix, ResetCameraViewMatrix, SetCameraBuffer, SetCameraClipPlane, SetCameraClipPlaneEnabled, SetCameraProjectionMatrix, SetCameraStencil, SetCameraStencilClear

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally