Aviatrix3D
2.1.0

Package org.j3d.renderer.aviatrix3d.loader.discreet

File loader for the Discreet 3DS MAX application (.3ds file format).

See:
          Description

Class Summary
MaxLoader A loader implementation capable of loading .3ds files for all revisions.
 

Package org.j3d.renderer.aviatrix3d.loader.discreet Description

File loader for the Discreet 3DS MAX application (.3ds file format).

File loaders are built over the top of the basic parsing framework defined in the org.j3d.loaders.discreet package to handle the parsing.

Implementation Notes

Material Library

Each MaterialBlock instance is transformed to an Appearance instance in order to hold all of the information provided. The colours are directly transformed to a Material instance and texture maps are set into a set of texture units.

Separate specular colour is always enabled and a common PolygonAttributes is used for this whenever there is no request for two-sided lighting. If two-sided lighting is requested, then a shared instance of another PolygonAttributes is used.

Texture Handling

Textures are a large part of most max files, but still defined externally. However, we must at least set up the appropriate structures internally so that the externally defined mapping can point to the right object.

The texture units are mapped in the following order for multitexturing so that a somewhat correct visual result is provided.

  1. Bump Map: This will be set to modulate with the underlying object's surface colour. Note that 3DS uses a displacement map, not a normal map for this file. Therefore, when loading an external file, you need to take the source image and convert from a displacement map (typically a greyscale indicating displacement from the surface) to a normal map as required by realtime 3D multitexturing
  2. Opacity map: Base colour values will be a simple pass-through. Alpha of the source objects will be replaced by this object's alpha channel. If a greyscale image, then treat it as an alpha map, not luminence or intensity
  3. Texture map: Modulate this will all the previous maps
  4. Reflection map: Not sure, but this is typically a cubic environment map. That is typically used as the texture map, rather than in addition to it. Will set up as a separate pass and modulate it with the previous texture unit
  5. Specular map: Apply the map as an additive map to the previous map. If the source map is a greyscale, treat it as a luminance map.
Maps that are not defined by the file will be left out of the order. When loading the external files, the user will be responsible for creating the appropriate TextureComponent instance and setting the right format when using the setImages() call on the provided Texture object.

Note that in some cases, depending on the format of the maps provided, you may need to find the parent texture object and mess with the texture attributes to get the right combine mode happening.

Name mapping

For the material and keyframe blocks, the standard names provided in the file are used. However, for the object block, where the name holds viewpoints, lights and geometry data, we need to generate unambiguous names. To do this, we take the base name then add on two suffixes to indicate light/mesh/camera and then the position in the file (as declared). So, say an object is created with the name "head", which had a viewpoint and light associated with it, the following 3 names would reference the corresponding Aviatrx3D objects:

head-mesh-0 org.j3d.aviatrix3d.TransformGroup
head-camera-0 org.j3d.aviatrix3d.Viewpoint
head-light-0 org.j3d.aviatrix3d.Light

Limitations

The implementation does not handle the animation keyframe, fog, camera or background data currently.

Required Support JARS and packages


Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org