Class SoVertexProperty
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoVertexProperty
-
- All Implemented Interfaces:
SafeDisposable
public class SoVertexProperty extends SoNode
Vertex property node. This property node is be used to efficiently specify coordinates, normals, tangents, texture coordinates, colors, transparency values, material binding, normal and tangent binding for vertex-based shapes, i.e., shapes derived fromSoVertexShape
.An
SoVertexProperty
node can be used as a child of a group node in a scene graph, in which case the properties it specifies are inherited by subsequent shape nodes in the graph. It can also be directly referenced using the vertexProperty field of a vertex-based shape, bypassing scene graph inheritance. Direct referencing is the recommended practice.When directly referenced by a VertexProperty field of a vertex-based shape, the
SoVertexProperty
node is the most efficient way of specifying vertex-based shapes. Use of the directly referencedSoVertexProperty
node results in significantly faster scene rendering than scene graph inheritance of vertex properties, provided all required vertex properties are specified in theSoVertexProperty
node.Because the class
SoVertexProperty
is derived fromSoNode
, a vertex property node can be inserted as a child node in a scene graph. When inserted as a node in a scene graph, theSoVertexProperty
node is traversed as any other property node and the properties it specifies are inherited by subsequent shape nodes in the scene graph. It specifies the current material, normal and tangent bindings, and can be used to specify the current 3D coordinates, the current normals, the current tangents, the current texture coordinates, the current diffuse colors, and the current transparencies.All multiple-valued fields in the
SoVertexProperty
node are optional. If a field is not present (i.e. if it has 0 values), then shapes that require the missing information are required to obtain it from the current traversal state. However, developers are cautioned that, for optimal performance, the vertex property node should be referenced as the VertexProperty field of anSoVertexShape
, and should specify in its fields all values required to render that shape.Fields:
The various fields in a vertex property node can be used in place of corresponding fields in other property nodes, as follows:
- The
vertex
field contains 3D coordinates, as in the point field of anSoCoordinate3
node.
- The
normal
field contains normal vectors, as in the vector field of theSoNormal
node.
Normal vectors are used (for example) to compute the effect of lighting on the shape when lighting is enabled.
- The
tangent
field contains tangent vectors.
When not using any custom shader, tangents are used by line shapes to compute the effect of lighting on the shape when lighting is enabled. SeeSoLineSet
andSoIndexedLineSet
for more details.
- The
orderedRGBA
field contains packed color+transparency values.
Colors are specified in the hexadecimal format 0xrrggbbaa , where rr is the red value (between 00 and 0xFF hex), gg is the green value (between 00 and 0xFF hex), bb is the blue value (between 00 and 0xFF hex), aa is the alpha value (between 00 = transparent and 0xFF = opaque). Packed colors use less memory thanSoMaterial
colors and can be sent directly to the GPU. A packed color value can be queried from anSbColor
orSbColorRGBA
object using the getPackedValue() method. The packed colors are equivalent to anSoPackedColor
node, and provide values for both diffuse color and transparency.
- The
texCoord
andtexCoord3
fields contain texture coordinates, as in the point field of theSoTextureCoordinate2
andSoTextureCoordinate3
nodes.
If one of these nodes appears higher in the scene graph and setOverride(true) was called on that node, those values are used instead of the corresponding field of the vertex property node.
Color:
Note: Calling setIgnored(true) on the fields of this node has no effect on its behavior.If setOverride() was called on an
Transparency:SoMaterial
node higher in the scene graph and either the diffuseColor field or the transparency field is not ignored (setIgnored()), then the color and transparency values from theSoMaterial
node are used instead of the values in theSoVertexProperty
. It is not currently possible to override just the color or just the transparency.The default transparency algorithm is NO_SORT. To get a nice appearance for transparent objects you must change this to another value, for example, OPAQUE_FIRST or SORTED_PIXEL, using the setTransparencyType method in the viewer or renderAction class. See
Material binding:SoGLRenderAction
for a discussion of transparency algorithms and rendering order.The
Normal binding:materialBinding
field replaces the value field of theSoMaterialBinding
node. ThematerialBinding
field in a directly referencedSoVertexProperty
node has no effect unless there is a nonemptyorderedRGBA
field, in which case the material binding specifies the assignment of diffuse colors and alpha values to the shape.The
Tangent binding:normalBinding
field replaces the value field of theSoNormalBinding
node. ThenormalBinding
field of a directly referencedSoVertexProperty
node has no effect unless there is a nonemptynormal
field, in which case the normal binding specifies the assignment of normal vectors to the shape.The
File format/default:tangentBinding
field of a directly referencedSoVertexProperty
node has no effect unless there is a nonemptytangent
field, in which case the tangent binding specifies the assignment of tangent vectors to the shape.VertexProperty {
vertex [ ] normal [ ] tangent [ ] texCoord [ ] texCoord3 [ ] orderedRGBA [ ] materialBinding OVERALL normalBinding PER_VERTEX_INDEXED tangentBinding PER_VERTEX_INDEXED forceSending false Action behavior:
SoGLRenderAction
,SoCallbackAction
,SoPickAction
When traversed in a scene graph, sets coordinates, normals, tangents, texture coordinates, diffuse colors, transparency, normal binding, tangent binding and material binding in current traversal state. If not traversed, has no effect on current traversal state associated with action. The normalBinding field has no effect if there are no normals. The tangentBinding field has no effect if there are no tangents. The materialBinding has no effect if there are no packed colors. Sets:SoCoordinateElement
,SoNormalElement
,SoNormalBindingElement
,SoMaterialElement
SoMaterialBindingElement
,SoTextureCoordinateElement
,SoTangentElement
,SoTangentBindingElement
SoGetBoundingBoxAction
When traversed in a scene graph, sets coordinates in current traversal state. If not traversed, has no effect on current traversal state associated with action. Sets:SoCoordinateElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoVertexProperty.Bindings
Binding.-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFBool
forceSending
Forces the texture coordinates to be sent to the GPU even if no texture is bound.SoSFEnum<SoVertexProperty.Bindings>
materialBinding
Material binding.SoMFVec3f
normal
Normal vector(s).SoSFEnum<SoVertexProperty.Bindings>
normalBinding
Normal binding.SoMFUInt32
orderedRGBA
Packed color(s), including transparencies.SoMFVec3f
tangent
Tangent vector(s).SoSFEnum<SoVertexProperty.Bindings>
tangentBinding
Tangent binding.SoMFVec2f
texCoord
2D texture coordinate(s).SoMFVec3f
texCoord3
3D texture coordinate(s).SoMFVec3f
vertex
Vertex coordinate(s).-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoVertexProperty()
Creates anSoVertexProperty
node with default settings.
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
vertex
public final SoMFVec3f vertex
Vertex coordinate(s). Default is empty.
-
texCoord
public final SoMFVec2f texCoord
2D texture coordinate(s). Default is empty.
-
texCoord3
public final SoMFVec3f texCoord3
3D texture coordinate(s). Default is empty.
-
forceSending
public final SoSFBool forceSending
Forces the texture coordinates to be sent to the GPU even if no texture is bound.
-
normal
public final SoMFVec3f normal
Normal vector(s). Default is empty.
-
tangent
public final SoMFVec3f tangent
Tangent vector(s). Default is empty.- Since:
- Open Inventor 10.2
-
normalBinding
public final SoSFEnum<SoVertexProperty.Bindings> normalBinding
Normal binding. . Default is PER_VERTEX_INDEXED.
-
tangentBinding
public final SoSFEnum<SoVertexProperty.Bindings> tangentBinding
Tangent binding. . Default is PER_VERTEX_INDEXED.- Since:
- Open Inventor 10.2
-
orderedRGBA
public final SoMFUInt32 orderedRGBA
Packed color(s), including transparencies. Default is empty.
-
materialBinding
public final SoSFEnum<SoVertexProperty.Bindings> materialBinding
Material binding. . Default is OVERALL.
-
-
Constructor Detail
-
SoVertexProperty
public SoVertexProperty()
Creates anSoVertexProperty
node with default settings.
-
-