Back to Syllabus
Chapter 09Creative Silicon - Verified

3D Perspective Projection & Hard Math

Perform 3D coordinate transformations, Euler Yaw/Pitch rotations, and perspective screen division.

This lesson uses the verified core subset and links to a checked-in regression program. Its output is covered by the repository test harness. This does not imply support for features outside the lesson; see known limitations.

What you'll learn

✓Evaluate trigonometric Taylor series (sin, cos)
✓Apply 3D Euler rotation matrices
✓Perform perspective depth division (x, y, z) -> (u, v)
✓Render 3D geometry onto 2D screens

High-Dimensional Silicon Geometry

Rotate and project 3D vertices using high-precision hardware trigonometry in std/math.aayu.

aayu
import "std/math.aayu"
import "std/media.aayu"

let yaw = 0.785398   # 45 deg
let pitch = 0.349065 # 20 deg
let pt = project_3d_to_2d(2.0, 1.5, -1.0, yaw, pitch, 250.0, 800.0, 600.0)
print("Screen U: " + pt["u"])
print("Screen V: " + pt["v"])
print("Depth:    " + pt["depth"])

Expected coordinates: U around 485.3 px, V around 347.1 px.

Try It Yourself! 🚀

Set yaw and pitch to 0.0. Calculate the on-axis perspective projection coordinates and verify with the live VM.