SoInstanceParameterCreatePredefinedParameter Method (SoInstanceParameterPredefinedParameters, SoBufferObject, UInt32) |
Creates an instance parameter object for one of the predefined attribute names.
Namespace: OIV.Inventor.Nodes
public static SoInstanceParameter CreatePredefinedParameter( SoInstanceParameterPredefinedParameters paramKey, SoBufferObject values, uint divisor )
paramKey = TRANSLATION: Sets the translation per instance parameter values using the specified OIV.Inventor.Devices.SoBufferObject. The OIV.Inventor.Devices.SoBufferObject is expected to contain translations encoded as 3 float values, e.g. array of OIV.Inventor.SbVec3f. The buffer size must be at least (numInstances/divisor) * 3 * sizeof(float). The divisor parameter indicates by how many instances a translation value is shared.
Example :
numInstance = 4
translationValues = {(1, 0, 0), (0, 1, 0)}
divisor = 2 => The first 2 instances will be translated by using (1, 0, 0) and the next two using (0, 1, 0).
paramKey = ROTATION: Sets the rotation per instance parameter values using the specified OIV.Inventor.Devices.SoBufferObject. The OIV.Inventor.Devices.SoBufferObject is expected to contain rotations encoded as 4 float values, e.g. array of OIV.Inventor.SbRotation. The buffer size must be at least (numInstances/divisor) * 4 * sizeof(float). The divisor parameter indicates by how many instances a rotation value is shared.
paramKey = SCALE: Sets the scaling per instance parameter values using the specified OIV.Inventor.Devices.SoBufferObject. The OIV.Inventor.Devices.SoBufferObject is expected to contain scaling factor encoded as 3 float values, e.g. array of OIV.Inventor.SbVec3f. The buffer size must be at least (numInstances/divisor) * 3 * sizeof(float). The divisor parameter indicates by how many instances a scale value is shared.
paramKey = COLOR: Sets the color per instance parameter values using the specified OIV.Inventor.Devices.SoBufferObject. The OIV.Inventor.Devices.SoBufferObject is expected to contain colors encoded as 3 float values, e.g. array of OIV.Inventor.SbColor. The buffer size must be at least (numInstances/divisor) * 3 * sizeof(float). The divisor parameter indicates by how many instances a color value is shared.
paramKey = TRANSPARENCY: Sets the transparency per instance parameter values using the specified OIV.Inventor.Devices.SoBufferObject. The OIV.Inventor.Devices.SoBufferObject is expected to contain colors encoded as 1 float value, e.g. array of float. The buffer size must be at least (numInstances/divisor) * sizeof(float). The divisor parameter indicates by how many instances a transparency value is shared.
paramKey = VISIBILITY: Sets the visibility per instance parameter values using the specified OIV.Inventor.Devices.SoBufferObject. The OIV.Inventor.Devices.SoBufferObject is expected to contain visibility value encoded as an int32_t value. The buffer size must be at least (numInstances/divisor) * sizeof(int32_t). The divisor parameter indicates by how many instances a visibility value is shared.