Model

self:to_local

Shared

Converts a world-space point into the model's local coordinate space

Syntax

local local_point = self:to_local(
    global_point
)

Parameters

TypeNameDescription
vector3global_pointWorld-space point to convert as {x, y, z}

Returns

TypeNameDescription
vector3local_pointConverted point in local space as {x, y, z}

Examples

Convert a point to local space
core.model.load("character", "models/character.glb")

local entity = core.model.create("character")

core.engine.print("info", entity:to_local({0, 0, 0}))

On this page