look_at_origin: Compute rgl rotation matrix to look at the origin from a...

View source: R/rayshader.R

look_at_originR Documentation

Compute rgl rotation matrix to look at the origin from a given position

Description

Builds a 4x4 rotation matrix suitable for 'rgl::view3d(userMatrix = ...)' that orients the scene as if the camera is at 'eye' looking toward the origin with z pointing up.

Usage

look_at_origin(eye)

Arguments

eye

Numeric vector of length 3 (x, y, z) — camera position.

Value

A 4x4 rotation matrix.


ggseg3d documentation built on Feb. 21, 2026, 1:06 a.m.