Inhaltsverzeichnis

3D sets

3D sets are code elements that can be inserted into the scene instead of 3D objects. They are used when complex composite elements that form a unit and should react like a single model are required. 3D sets can contain interaction elements, animations and audio clips. In addition, 3D sets can also interact with other elements in a scene.

Example:

3D sets are defined in AFRAME (https://aframe.io) are defined. In addition to all the possibilities offered by AFRAME, many other components provided by vrdoro can be used.

The UI with which the elements can be customised can be configured using an EditorConfig or EditorConfigGlobal attribute on each a-entity tag.

The syntax for the EditorConfig is very extensive and is explained using examples.

Overview

Syntax

This syntax applies:

  1. The general syntax is: editorConfig[Global]=`AttributeControl|[AttributeControl]*`
  2. An AttributeControl has the form: Attribute=Value range or ComponentName=Property:Value range
  3. Value range: from~to or bool or colour or select

editorConfigGlobal vs. editorConfig

The controls defined by editorConfigGlobal are displayed in the upper 'Scene settings' section of the Room Viewer UI. The editorConfig values are displayed for the individual room element below Room elements.

Labels

Attributes vs. property

Values for properties such as position or colour are values for the corresponding entity attributes. The attributes can also be components, which in turn have attributes. These are then called properties (cf. the AFRAME docs). For example, the component material (set as an attribute on an a-entity) has the properties src and colour.

The configurable values and value ranges for the attributes and properties are generally handled in the same way via the editorConfig specifications. For example, a colour selection on an a-plane with colour=colour or on the material-component with material=colour:colour can be made selectable.

Attributes are generally referred to below, but the statements also generally apply to component properties.

Attribute value changes

There are different types of attribute values:

  1. Numeric values
  2. Boolean values
  3. Colour values
  4. Fixed values in a selection list

Numeric values

Numerical values are configured using a slider. The syntax is:

minValue and maxValue can also be replaced by - which means unlimited.

If minValue and maxValue are the same (the respective pair for vectors), no selection is possible and the value is fixed.

If the maxValue (not possible for vectors) is followed by a numerical value in brackets, this indicates the increment. For example count=1~10(1)means that only integers between 1 and 10 are possible.

Boolean values

Truth values (True or False) can be specified using bool as the value.

Example:

A checkbox is then displayed in the UI.

Colour values

Colour values can be changed by specifying colour as a value.

Example:

A colour selection element is then displayed in the UI.

Fixed values in a selection list

A selection list can be created by specifying the values within square brackets separated by commas.

Example:

A colour selection element is then displayed in the UI.

Translations

Unless explicitly specified, the label names are derived from the attribute names specified in the editorConfig.

Creation of translation keys

The formation of keys follows these rules (in the examples, the key is marked in bold after the ':'):

If the value range is a vector (e.g. for position or material.repeat), the key is followed by a '-' followed by x (y,…) is appended to the key in order to be able to address and control the values individually.

The room viewer checks for each label (getTranslationForKey(key)) to see whether it can find a translation for it. There are two categories of translations:

  1. controller: Translations for standard control labels
  2. environment: Translations for room element labels

The check is performed in the specified order. This means that the translation of the standard control labels cannot be overwritten by element translations.

Note: Translation keys (as with the ember-intl used) must be used in a case-sensitive manner

Characters appended with an underscore '_' are removed when searching for a translation. The underscore is replaced by a space. This makes it possible to translate only the first substring.

Examples (string):

Translation of Keys

The key is first checked in full (without the part after '_') and then shortened from the end to '-' to form a new key to be checked.

Example:

Please note: Translations cannot currently be added in the Visualiser. However, existing keys can be used.

Configuration examples

Example for controlling several values simultaneously (commented in the code with 'alias list'):

Examples for changing materials with the component modeleffects: