Search code examples
x3d

How to add specular map,bump map and colour texture in one object using x3d?


I want to find a way to add specular map and bump map on a object,but after I read the documantation of vrml97 and x3d ,I can not find any method.


Solution

  • In order to add color/light to an object you can use Appearance node:

    Appearance { 
      exposedField SFNode material          NULL
      exposedField SFNode texture           NULL
      exposedField SFNode textureTransform  NULL
    }
    

    The material field can be a Material node:

    Material { 
      exposedField SFFloat ambientIntensity  0.2         # [0,1]
      exposedField SFColor diffuseColor      0.8 0.8 0.8 # [0,1]
      exposedField SFColor emissiveColor     0 0 0       # [0,1]
      exposedField SFFloat shininess         0.2         # [0,1]
      exposedField SFColor specularColor     0 0 0       # [0,1]
      exposedField SFFloat transparency      0           # [0,1]
    }
    

    Or, if you want to add texture to your object you can use texture or textureTransform fields.

    You can find all you need on web3d.org.