StringTune-3D/Docs

Concepts

Model Loading

Loader selection, fit modes, centering, texture remapping, and when model materials are overridden by CSS.

Model Loading

Models are the object type with the most moving parts, because they combine provider loaders, scene import, material override, and fit logic.

Required attribute

HTML
<div string="3d" string-3d="model" string-3d-model="/models/robot.glb"></div>

Without string-3d-model, the scene runtime does not create the model object.

Loader selection

There are three ways model loading can be decided:

  1. a direct module setting modelLoader
  2. a module setting modelLoaderFactory
  3. a type name from modelLoaderType or string-3d-model-loader

Fit and centering

  • string-3d-model-fit controls how the imported model is fit to the DOM box
  • string-3d-model-scale applies an extra scale factor
  • string-3d-model-center recenters the loaded root around its bounding box

Texture remapping

Two attributes affect loader-side texture resolution:

  • string-3d-model-texture-base
  • string-3d-model-textures

The second one is expected to be JSON.

Material override rule

If the model element defines material-related CSS such as --material-color or --texture-map, the runtime treats that as an override signal and replaces imported mesh materials with the CSS-driven material pipeline.