The code consists of a coordinate space conversion utility and a simple test program. The utility converts an array of points in 3D axes coordinates to an array of points in window or screen coordinates along with depth values, where depth is distance from the camera position. In the case of orthographic projection, the transformation is affine and can be represented by a matrix (using homogeneous coordinates). The matrix is an optional output whose inverse maps a pair of screen coordinates, along with a depth, to a point in axes coordinates. This capability can be used to design a space curve by dragging control points in a projection plane: http://www.cse.unt.edu/~renka/tspack/tspack.html.
Extensive comments in the code describe part of the MATLAB graphics processing pipeline in more detail than is available anywhere else.
View the winning live scripts from faculty and students who participated in the recent challenge.Learn more
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.