[idx3d::Docu4]
Working with materials
Each instance of idx3d_Object has a reference to an instance of idx3d_Material.
idx3d_Material describes the visual appearance of the object, so the rasterizer
knows how to render it.
1.
|
Parameters
|
int color
The default color of the object.
Setter method: setColor(int color)
int transparency
The transparency of the object, range from 0 (=opaque) to 255 (=full transparency).
Setter method: setTransparency(int factor)
int reflectivity
The reflectivity of the object, range from 0 (=none) to 255 (=full reflectivity).
Setter method: setReflectivity(int factor)
idx3d_Texture texture
The texture of the object. If null, the object will be rendered with its default color.
Setter method: setTexture(idx3d_Texture texture)
idx3d_Texture envmap
The environment map reflected on the object's surface. If null, only the specular highlights
of the light sources will be rendered.
Setter method: setEnvmap(idx3d_Texture envmap)
boolean flat
Special mode for flat shading or unshaded texturing (if texture is set) or simple envmapping (if envmap is set).
Setter method: setFlat(boolean active)
| |
2.
|
Importing Textures
|
Textures can be imported from JPG, GIF and PNG files. There are two different constructors:
new idx3d_Texture(URL baseURL, String filename)
to be used in Applets. The argument baseURL can be resolved with the Applet's
getDocumentBase() method, which returns an URL.
new idx3d_Texture(String path)
to be used in Applications. The path can be relative or absolute.
| |
3.
|
Importing Materials
|
Materials can be imported from material files generated by the idx3d Material Lab. There are two different constructors:
new idx3d_Material(URL baseURL, String filename)
to be used in Applets. The argument baseURL can be resolved with the Applet's
getDocumentBase() method, which returns an URL.
new idx3d_Material(String path)
to be used in Applications. The path can be relative or absolute.
| |
|
|