worldToScreen function
Transform a world 3D point through camera view and projection to screen.
Implementation
ScreenPoint worldToScreen(
Point3D worldPoint,
Camera3D camera,
Projection3D projection,
) {
// World → View (camera space)
final viewMatrix = camera.viewMatrix();
final viewPoint = _transformPoint(viewMatrix, worldPoint);
// View → Projection (clip space → screen)
return projection.project(viewPoint);
}