WHAT IS
3D RAD?
CLICK HERE
TO FIND OUT!


SkinMesh


SkinMesh is a customizable 3d object supporting bone-based animation, frame-by-frame animation, multiple animation sets, animation blending and various rendering techniques and visual effects.

If you can use a 3d modeling tool and you can export your creations to DirectX® (.x) file format, then you can make custom 3d objects for your 3D Rad projects by using this object. Please see this tutorial for details.


FUNCTIONS

If you link the SkinMesh object to another object supporting physics (like for example a RigidBody based object), then the mesh will stay with the body while it moves around in virtual space.

In this case, please note that the mesh will follow the parent object by keeping the relative position you set in the Virtual Editor.

If the SkinMesh object isn't linked to any body, then, run-time, it will keep its location (performing any bone-based or 'frame-based' animation 'in place'), unless it is following a path (see below).

After adding the SkinMesh object to your project, you can configure it by double-clicking it in the Object List.




Change button

You can select the visual aspect for the SkinMesh object by clicking this button. You can add your own 3d models to the library. Please see this tutorial for details.

Rendering

  • Ignore point lights. By default, if point lights are close enough to affect the SkinMesh object, the model surface is affected by them.

    However, because rendering surfaces that are illuminated by multiple lights require much more processing power, you may want to disable this feature for specific SkinMesh objects to optimize frame-rate.

    Note that, for each SkinMesh, there is a maximum limit of point lights that can affect its surface at any given time. Please see the PointLight object's help file for details.

    IMPORTANT: point lights with a small range may fail to illuminate SkinMesh surfaces that are made of big polygons.


  • Shader. Various rendering techniques are supported. Please note that certain techniques may not support multiple lights and environment mapping.

    Note that 'bumpy' techniques are only rendered if a normal map image file is present in the data folder for the currently selected model.


  • Mode. Various render modes are supported. Please note that certain render modes may require Depth sorting enabled in order to work properly.


  • Depth sorting. If checked, the object's mesh is rendered after all other meshes in the scene. This option is recommended for meshes with transparent surfaces because it reduces rendering artifacts, like surfaces disappearing when they should be visible behind the transparent mesh. Do not use this option for non-transparent meshes, as this wastes processing power. See also No Z-buffer, below.


  • No Z-buffer. This option is recommended for meshes with transparent surfaces because it reduces rendering artifacts. Typically used with Depth sorting (see above).


  • No Shadows. If checked, shadows will not be cast on the mesh. Note that the mesh will still cast a shadow if a _shadow.x model is present in the data folder.


  • Reflection intensity/refresh-rate. If the 3d model's data folder includes a cube map file, then you can enable and configure reflection-based visual effects.

    The first parameter is the reflection-effect intensity, between 0.0 and 1.0.

    NOTE: the intensity is rounded to 0.5 on some older video-cards.

    The second parameter is the refresh rate for the reflected image. If this factor is zero, the reflected image is the static cubic image loaded from the file.

    Set this parameter to any positive value instead (below 450.0) to make the surface dynamically reflect the actual environment surrounding the object.

    NOTE: an object is reflected only if the Visible in reflections option is available and checked on its property dialog.

    NOTE: Dynamic environment-maps can be very slow to render. The greater the refresh rate factor, the slower the rendering.

    NOTE: actual reflections are not performed if the video-card doesn't provide so called render-to-texture functionality.


  • Animation

    The SkinMesh object supports two types of animation: bone-based (mesh skinning) and frame-based (a sequence of 3d models rendered one after the other). Please see this tutorial for details.

  • Set. If your animation is bone-based and it supports 2 or more animation sets, this value is the initial animation set to play.


  • Time. This is the initial animation time. Zero is the beginning of the animation sequence. Note that this factor will only work with bone-based animations with one single animation set.


  • Speed. Initial animation speed. This value is in key-frames and actual speed depends on how the model was originally designed in the 3d animation tool used to make it. Keep in mind that you may have to use very small values for certain 3d models (e.g. 0.05).


  • Blend. This is the time, in seconds, required to smoothly switch from one animation set to another.


  • Bind to path motion. If this option is checked and the SkinMesh object is linked to a Path object, then the animation will only play if the path-following action also playing.


  • Reset before blending. If this option is checked the bone-based animation sequence will reset to the beginning when switching from another animation set.


  • Compress animation data. If this option is checked the animation data for the current 3d model will be compressed to save memory and improve processing speed. Note that this may substantially reduce the animation quality though.


  • Frame. If the animation is frame-based, this value is the initial animation frame.


  • Frames per second. If the animation is frame-based, this value is the initial animation speed.


  • Path

    If you attach the SkinMesh object to a path by linking it to a Path object, then it will follow the pre-defined course, while also performing its bone-based or frame-based animation, if defined.

  • Loop Count. This is the number of times the object will loop around the path. Non integer values (e.g. 0.5) are supported.


  • Speed. Path following speed. When this value is 1, the whole path is completed in one second. Negative values are supported (reverse).

    Note that the relative speed along a specific portion of the path depends on the number of nodes defined along the segment. In particular, the more nodes are defined, the slower the speed. This property allows you to accurately program speed variations.


  • Behavior. When the path-following object is stopped and re-started (for example by an object like EventOnInput) it can start again from path's beginning, resume from where it was when stopped or move the opposite way along the path.


  • Follow At Start. If this option is not checked, the object will follow the path only when started by another object, like for example EventOnInput.


  • Spin vector, X, Y, Z

    If this option is enabled, you can specify an axis of rotation for the mesh by providing its vector components. Run-time, the mesh will ignore path or parent object orientation, spinning about the axis you specified instead.

    The vector length will determine the rotation speed, in degrees per second.

    For example, you can achieve a rotation about the X axis at 360 degrees per second with (360.0f,0.0f,0.0f). A rotation about the vertical (Y) axis can be achieved with (0.0f,360.0f,0.0f) instead. And (0.0f,0.0f,360.0f) will cause a rotation about the Z axis.

    If the Random option is checked, the axis you provide is only used as a reference to perform rotations about random axes.

    Other Controls

    The remaining controls on the dialog are common to all objects. They are explained here.


    INTERNAL PARAMETERS


    The following internal parameters can be accessed run-time by using objects like EventOnValue or Script:

  • Speed (m/sec). This is the current translation speed for the SkinMesh object, in meters per second (read-only)
  • Animation set (write-only)
  • Animation speed (write-only)
  • Animation time (or current frame, if the animation is frame-based)