CabMasterPro User Guide
In This Topic
    Bitmaps in 3D Model Rendering : Developer
    In This Topic

    3D models (e.g. 3DS and 3DM) have various materials and environment maps (optionally) defined.

    Each has a name (e.g. “brick”) and is associated with a bitmap in the 3DS model itself. But when rendering the model, CabMaster checks for a substituted bitmap by looking for a definition of a variable associated with that material name.

    Examples

    For material bitmaps, it looks for _modeltex[materialname]    e.g. _modeltex[“brick”]

    For environment bitmaps, it looks for _modelenv[materialname]   e.g. _modelenv[“brick”]

    If this variable is defined (in the context of the current section or a containing section/page/drawing) then the defined name is used instead to find a bitmap for 3D rendering. If not defined, then the 3DS internally defined bitmap is used.

    Bitmaps are loaded by default from the same folder as the 3D model itself. For example, if teapot.3ds is in the folder c:\abc\def\ then any material bitmaps used by this model by default are loaded from this folder. And if the _modeltex[materialname] variable is defined then (unless it is a full path) the value will be treated as relative to this folder. Substituted material bitmaps can thus be loaded from either the same folder as (or subfolders of) the 3DS model, or by supplying a value such as  BitmapPath&”\something\else\another.bmp” you can provide a full path to the required bitmap.

    Note that environment maps are special bitmaps which create a nice simulated reflection in real time. See OpenGL documentation for further details (e.g. Google search on “OpenGL environment maps”). You can experiment with these in CabMaster by setting an environment texture up on a regular section before using them in 3DS models. The environment map effectively provides a reflected scene to display as you move around looking at the 3D object from different angles – the scene is artificial in that it is not the actual CabMaster drawing you are within, but if it is vaguely similar, then the effect is very realistic because the reflection effect is distorted anyhow by curved faces and so on.

    True reflections are available for CabMaster objects (cabinets sections walls etc) but not for 3DS models within the scene. However the model itself reflects in other objects (e.g. if you put a wineglass on a shiny benchtop, you will see the reflected wineglass).



    See Also

    Developer | Cabinet Properties | Model