This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

ViewMatrix

Updated In 8 Graphic
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.
  • ViewMatrix can be set to a pair of 4×4 matrices , where t is a homogeneous transformation matrix and p is a projection matrix in 3D.
  • The transformation matrix t is applied to the list for each point. The projection matrix p is applied to the resulting vectors from the transformation.
  • If the result is , then the screen coordinates for each point are taken to be given by .
Define a rescaling transform t:
Define an orthographic projection p from the front:
Display a 3D object using the orthographic view:
Define a transform t that rotates an object 45° around and axes, then rescales it:
Define an orthographic projection p from the negative direction:
Display a 3D object using the orthographic view:
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]=
Transformation matrices with different rotation angles around the axis:
Orthographic projections from different sides:
Draw a simple 3D bar chart:
Define a rescaling transform matrix that rescales the bar charts into a unit cube:
Define an orthographic view matrix from the front:
Define an oblique projection matrix with an angle t and a scaling factor s:
Display the projected bar chart:
Define a transformation function with rotations and rescaling:
Define an orthographic projection matrix from the front:
Show the orthographic view with lighting from the front to the center, using ViewMatrix:
The same result can be achieved by using an explicit ViewPoint and transforming 3D objects and lighting:
New in 6 | Last modified in 8