ViewMatrix

ViewMatrix

is an option for Graphics3D and related functions that can be used to specify a pair of explicit homogeneous transformation and projection matrices for 3D coordinates.

Details

  • ViewMatrix can be set to a pair of 4×4 matrices {t,p}, where t is a homogeneous transformation matrix and p is a projection matrix in 3D.
  • The transformation matrix t is applied to the list {x,y,z,1} for each point. The projection matrix p is applied to the resulting vectors from the transformation.
  • If the result is {tx,ty,tz,tw}, then the screen coordinates for each point are taken to be given by {tx,ty}/tw.
  • With the default setting ViewMatrix->Automatic, the matrices {t,p} are found automatically from the settings for options such as ViewPoint, ViewVertical, and ViewAngle.
  • With the setting ViewMatrix->Automatic, explicit forms for the matrix m can be found using AbsoluteOptions[g,ViewMatrix].
  • An explicit setting ViewMatrix->{t,p} overrides settings for ViewVector, ViewPoint, and other view options.

Examples

open allclose all

Basic Examples  (2)

Define a rescaling transform t:

In[1]:=
Click for copyable input
Out[1]=

Define an orthographic projection p from the front:

In[2]:=
Click for copyable input

Display a 3D object using the orthographic view:

In[3]:=
Click for copyable input
Out[3]=

Define a transform t that rotates an object 45° around and axes, then rescales it:

In[1]:=
Click for copyable input
Out[1]=

Define an orthographic projection p from the negative direction:

In[2]:=
Click for copyable input

Display a 3D object using the orthographic view:

In[3]:=
Click for copyable input
Out[3]=

Scope  (2)

Applications  (1)

Properties & Relations  (1)

See Also

TransformationMatrix  ViewVector  ViewPoint  ViewCenter  ViewVertical  ViewAngle  ViewRange  ViewProjection

Introduced in 2007
(6.0)
| Updated in 2010
(8.0)