Intermact API Reference / @intermact/core / CoordinateTransform3D
Class: CoordinateTransform3D
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:22
Scene coordinate transforms for a 3D scene (design.md §7.2, §10). Mirror of CoordinateTransform2D: maps between absolute world coordinates and normalized domain UVW, plus cylindrical/spherical conversions for the matching coordinate systems. In 3D the math space is the world space, so the camera (not this transform) handles projection.
Constructors
Constructor
new CoordinateTransform3D(
domain?,system?):CoordinateTransform3D
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:26
Parameters
domain?
Domain3D = UNIT_DOMAIN_3D
system?
CoordinateSystem3D = "cartesian"
Returns
CoordinateTransform3D
Properties
domain
readonlydomain:Domain3D
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:24
World-coordinate domain (defaults to the unit cube).
system
readonlysystem:CoordinateSystem3D="cartesian"
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:28
Methods
absToRel()
absToRel(
value):Vec3
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:34
Map absolute world coordinates to normalized domain UVW in [0,1]³.
Parameters
value
Returns
fromCylindrical()
fromCylindrical(
r,theta,z):AbsXYZ
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:63
Absolute point from cylindrical coordinates.
Parameters
r
number
theta
number
z
number
Returns
fromSpherical()
fromSpherical(
r,theta,phi):AbsXYZ
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:81
Absolute point from spherical coordinates.
Parameters
r
number
theta
number
phi
number
Returns
relToAbs()
relToAbs(
value):AbsXYZ
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:44
Map normalized domain UVW back to absolute world coordinates.
Parameters
value
Returns
toCylindrical()
toCylindrical(
value):object
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:54
Cylindrical radius/angle (radians)/height of an absolute point (z is the axis).
Parameters
value
Returns
object
r
readonlyr:number
theta
readonlytheta:number
z
readonlyz:number
toSpherical()
toSpherical(
value):object
Defined in: packages/core/src/layout/coordinate-transform-3d.ts:71
Spherical radius / azimuth theta (around z) / polar phi (from +z) of an absolute point, all in radians.
Parameters
value
Returns
object
phi
readonlyphi:number
r
readonlyr:number
theta
readonlytheta:number