craigmoore.github.io site build: d4af15ed-60d6-5f2f-83ae-2aaefd6e7c1b github linkedIn twitter twitch email
Drupal for VR | Hello World | Banter | Github Pages
Craig Moore is currently available to hire for Drupal and Typescript contract work.
Home Drupal for VR
Using a CMS for creating VR content

Drupal for VR

Logo combination of Drupal and Banter

Building VR Content with Drupal for the Banter VR application

Banter is a Social VR platform, please see the Banter page for more information.

As the spaces built within Banter are entirely web-based, Drupal can provide a unique and powerful way to build such content using ThreeJS and A-Frame.

This is a project currently in progress, so this page includes some example screenshots :

Configuring "ActiveObjects" within Drupal

An "ActiveObject" is an abstract concept that represents an object that will be represented at runtime within a ThreeJS or Banter Scene. Within Drupal, the fields required to construct an ActiveObject represent the fields to store the data against entities within Drupal. By default, we have created an entity of type "Node" and a bundle of type "ActiveObject", and we have attached various "ActiveObject Components" (represented in Drupal as fields) to the entity bundle.

Screenshot of a web page with the ThreeJS component configuration form exposed.

Drupal Fields as attached to an entity bundle

Screenshot of a web page with the Drupal Fields of ActiveObject Fields attached.

Create a scene with Mr Doobs ThreeJS editor

Screenshot of a web page with Mr Doobs ThreeJS Editor.

ThreeJS content can be created and laid out in 3D using Mr Doobs ThreeJS and then exported as a Scene JSON file.

Importing the scene into Drupal

The Scene can then be imported into Drupal using a Drush command.

Screenshot of VSCode using a drush command to import a scene into Drupal Screenshot of a web page within Drupal showing ActiveObject entities as imported into Drupal

Viewing the content within Drupal

Once the objects have been imported into Drupal, they can be edited using normal entity edit forms and viewed on a page. At the moment, a typical ThreeJS formatter has been implemented, and then that formatter has been extended to integrate with A-Frame (and thus the Banter application).

This is how the scene looks in a piece of Drupal content :

Screenshot of a web page showing a 3D scene as loaded by ThreeJS / Aframe for consumption on the web

This is how the scene looks in Banter :

Screenshot of Banter showing the 3D scene

Using GLTF assets

ThreeJS and Banter support many file formats, that can be uploaded into Drupal, mapped to the ActiveObject field using the Token Module and displayed. This first image shows the creation of a piece of content representing a GLTF model, and the following image shows the "Khronos Duck" imported into Drupal as a file field and mapped using [node:field_activeobject_file:entity:url] as the Token mapping. Token Replace is applied during use of the JSON:API.

Screenshot of a web page within Drupal showing the creation of an ActiveObject representing the Khronos Duck Screenshot of a web page within Drupal showing applying a token to map a file field

Screenshot of the Banter application showing the user on the back of the Khronos duck

Column 1
Column 2
Column 3
Banter is created by SideQuestVR.
Copyright © 2023