[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6 Changing the Way Things Look

Geomview uses a hierarchy of appearances to control the way things look. An appearance is a specification of information about how something should be drawn. This can include many things such things as color, lighting, material properties, and more. Appearances work in a hierarchal manner: if a certain appearance property, for example face color, is not specified in a particular object's appearance, that object is drawn using that property from the parent appearance. If both the parent and the child appearance specify a property, the child's setting takes precedence unless the parent appearance is set to override.

Every geom in Geomview has an appearance associated with it. There is also an appearance associated with the "World" geom, which serves as the parent of each individual geom's appearance. Finally, there is a global "base" appearance, which is the parent of the World appearance.

The base appearance specifies reasonable values for all appearance information, and by default none of the other appearances specify anything, which means they inherit their values from the base appearance. This means that by default all objects are drawn using the base appearance.

If you change a certain appearance property for a geom, that property is used in drawing that geom. The parent appearance is used for any properties that you do not explicitly set.

Geomview has three panels which let you modify appearances.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6.1 The Appearance Panel

The Appearance panel lets you change most common appearance properties of the target object. <CENTER><IMG SRC="pix/ap.gif"><P>The Appearance Panel</CENTER> If the target is an individual geom, then changes you make in the appearance panel apply to that geom's appearance. If the target is the World, then appearance panel changes apply to the World appearance and to all individual geom appearances. (Users have found that this is more desirable than having the changes only apply to the World appearance.) If the target is a camera, then appearance panel changes apply to the geom that was most recently the target.

The five buttons near the upper right corner under the word Draw control what parts of the target geom are drawn.

Faces

This button specifies whether faces are drawn.

Edges

This button specifies whether edges are drawn.

BBox

This button specifies whether the bounding box is drawn.

Vects

This button specifies whether VECT objects are drawn. VECTs are a type of OOGL object that represent points and line segments in 3-space; they are distinct from edges of other kinds of objects, and it is sometimes desirable to have separate control over whether they are drawn.

Normals

This button specifies whether surface normal vectors are drawn.

The four buttons under Color labeled Faces, Edges, Normals, and BBox let you specify the color of the corresponding aspect of the target geom. Clicking on one of them brings up a color chooser panel. <CENTER><IMG SRC="pix/color.gif"><P>Color Chooser Panel</CENTER> This panel offers two sets of sliders: H(ue) S(aturation) V(alue), or R(ed) G(reen) B(lue), each in the range 0 through 1. The square shows the current color, which is given numerically in both HSV and RGB systems in the corresponding text boxes.

In the HSV color system, hue H runs from red at 0, green at .333, blue at .667, and back to red at 1.0. Saturation gives the fraction of white mixed into the color, from 0 for pure gray to 1 for pure color. Value gives the brightness, from 0 for black to 1 for full brightness.

Pressing the RGb or HSV button at top center switches the sliders to the other color system. You can adjust colors either via the sliders, or by typing in either the RGB or HSV text boxes.

Click OK to accept the color that you have chosen, or Cancel to retain the previous color setting.

The SHADING browser lets you specify the shading model that Geomview uses to paint the target geom.

Constant

Every face of the object is drawn with a constant color which does not depend on the location of the face, the camera, or the light sources. If the object does not contain per-face or per-vertex colors, the diffuse color of the object's appearance is used. If the object contains per-face colors, they are used. If the object contains per-vertex colors, each face is painted using the color of its first vertex.

Flat

Each face of the object is drawn with a color that depends on the relative location of the face, the camera, and the light sources. The color is constant across the face but may change as the face, camera, or lights move.

Smooth

Each face of the object is drawn with smoothly interpolated colors based on the normal vectors at each vertex. If the object does not contain per-vertex normals, this has the same effect as flat shading. If the object has reasonable per-vertex normals, the effect is to smooth over the edges between the faces.

CSmooth

Each face of the object is drawn with exactly the specified color(s), independent of lighting, orientation, and material properties. If the object is defined with per-vertex colors, the colors are interpolated smoothly across the face; otherwise the effect is the same as in Constant shading style.

The Facing Normals button on the Appearance panel indicates whether or not Geomview should arrange that normal vectors always face the viewer. If a normal vector points away from the viewer the color of the corresponding face or vertex usually is darker than is desired. Geomview can avoid this by using the opposite normal in shading calculations. This is the default. Using Facing Normals can give strange flickering dark or light shading effects, though, near the horizon of a fairly smooth facetted object. Press this button to use the normals given with the object.

The three text fields in the lower left corner of the Appearance panel are:

Line Width

The width, in pixels, for lines drawn by Geomview.

Normal Length

This is actually a scale factor; when normal vectors are drawn, Geomview draws them to have a length that is their natural length times this number.

Patch Dicing

Geomview draws Bezier patches by first converting them to meshes. This parameter specifies the resolution of the mesh: if Patch Dicing is n, then an n by n mesh is used to draw each Bezier patch. if Patch Dicing is 1, the resolution reverts to a built-in default value.

The Revert button on the Appearance panel undoes all settings in the target appearance. This causes the target geom to inherit all its appearance properties from its parent.

The Appearance panel's Override button determines whether appearance controls should override settings in the objects themselves - for example, setting the face color will affect all faces of objects with multi-colored facets. Otherwise, appearance controls only provide settings which the objects themselves do not specify. By default, Override is enabled. This button applies to all objects, and to all appearance-related panels.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6.2 The Materials Panel

The Materials panel controls material properties of surfaces. It works with the target object in the same way that the Appearance panel does. <CENTER><IMG SRC="pix/mat.gif"><P>The Materials Panel</CENTER>

Transparent

This button determines whether transparency is enabled. Geomview itself does not fully support transparency yet and on some machines it does not work at all. (The missing piece is implementation of a depth-sorting algorithm in the rendering engine; not difficult, but just not done yet.) Use RenderMan if you want real transparency: when transparency is enabled, a RenderMan snapshot will contain the alpha information.

Alpha

This slider determines the opacity/transparency when transparency is enabled. 0 means totally transparent, 1 means totally opaque.

Diffuse Reflectance

This slider controls the diffuse reflectance of a surface. This has to do with how much the surface scatters light that it reflects.

Shininess

This slider controls how shiny a surface is. This determines the size of specular highlights on the surface. Lower values give the surface a duller appearance.

Ambient Reflectance

This slider controls how much of the ambient light a surface reflects.

Specular Reflectance

This slider controls the specular reflectance of a surface. This has to do with how directly the surface reflects light rays. Higher values give brighter specular highlights.

Done

This button dismisses the Materials panel.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6.3 The Lighting Panel

The Lighting panel controls the number, position, and color of the light sources used in shading. <CENTER><IMG SRC="pix/light.gif"><P>The Lighting Panel</CENTER>

The Lighting panel is different from the Appearance and Material panels in that it always works with the base appearance. This is because it usually makes sense to use the same set of lights for drawing all objects in your scene.

LIGHTS

The LIGHTS browser shows the currently selected light. Changes made using the other widgets on this panel apply to this light. There is always at least one light, the ambient light.

Intensity

This slider controls the intensity of the current light.

Color

This button brings up a color chooser which lets you select the color of the current light.

Add

This button adds a light.

Delete

This button deletes the current light.

Show Lights

This button lets you see and change the positions of the light sources in a camera window. Each light is drawn as long cylinder which is supposed to remind you of a light beam. When you click on the Show Lights button Geomview goes into "light edit" mode, during which you can rotate current light by holding down the left mouse button and moving the mouse. Lights placed in this way are infinitely distant, so what you are changing is the angular position. Click on the Show Lights button again to return to the previous motion mode and to quit drawing the light beams.

Done

This button dismisses the Lighting panel.

Geomview's Appearance, Materials, and Lighting panels are constructed to allow you to easily do most of the appearance related things that you might want to do. The appearance hierarchy that Geomview supports internally, however, is very complex and there are certain operations that you cannot do with the panels. The Geomview command language (gcl) provides complete support for appearance operations. In particular, the merge-baseap command can be used to change the base appearance (which, except for lighting, cannot be changed by Geomview's panels). The merge-ap command can be used to change an individual geom's appearance. Appearances can also be specified in OOGL files; for details, see section Appearances.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Build Daemon user on December, 15 2005 using texi2html 1.76.