Skip to content

PointEntity

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

PointEntity

PointEntity:Void entity:Int32, target:Int32, roll:Float32=0
Parameter Mode Type Default Description
entity In Int32 required Entity handle.
target In Int32 required Entity to aim at.
roll In Float32 0 Roll angle of the result in degrees. Defaults to 0.

Description

Turns an entity so that its +Z axis points at another entity. Only pitch and yaw change; use roll to set the tilt. This is the quickest way to aim a light, a gun or a camera at something. To aim at a spot instead of an entity, make a pivot there, point at it and free it.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 4, -10
RotateEntity camera, 20, 0, 0
light = CreateLight()
RotateEntity light, 45, 45, 0
target = CreateSphere(12)
PositionEntity target, 2, 0, 3
EntityColor target, 255, 90, 60
For i = 0 To 4
	cone = CreateCone(8)
	PositionEntity cone, i * 2 - 4, 0, -1
	; A cone points along +Y, so tip it onto +Z first by parenting it to a pivot.
	pivot = CreatePivot()
	PositionEntity pivot, i * 2 - 4, 0, -1
	EntityParent cone, pivot
	RotateEntity cone, 90, 0, 0
	PointEntity pivot, target
Next
RenderWorld
Flip
WaitKey

Related Commands

CopyEntity, FreeEntity, HideEntity, MoveEntity, NameEntity, PaintEntity, PositionEntity, RotateEntity

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally