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 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 created with AFRAME (https://aframe.io) in the neo-code component. 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.
name
Name of the neo-code componentenabled
: Activates/deactivates the componentcode
: Selector for the code block to be executed (optional)params
: Names of the parameters p0-p14 in consecutive orderp0…
: Value of the respective parametercodeRunDelay
: Delay in the execution of the code blockupdateShadowMap
: Activates/deactivates an update of the shadowMap after execution of the code block
The default parameter type is string
. Automated parsing takes place in the following cases:
Boolean
Number
Vector2
Vector3
array
This syntax applies:
editorConfig[Global]=`AttributeControl|[AttributeControl]*`
Attribute=Value range
or ComponentName=Property:Value range
from~to
or bool
or colour
or select
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.
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.
There are different types of attribute values:
Numerical values are configured using a slider. The syntax is:
Attribute name=minValue~maxValue(stepWidth)
(stepWidth) is optional, minValue and maxValue can also be vectors, e.g.Attribute name=minValue_x minValue_y minValue_z~minValue_x minValue_y minValue_z
minValue and maxValue can also be represented 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.
Truth values (True or False) can be specified using bool
as the value.
Example:
editorConfig=`visible=bool`
A checkbox is then displayed in the UI.
Colour values can be changed by specifying colour
as a value.
Example:
editorConfig=`backgroundcolor=colour`.
A colour selection element is then displayed in the UI.
A selection list can be created by specifying the values within square brackets separated by commas.
Example:
animation=dur:[20000,10000,5000]
animation=dur:[20000~slow,10000~normal*,5000~fast]
A colour selection element is then displayed in the UI.
Labels for UI elements can be added after the property separated by a tilde ('~'). The labels are specified in English. If there is a translation for the label in the dictionary, the word is translated into the respective language. For words separated by an underscore ('_'), the individual words are translated separately and the underscore is replaced by a space.
Example: functionName~Info:button~show
Unless explicitly specified, the label names are derived from the attribute names specified in the editorConfig.
The formation of keys follows these rules (in the examples, the key is marked in bold after the ':'):
light=intensity:0~2
→ key = light-intensity
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 if it can find a translation for it. There are two categories of translations:
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):
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:
sun-position-x
If a translation is found, this is used. Otherwise sun-position
is used.sun-position
If a translation is found, this will be used. It is supplemented by the missing suffix (x
) for which a translation is also looked up.Note: Translations cannot currently be added in the Visualiser. However, existing keys can be used.
wallFlip
scale
'0 0 0~2 2 2
scale=0.5 0.5 0.5~2 2 2
'0.5 0.5 0.5~2 2 2
' can also be written as '0.5~2
'.scale=0~2
scale|position=0 2
colour=colour;
position=0~2|light=intensity:0~2;colour:coloring
Example for controlling several values simultaneously (commented in the code with 'alias list'):
editorConfig=“scale[scale.x,scale.y,scale.z]~size=1~20”
Examples for changing materials with the component modeleffects
:
modeleffects=“materials: Material001~facade={'colour':'#FFF'},Material002~frame={'colour':'#FFF'},Material006~glass={'opacity':0.5}”
modeleffects=“materials: Material.015={'emissiveIntensity':0.6|'emissive':'#FF8'}”