< Zurück | Inhalt | Weiter >

9.2 Appearance

java.lang.Object

|

+−−javax.media.j3d.SceneGraphObject

|

+−−javax.media.j3d.NodeComponent

|

+−−javax.media.j3d.Appearance


The Appearance class contains member variables that together define an appearance state for a Shape3D

object. A Shape3D object basically contains Geometry and Appearance. The Appearance class itself

does not define any of the properties that control Shape3D appearance, but instead packages Appearance

subcomponents, such as PolygonAttributes, RenderingAttributes, and so on.


The Appearance class controls access to its member variables through the familiar, but rigorous, process of setting capability bits. That is, the application developer must specify which Appearance member variables will be modified after the Appearance is attached to a live scenegraph. A live scenegraph is one that has either been compiled or has been rendered.


The capability bits that control access to the member variables of the Appearance class are:


COLORING_ATTRIBUTES

LINE_ATTRIBUTES

MATERIAL

POINT_ATTRIBUTES

POLYGON_ATTRIBUTES

RENDERING_ATTRIBUTES

TEXGEN

TEXTURE_ATTRIBUTES

TEXTURE

TRANSPARENCY


Preface the listed items with ALLOW_ and add _READ or _WRITE for read or write access respectively. For example, to allow read/write access to the Material and PolygonAttributes member variables, you would put the following in your code:


Appearance app = new Appearance(); app.setCapability( ALLOW_MATERIAL_READ ); app.setCapability( ALLOW_MATERIAL_WRITE ); app.setCapability( ALLOW_POLYGON_ATTRIBUTES_READ );

app.setCapability( ALLOW_ POLYGON_ATTRIBUTES_WRITE );



 

NOTE