project_3d_to_2d Subroutine

public subroutine project_3d_to_2d(x3d, y3d, z3d, azim, elev, dist, x2d, y2d, depth)

Project 3D coordinates to 2D using orthographic projection.

The optional depth output is the camera-space depth (distance toward the viewer) under the same rotation used for the screen coordinates: larger values are closer to the front. Callers that omit depth are unaffected, so existing behavior is preserved.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: x3d(:)
real(kind=wp), intent(in), contiguous :: y3d(:)
real(kind=wp), intent(in), contiguous :: z3d(:)
real(kind=wp), intent(in) :: azim
real(kind=wp), intent(in) :: elev
real(kind=wp), intent(in) :: dist
real(kind=wp), intent(out) :: x2d(size(x3d))
real(kind=wp), intent(out) :: y2d(size(x3d))
real(kind=wp), intent(out), optional :: depth(size(x3d))