logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoMaterial — surface material definition node

Action Behavior

SoGLRenderAction,SoCallbackAction
          Sets the ambient color, the diffuse color, the specular color, the emissive color, the shininess,  and
          the transparency of the current material.

Description

       This  node  defines  the  current  surface material properties for all subsequent shapes. SoMaterial sets
       several components of the current material during traversal.

       Multiple values can be specified for  the  diffuseColor  and  transparency.  Different  shapes  interpret
       materials with multiple values differently. To bind materials to shapes, use an SoMaterialBinding node.

Fields

SoMFColorambientColor
          Ambient color of the surface.

     SoMFColordiffuseColor
          Diffuse color(s) of the surface.

     SoMFColorspecularColor
          Specular color of the surface.

     SoMFColoremissiveColor
          Emissive color of the surface.

     SoMFFloatshininess
          Shininess  coefficient  of the surface. Values can range from 0.0 for no shininess (a diffuse surface)
          to 1.0 for maximum shininess (a highly polished surface).

     SoMFFloattransparency
          Transparency value(s) of the surface. Values can range  from  0.0  for  opaque  surfaces  to  1.0  for
          completely  transparent  surfaces. If the transparency type is SoGLRenderAction::SCREEN_DOOR then only
          the first transparency value will be used. With other transparency types, multiple transparencies will
          be used, if the SoMaterial node contains as many transparencies as diffuse colors. If there are not as
          many transparencies as diffuse colors, only the first transparency will be used.

File Format/Defaults

Material{ambientColor0.20.20.2diffuseColor0.80.80.8specularColor000emissiveColor000shininess0.2transparency0}

Inherits From

       SoBase > SoFieldContainer > SoNode > SoMaterial

Methods

SoMaterial()
          Creates a material node with default settings.

     staticSoTypegetClassTypeId()
          Returns type identifier for this class.

Name

       SoMaterial — surface material definition node

See Also

SoBaseColor,SoLightModel,SoMaterialBinding,SoPackedColorSoMaterial(3IV)()

Synopsis

#include<Inventor/nodes/SoMaterial.h>

          Fields from class SoMaterial:

     SoMFColorambientColorSoMFColordiffuseColorSoMFColorspecularColorSoMFColoremissiveColorSoMFFloatshininessSoMFFloattransparency

          Methods from class SoMaterial:

                         SoMaterial()staticSoTypegetClassTypeId()

          Methods from class SoNode:

     voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)

          Methods from class SoFieldContainer:

     voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)

          Methods from class SoBase:

     voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const

See Also