JanusVR Documentation

[BUILD] Markup Language: Room Tag & Contents

<Room>
<Object>
<Text>
<Paragraph>
<Link>
<Image>
<Image3D>
<Sound>
<Video>
<Ghost>
<Particle>
<Light>

Room

Having defined a list of assets via the Assets Tag, we are now ready to place them within the webspace. The <room></room> section of any webspace contains a list of assets that will appear within the webspace when viewed through JanusVR.

EXAMPLE:

The following example defines an AssetImage named "tree" and then places a copy in the environment at position 0 0 0. The entrance portal is located at 0 0 5 via the pos attribute attached to the Room tag.

<FireBoxRoom>
 <Assets>
  <AssetImage id="tree" src="testimage.jpg" ></AssetImage>
 </Assets>
 <Room pos="0 0 5">
  <Image id="tree" pos="0 0 0" ></Image>
 </Room>
</FireBoxRoom>

Attributes:


Text

The Text tag allows the addition of 3D text to the room.

EXAMPLE:

The following example shows a user placing text in the world.

<FireBoxRoom>
 <Assets>

 </Assets>
 <Room>
  <Text pos="5 5 5" fwd="0 0 1" col="0.5 0.8 0.5" scale="2 2 2" locked="false">example text</Text>
 </Room>
</FireBoxRoom>

Attributes:


Object

An Object refers to an instance of 3D geometry placed in the room. Objects can be used to define both the geometry of the room, as well as the boundary for the room, by using the collision_id attribute, detailed below.

EXAMPLE:

Here is an example Object, which is an instance of an AssetObject with id "room_adventure", which is also used as a collision model. It is locked, at position "0 0 0", faces direction "0 0 1", and will be coloured dark green.

<Room>
 <Object id="room_adventure" collision_id="room_adventure" locked="true" pos="0 0 0" xdir="1 0 0" ydir="0 1 0" zdir="0 0 1" scale="1 1 1" col="0.2 0.3 0.2" ></Object>
</Room>

Attributes:


Paragraph

The Paragraph tag allows the addition a generated image which contains text, use this instead of "Text" when you want to display a large amount of text within the room (either this, or create your own image with text in it).

EXAMPLE:

Like with the text tag, the paragraph's text content is placed between the opening and closing Paragraph tags. Here is an example which adds a Paragraph to the room at position "5 5 5" and facing direction "0 0 1".

<Room>
 <Paragraph pos="5 5 5" fwd="0 0 1" col="0.5 0.8 0.5" scale="2 2 2" locked="false">example paragraph's text</Paragraph>
</Room>

Attributes:


Image

An Image is represented in 3D as a rectangular shape with thickness 1/10 of the maximum width or height. The appearance is much like art done on canvas wrapped around a wooden frame. The dimensions are such that the aspect ratio of the image is preserved. Transparent images are supported and can be used to interesting effect.

EXAMPLE:

Here is an example Image.

<Room>
 <Image id="caffeine_img" pos="-10 2 -5" fwd="1 0 0" scale="1.75 1.75 1" ></Image>
</Room>

Attributes:


Image3D

An Image3D is geometrically the same as an Image, but its texture uses two different images, where each is shown to either the left or right eye. When JanusVR is used with the Oculus Rift, this can produce a 3D effect. On a traditional display, only the "left eye" image will be shown.

EXAMPLE:

Here is an example Image3D.

<FireBoxRoom>
 <Assets>
  <AssetImage id="horse_left_img" src="horse_left_img.jpg" ></AssetImage>
  <AssetImage id="horse_right_img" src="horse_right_img.jpg" ></AssetImage>
 </Assets>
 <Room>
  <Image3D left_id="horse_left_img" right_id="horse_right_img" pos="-10 2 -5" fwd="1 0 0" scale="1.75 1.75 1" ></Image3D>
 </Room>
</FireBoxRoom>

EXAMPLE:

Image3D also supports side-by-side ("SBS") or top-bottom formatted images, where the image for both eyes are contained in a single file. To use this, set the left_id and right_id to the same AssetImage id. By default, the image will be assumed to be split horizontally left and right for left and right eyes. This default behaviour can be changed by specifying the stereo_split attribute, which takes one of four values: horiz_left_right (default), horiz_right_left, vert_top_bottom, vert_bottom_top.

<FireBoxRoom>
 <Assets>
  <AssetImage id="img_lr" src="lr.jpg" ></AssetImage>
  <AssetImage id="img_tb" src="tb.jpg" ></AssetImage>
 </Assets>
 <Room>
  <Image3D pos="-5 1 -5" left_id="img_lr" right_id="img_lr" ></Image3D>
  <Image3D pos="5 1 -5" left_id="img_tb" right_id="img_tb" stereo_split="vert_top_bottom" ></Image3D>
 </Room>
</FireBoxRoom>

Attributes:


