Skip to content

TFormPoint

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

TFormPoint

TFormPoint:Void x:Float32, y:Float32, z:Float32, source_entity:Int32, dest_entity:Int32
Parameter Mode Type Default Description
x In Float32 required X of the point in the source space.
y In Float32 required Y of the point in the source space.
z In Float32 required Z of the point in the source space.
source_entity In Int32 required Entity whose space the point is in, or 0 for the world.
dest_entity In Int32 required Entity whose space the result should be in, or 0 for the world.

Description

Converts a point from the coordinate system of one entity to that of another. Every entity has its own space with its origin at the entity's position, and the axes turned and scaled with it. The world is the space of entity 0. The converted point is stored and read back with TFormedX, TFormedY and TFormedZ.

Use it to find where something attached to an entity is in the world, for example the muzzle of a gun, or to turn a world position into one that is relative to a door or an elevator.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()

; A pivot at x=10, turned 90 degrees and twice as big as normal.
ship = CreatePivot()
PositionEntity ship, 10, 0, 0
RotateEntity ship, 0, 90, 0
ScaleEntity ship, 2, 2, 2

; The point one unit in front of the ship, in the world.
TFormPoint 0, 0, 1, ship, 0
Text 8, 8, "World: " + TFormedX() + ", " + TFormedY() + ", " + TFormedZ()

; And the world position 12, 0, 0 as seen from the ship.
TFormPoint 12, 0, 0, 0, ship
Text 8, 24, "Local: " + TFormedX() + ", " + TFormedY() + ", " + TFormedZ()
Flip
WaitKey

Related Commands

TFormedX, TFormedY, TFormedZ, TFormNormal, TFormVector

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally