Skip to documentation
DocumentationAll documentsEnglish

PMODEL2VIEW(nged)

NAME

pmodel2view - get the perspective-corrected model-to-view matrix

On this page

SYNOPSIS

pmodel2view

DESCRIPTION

The pmodel2view command returns the current perspective-corrected model-to-view transformation matrix as a 16-element space-separated floating-point string.

This matrix combines the standard model-to-view transformation with the perspective projection, making it the complete transform that maps a point from model space into perspective view space in one step. It is a read-only accessor — the matrix is computed and maintained automatically by the view system and cannot be set directly with this command.

This command takes no arguments. Providing any argument returns a usage error.

For the model-to-view matrix without perspective applied, use model2view. For the perspective projection matrix alone, use pmat.

EXAMPLES

Example 1. Retrieve the perspective-corrected model-to-view matrix

mged> pmodel2view

Returns the 16-element perspective-corrected model-to-view matrix. When no perspective is active, this is equivalent to the model2view matrix.

Example 2. Compare with and without perspective

mged> perspective 0 mged> pmodel2view mged> perspective 45 mged> pmodel2view

The first call returns the orthographic model-to-view matrix. After enabling a 45° perspective, the second call returns the same rotation but with perspective distortion applied.

AUTHOR

BRL-CAD Team

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org