Control Your Color Even More
Node
ColorRGBA • Attributes
Description
A cube created with IndexedFaceSet that specifies a ColorRGBA node. The colorPerVertex field is set to true (default) and a color/alpha is defined for each vertex of each face.
VRIGNETTE Notes
ColorRGBA is exactly like Color except it provides control over the alpha channel.
Other Nodes
Example
Rotate the vrignette to view the geometry.
Code
<x3d> <scene> <worldInfo title="X3D ColorRGBA Example"> </worldInfo> <navigationInfo headlight="true"> </navigationInfo> <viewpoint position="0.0 1.0 15.0" centerOfRotation="0.0 0.0 0.0"> </viewpoint> <transform rotation="1 0 0 0.396"> <shape> <appearance> <material specularColor="0.9 0.9 0.9"> </material> </appearance> <indexedFaceSet solid="false" coordIndex="0 1 2 3 0 -1 4 5 6 7 4 -1 8 9 10 11 8 -1 12 13 14 15 12 -1 16 17 18 19 16 -1 20 21 22 23 20" colorIndex="0 1 2 3 0 -1 4 5 6 7 4 -1 8 9 10 11 8 -1 12 13 14 15 12 -1 16 17 18 19 16 -1 20 21 22 23 20"> <coordinate point="0.0 0.0 3.0, 3.0 0.0 0.0, 0.0 0.0 -3.0, -3.0 0.0 0.0, 0.0 3.0 3.0, 3.0 3.0 0.0, 0.0 3.0 -3.0, -3.0 3.0 0.0, 0.0 3.0 3.0, 0.0 0.0 3.0, 3.0 0.0 0.0, 3.0 3.0 0.0, 0.0 3.0 -3.0, 0.0 0.0 -3.0, -3.0 0.0 0.0, -3.0 3.0 0.0, -3.0 3.0 0.0, -3.0 0.0 0.0, 0.0 0.0 3.0, 0.0 3.0 3.0, 3.0 3.0 0.0, 3.0 0.0 0.0, 0.0 0.0 -3.0, 0.0 3.0 -3.0"> </coordinate> <color color="1.0 0.0 0.0 1.0, 0.85 0.0 0.0 0.75, 0.70 0.0 0.0 0.5, 0.55 0.0 0.0 0.25, 0.0 1.0 0.0 1.0, 0.0 0.85 0.0 0.75, 0.0 0.70 0.0 0.5, 0.0 0.55 0.0 0.25, 0.0 0.0 1.0 1.0, 0.0 0.0 0.85 0.75, 0.0 0.0 0.70 0.5, 0.0 0.0 0.55 0.25, 1.0 0.647 0.0 1.0, 0.85 0.647 0.0 0.75, 0.70 0.647 0.0 0.5, 0.55 0.647 0.0 0.25, 0.498 0.0 1.0 1.0, 0.448 0.0 1.0 0.75, 0.398 0.0 1.0 0.5, 0.348 0.0 1.0 0.25, 1.0 1.0 0.0 1.0, 0.85 1.0 0.0 0.75, 0.70 1.0 0.0 0.5, 0.55 1.0 0.0 0.25"> </color> </indexedFaceSet> </shape> </transform> <background skyColor="0.2 0.2 0.2" groundColor="0.2 0.2 0.2"> </background> </scene> </x3d>