Skip to content

RenderWorld

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

RenderWorld

RenderWorld:Void tween:Float32=1
Parameter Mode Type Default Description
tween In Float32 1 How far between the captured state (0) and the current state (1) to draw. Defaults to 1.

Description

Draws the whole 3D world into the back buffer, once for every visible camera, inside that camera's viewport. Cameras that are hidden or have a projection mode of 0 are skipped. The 2D drawing commands work on top of the result, so text and shapes drawn after RenderWorld appear in front of the 3D picture. Call Flip afterwards to show the frame.

The optional tween value is for smooth movement when the game logic runs at a lower rate than the screen. First call CaptureWorld to remember where everything is, then move the entities to their new places, then draw with a tween from 0 to 1: 0 shows the captured positions, 1 the current ones, and anything between shows the entities part of the way. The example slides a cube across with 20 frames drawn between two positions of the world.

Differences

  • Entities that are made or hidden after CaptureWorld are drawn where they are, they do not fade in.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
CameraClsColor camera, 70, 100, 160
light = CreateLight()
RotateEntity light, 40, 30, 0

cube = CreateCube()
EntityColor cube, 240, 170, 60
PositionEntity cube, -2.5, 0, 7
RotateEntity cube, 0, 0, 0

; Remember the old state, then jump to the new one.
CaptureWorld
PositionEntity cube, 2.5, 0, 7
RotateEntity cube, 0, 120, 60

; Draw the steps in between.
For i = 0 To 19
	RenderWorld i / 19.0
	Flip
Next

Media

RenderWorld

Related Commands

CaptureWorld, ClearWorld, HWOrderIndependentTransparency, UpdateWorld

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally