Mathematica > Visualization and Graphics > Graphics Options & Styling > 3D Graphics Options >

VertexNormals

VertexNormals
is an option for graphics primitives which specifies the normal directions to assign to 3D vertices.
  • VertexNormals->{n1, n2, ...} specifies that vertex i should have effective normal ni for purposes of shading by simulated lighting.
  • The ni are vectors of the form {vx, vy, vz}. Only the directions of these vectors ever matter; the vectors are in effect automatically normalized to unit length.
  • VertexNormals->None specifies that no explicit vertex normals are being given, and normal directions should be deduced from the actual coordinates specified for vertices. For point and line-like primitives, no shading based on simulated lighting should be done.
Compute normal vectors using the cross product of edge vectors:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
A triangle with normals pointing in the direction {1,-1,1}:
In[3]:=
Click for copyable input
Out[3]=
Using different normals will affect shading:
In[4]:=
Click for copyable input
Out[4]=
Specify vertex normals for 3D lines:
In[5]:=
Click for copyable input
Out[5]=
Specify vertex normals for 3D points:
In[6]:=
Click for copyable input
Out[6]=
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team