Sound

A Sound plays a specific AssetSound when the player enters a rectangle defined on the XZ plane, which is used to "trigger" the sound. One can also specify whether the sound should loop once triggered, or only play back once. To get ambient sound or music to play for the room upon entry, use a very large rectangle to trigger the sound (or at least contains the room's entrance portal), and set the sound to loop.

EXAMPLE:

Here is an example Sound, which plays "music_sound" on loop when the player's X position is between -100 and 100, and Z position is between -50 and 50.

<Room>
  <Sound id="music_sound" rect="-100 -50 100 50" loop="true" ></Sound>
</Room>

Attributes:


Video

A Video plays a specific AssetVideo. The video can be controlled by left clicking on it (stop and play). You can specify whether the video should loop once playing, and whether the video should start playing automatically when the room is entered. Multiple Video's can be associated with one AssetVideo without any extra performance penalty (useful if you want the same video to appear at multiple locations in the room). The video will appear in the room as a rectangle, and the ratio of the height and width dimensions will match that of the video itself, preserving aspect ratio. All videos in a room are stopped automatically when the user leaves the room.

EXAMPLE:

Here is an example Video, which plays "vid_id" within a rectangle positioned at "0 2 -5" and facing "0 0 1".

<Room>
  <Video id="vid_id" pos="0 2 -5" fwd="0 0 1" ></Video>
</Room>

Attributes:


Ghost

A Ghost refers to an instance of a recorded avatar within the room. Properties for the ghost invariant to the recording, such as scale, colour, and custom geometry used to represent the ghost can all be specified. When no geometry is specified for the "head" and "body" parts of the ghost, a default boxy appearance is used. Since a Ghost is a recording, there are options to set the recording to loop and to auto_play on room entry.

EXAMPLE:

Here is a simple example.

<FireBoxRoom>
 <Assets>
  <AssetGhost id="ghost" src="ghost.txt" ></AssetGhost>
 </Assets>
 <Room>
  <Ghost id="ghost" auto_play="true" ></Ghost>
 </Room>
</FireBoxRoom>

EXAMPLE:

Here is a more complicated and complete example, where AssetObjects are used to define the geometry for the head and body of the ghost.

<FireBoxRoom>
 <Assets>
  <AssetObject id="rikku_head" src="rikku_ghost/rikku_head.obj" mtl="rikku_ghost/rikku_head.mtl" ></AssetObject>
  <AssetObject id="rikku_body" src="rikku_ghost/rikku_body.obj" mtl="rikku_ghost/rikku_body.mtl" ></AssetObject>
  <AssetShader id="rikku_shader" src="rikku_ghost/rikku_shader.txt" ></AssetShader>
  <AssetGhost id="ghost1" src="ghost1.txt" ></AssetGhost>
 </Assets>
 <Room>
  <Ghost id="ghost1" shader_id="rikku_shader" head_id="rikku_head" head_pos="0 1 0" body_id="rikku_body" scale="1.5 1.5 1.5" cull_face="none" loop="true" auto_play="true" ></Ghost>
 </Room>
</FireBoxRoom>

Attributes:


Particle

Particle creates a particle system, where each particle is most often a quad rotated to face the user, but each particle can be any kind of geometry defined by specifying an AssetObject. To set the texture for the quad, set the image_id attribute. To specify geometry other than a quad to use for each particle, specify the id attribute which matches an AssetObject. For each particle, it's initial position, velocity, acceleration, colour and scale can be specified, as well as an additional random attribute which will be added, covered below:

EXAMPLE:

Here is an example which creates a "waterfall" effect.

<FireBoxRoom>
 <Assets>
  <AssetImage id="water_particle" src="water.png" ></AssetImage>
 </Assets>
 <Room>
  <Particle pos="-0.85 4 -0.25" scale="0.1 0.1 0.1" vel="-1 0 0" accel="0 -9.8 0" rate="100" count="200" lighting="false" image_id="water_particle" duration="1.5" loop="true" rand_pos="0 0.1 0.5" rand_vel="-0.5 0 0" rand_accel="0 0.5 0" col="0.5 0.5 0.5" rand_col="0 0 0.3" ></Particle>
 </Room>
</FireBoxRoom>

Attributes:


Light

Light creates a lighting element which casts on to any geometry with the lighting attribute set to true. This in turn can be used to create dynamic lighting effects like sirens, lamps, spotlights and the like.

EXAMPLE:

The following creates a spotlight.

<FireBoxRoom>
 <Assets>

 </Assets>
 <Room>
  <Light js_id="14" pos="0 7.5 6.7" xdir="0 0 0" ydir="0 0 0" zdir="0 -1 0" col="#ffe5bf" light_intensity="100" light_cone_angle="0.8" light_cone_exponent="40" light_range="12" ></Light>
 </Room>
</FireBoxRoom>

Attributes: