Decentraland markup

From Decentraland
(Redirected from A-Minus)
Jump to: navigation, search

Decentraland markup reference

How the engine works

Decentraland uses custom markup to describe scenes. Scenes must be valid xml, but we recommend serving them using the .html extension.

Supported primitives

entity

An empty node that allows you to nest transforms and group objects.

 <entity position='5 0 0' rotation='0 90 0'>
   <box color='#ff00aa' position='-2 0 0' />
   <box color='#00aaff' position='2 0 0' />
 </entity>

box

Renders a cube.

 <box color='#ff00aa' position='1 2 3' />


sphere

Renders a sphere.

 <sphere color='#00aaff' position='1 2 3' scale='4 4 4' />


plane

Renders a plane on the X-Y axis. Default size is 1m x 1m. Rotate it -90 in x axis to have it parallel to the ground.

 <plane color='#00aaff' position='1 2 3' scale='4 4 4' rotation='-90 0 0' />

obj-model

Renders an obj model from an http url.

  <obj-model obj-model="obj: models/rounded-cube.obj; mtl: models/rounded-cube.mtl" />

gltf-model

Renders a glTF model from an http url.

 <gltf-model src='suzanne.gltf' />

Common attributes

Position

 position="1 2 3"

Position expressed in meters in x, y, z. As viewed looking north from south of the entity, x=right, y=up, z=toward you.

Rotation

 rotation="0 45 0"

Rotation expressed in degrees as a XYZ euler angle three.js style.

Scale

 scale="2 2 2"

Scale expressed in dimensionless units in x, y, z. `1 1 1` is the default scale.

Color

 color='#ff00aa'

Color, supports only 6 letter hex colors, being 2 digits each for red, green and blue.

Material attributes

The material attributes takes a css semicolon-seperated style list of properties.

 material='color: red; flat-shading: true'