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

GraphicsComplex

GraphicsComplex
represents a graphics complex in which coordinates given as integers i in graphics primitives in data are taken to be .
  • GraphicsComplex effectively replaces integers i that appear as coordinates in data by the corresponding .
  • GraphicsComplex provides a convenient way to build up meshes or simplicial complexes in which vertices of polygons are shared.
  • In GraphicsComplex, data can be any nested list of graphics primitives and directives.
  • The following options can be given:
ContentSelectableAutomaticwhether to allow contents to be selected
VertexColorsAutomaticvertex colors corresponding to each
VertexNormalsAutomaticvertex normals corresponding to each
VertexTextureCoordinatesNonevertex texture coordinates for each
  • Normal substitutes coordinates to give an ordinary list of graphics primitives and directives.
Polygons and lines in 2D:
Polygons and lines in 3D:
Use built-in PolyhedronData:
Polygons and lines in 2D:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
 
Polygons and lines in 3D:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
 
Use built-in PolyhedronData:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]//Short=
In[3]:=
Click for copyable input
Out[3]=
The coordinate data for any primitive can come from a GraphicsComplex:
3D primitives:
Mixing directives and primitives within a GraphicsComplex:
No individual object is selectable; the graphics complex appears as one object:
Allow the individual objects in the graphics complex to be selectable by a single click:
The first click selects the whole complex, and subsequent clicks select individual objects:
Specify colors for each vertex:
Specify vertex colors for 3D polygons:
Define vertices and face indices of a cylindrical model:
Without surface normals, the shading is constant or flat for each polygon face:
With surface normals, the shading is interpolated or smooth across each polygon face:
Texture mapping with 2D polygons:
Texture mapping with 3D polygons:
Most surface and region plots produce GraphicsComplex:
You can use GraphicsComplex to transform the coordinates in this simple rotation:
The same idea applies to 3D surfaces:
Set up a graphics complex with shared coordinates:
Applying Normal will split a complex into primitives with duplicated coordinates:
Both forms produce the same image:
Graphics complexes can be built up from integrated PolyhedronData:
Or, get a graphics complex directly:
ExampleData contains a number of 3D graphics complex models:
Many Import formats produce GraphicsComplex:
In this case the surface has about 35000 vertices:
A random selection of index coordinates:
Cows with random gradients:
New in 6