logo

FaceForm

The colors can be specified as RGBColor, GrayLevel, Hue, CMYKColor or SurfaceColor. Mathematica distinguishes two kinds of color models: Using the lighting model with LightSources and AmbientLight (Lighting->True), face colors can be specified by SurfaceColor only, giving a diffuse and a specular reflection component. With Lighting switched on and face colors defined without SurfaceColor, Mathematica assumes the reflection colors all to be white and ignores the color properties. If Lighting is switched off, SurfaceColors are ignored and different defined colors are shown only.
JavaView Snapshot Mathematica Snapshot
JavaView Applet JavaView Lite Applet
FaceForm is a directive which specifies separate color directives to be used for drawing the front and back faces of a geometry. In[1]:= ff = Graphics3D[{FaceForm[RGBColor[0., 0., 1.], RGBColor[1., 0., 0.]], Stellate[Dodecahedron[]]}, Lighting -> False];
Show[ff]

In[2]:= JavaView[ff]

This example shows, that Mathematica unfortunately does not care about a consistent orientation of the faces: The spike showing to the viewer has the opposite orientation to all other spikes, so it shows the back side color. In JavaView the Mathematica lighting is simulated by setting element colors. What does JavaView with these colors:
-- Without Lighting, colors defined without SurfaceColor: works fine.
-- Without Lighting, colors defined by SurfaceColor: Mathematica shows black faces without depth, JavaView shows white faces with depth shading.
-- With Lighting, colors defined without SurfaceColor: Looks similar to Mathematica in JavaView.
-- With Ligthing, colors defined by SurfaceColor: Mathematica uses the diffuse reflection color for the ambient light and the specular reflection color for the light sources - this is not handled correct by the MathLoader's color computation.
The simulation of lighting by setting face colors makes it impossible, to get the Mathematica behaviour transported to JavaView in the last case. The computed lighted colors upon faces overwrite the original colors, which can not be won back.
© 1997-2017 Last modified: 22.06.2017 --- www.javaview.de --- The JavaView Project