Class Model3D.Material

  • Enclosing class:
    Model3D

    public static class Model3D.Material
    extends java.lang.Object
    describes material properties. A material can be either simple or "advanced"
    and in both cases it can be textured.
    A simple material is described by a 4-tuple of RGBA values. The advanced material
    defines multiple properties: diffuse, ambient, emissive, specular, shininess and
    transparency
    • Constructor Detail

      • Material

        public Material​(long cPtr,
                        boolean cMemoryOwn)
      • Material

        public Material()
        default constructor
      • Material

        public Material​(java.lang.String nam,
                        float r,
                        float g,
                        float b,
                        float a)
        constructor for simple material
      • Material

        public Material​(java.lang.String nam,
                        float r,
                        float g,
                        float b)
        constructor for simple material
    • Method Detail

      • delete

        public void delete()
      • hasTexture

        public boolean hasTexture()
        Check if material has texture.
        Returns:
        true if material has texture.
      • getTextureID

        public int getTextureID()
        Get id of the texture for this material.
        Returns:
        the texture id.
      • setName

        public void setName​(java.lang.String value)
        material name, not necesarily unique
      • getName

        public java.lang.String getName()
        material name, not necesarily unique
      • setSimplergb

        public void setSimplergb​(boolean value)
        true if this material is a simple material
      • getSimplergb

        public boolean getSimplergb()
        true if this material is a simple material
      • setTexId

        public void setTexId​(short value)
        index to a texture which is stored in Model3D, -1 if not used
      • getTexId

        public short getTexId()
        index to a texture which is stored in Model3D, -1 if not used
      • setRgb

        public void setRgb​(SWIGTYPE_p_float value)
        Red, Green, Blue and alpha color (simple) or diffues color(advanced)
      • getRgb

        public SWIGTYPE_p_float getRgb()
        Red, Green, Blue and alpha color (simple) or diffues color(advanced)
      • setAmbient

        public void setAmbient​(SWIGTYPE_p_float value)
        Ambient color as RGBA
      • setEmissive

        public void setEmissive​(SWIGTYPE_p_float value)
        Emissive color as RGBA
      • setSpecular

        public void setSpecular​(SWIGTYPE_p_float value)
        Specular color as RGB
      • setShininess

        public void setShininess​(float value)
        The shininess \in [0,128]
      • getShininess

        public float getShininess()
        The shininess \in [0,128]
      • setTransparency

        public void setTransparency​(float value)
        Transparency in [0, 1]
      • getTransparency

        public float getTransparency()
        Transparency in [0, 1]