Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

:NEW

source files: [xc]mtl.[ch]

SYNTAX

(SEND CLASS-MATERIAL :NEW
    [ :DRAW-AS  { :SOLID | :FACETS | :WIRE-FRAME | :POINT-CLOUD | :INVISIBLE | NIL }  ]

    [ :EMISSION-COLOR '(0.3 0.5 0.6) ]  ; If the thing glows.
    [ :AMBIENT-COLOR  '(0.5 0.5 0.8) ]  ; Ambient light.
    [ :DIFFUSE-COLOR  '(0.1 0.1 0.9) ]  ; This is usually what you want.
    [ :SPECULAR-COLOR '(1.0 1.0 1.0) ]  ; Reflected highlights.
    [ :SHININESS      0.4 ]             ; Finicky.  0.0 -> 1.0.
    [ :ALPHA          0.5 ]             ; Translucency.
    [ :ALPHA-IMPLEMENTATION { :ALPHA
       | :ORDERED-DITHER
       | :RANDOM-16X16-PATTERNS
       | :RANDOM-32X32-PATTERNS
       | :RANDOM-64X64-PATTERNS }
    ]
    [ :EMISSION-WEIGHT  1.0 ] ; 0.0/1.0 to ignore/use emission-color.
    [ :AMBIENT-WEIGHT   1.0 ] ; 0.0/1.0 to ignore/use ambient-color.
    [ :DIFFUSE-WEIGHT   1.0 ] ; 0.0/1.0 to ignore/use diffuse-color.
    [ :SPECULAR-WEIGHT  1.0 ] ; 0.0/1.0 to ignore/use specular-color.
    [ :SHININESS-WEIGHT 1.0 ] ; 0.0/1.0 to ignore/use shininess.
    [ :ALPHA-WEIGHT     1.0 ] ; 0.0/1.0 to ignore/use alpha value.
) 

DESCRIPTION

Creates a new material. EMISSION-COLOR does not actually make the thing into a light source. You need to position a light where the thing is for that.

DIFFUSE-COLOR is what one normally thinks of as the color of the thing. This is the value you're most likely to set.

If :ALPHA-IMPLEMENTATION is provided, it controls the way translucency is implemented when :ALPHA is neither zero nor one. It defaults to :ALPHA on machines which support this, which provides true pixel-by-pixel color blending. (On machines with alpha blending but without alpha planes, this does have the disadvantage of requiring that objects be drawn most distant first.) :ORDERED-DITHER provides the next-nicest effect; It drops out some pixels to allow other objects to show through, hence is often called "screen-door translucency". The :RANDOM-16X16-PATTERNS (etc) are a more primitive variant of screen-door translucency; I had intended to phase them out, but some of our users are fond of the effect. Not all machines support all pattern sizes.

If :DRAW-AS is provided, it controls the way the thing is drawn. It is useful primarily if one wishes to draw a normally solid-fill set of primitives (triangles or rectangles), as a wireframe skeleton, without going to the trouble of actually building a new thing describing the resulting thing as line segments. (Note that such a custom-built thing may draw twice as fast, however, since it will likely contain each line segment only once, where :DRAW-AS :WIRE-FRAME will outline each polygon with line segments, drawing most edges twice in the case of a mesh of edge-sharing polygons.) The :SOLID keyword will draw smooth (Gauroud) shaded if given a choice, the :FACETS keyword will draw flat-shaded if given a choice -- either will draw the other way if only enough information is provided to do so.

As with the other things, most of these parameters default to the fastest values, in general, and changing them is likely to slow rendering. Tanstaafl.

The various -WEIGHT fields are primarily meaningful to the :SET-TO-PRODUCT message (see).


Go to the first, previous, next, last section, table of contents.