Flex-VR Content Model (Building Configurable 3D Web Applications with Flex-VR) Part 2

Complex Content

The Complex Content pattern simplifies creation of complex 3D presentations consisting of objects with different roles and behavior. In this pattern, a presentation space is associated with a content pattern (Sect. 5.4.3), which defines a structure of categories of content objects and communication channels between the categories (method signatures, action statements). Moreover, a pattern may provide default implementations of selected methods and actions. VR-Beans assigned to the particular categories inherit behavior definition from the pattern, but can override the default implementation with their own, specific behavior. In this way, it is possible to configure presentations with arbitrarily complex structures.

Complex Space design pattern

Fig. 5.11 Complex Space design pattern

With the use of a content pattern, a designer may create a behavior-rich presentation by simply assigning content object instances to particular categories. A single object instance may be assigned to several categories. The role and behavior of a content object in the presentation depends on the categories it is assigned to.


Each category contains objects with a specific role and behavior, and therefore it implements a specific interface. In the example presented in Fig. 5.12, category User Interface/Out implements display(text) method. The category interface is specified by a pattern designer (a programmer), but the assignment of particular objects to this category is performed by a presentation designer (a domain expert). There may be no objects implementing this method assigned to this category (text will not be displayed), there may be one object (e.g., a text window), but there may also be more objects (e.g., a 3D text object and a 2D banner).

Some methods have default implementations in the pattern. For example, the default rotate() method may rotate all scene components created by a content object by the same angle. However, some objects may override the default implementation. For example, the Skeleton object may override this method to rotate several components around a common axis.

In the example presented in Fig. 5.12, there are two objects assigned to category User Interface/Out: Text Window and Sound Player. When an object calls method User Interface/Out/display(text), the method is called in both objects. However, only the Text Window object has a non-empty implementation of this method. The Sound Player object has no implementation, and therefore it inherits only an empty implementation from the content pattern. This solution brings some small performance overhead but frees the presentation designer from performing programming tasks.

In a situation when the same set of content objects is used with different patterns, it may occur that there is no direct correspondence between the methods defined in the pattern and the objects. In such a case, in order to enable the use of such objects, it is necessary to override the default pattern-object inheritance rule by explicit specification of which object method corresponds to the pattern method. This can be achieved by the use of object presentation properties. For example, if the User Interface/Out category requires two methods: correct() and incorrect(), indicating that a user has answered correctly or incorrectly, the content designer may assign to this category a sound object having only the play(sound) method. In such a case, two mapping properties need to be defined: User Interface/Out/correct() ^ play(correct) and User Interface/Out/incorrect() ^ play(wrong).

Complex Content design pattern

Fig. 5.12 Complex Content design pattern

Categories defined in a content pattern act as software component interfaces. There are dependencies between the categories, but not between particular objects, which may be assigned to the categories (Fig. 5.13). While a pattern defines the overall structure of the presentation, the objects assigned to categories by a content designer provide the actual implementation of particular methods and actions. The assigned objects also contain specific media components such as 3D models and sounds. Therefore, entirely different presentations can be achieved by assigning different collections of objects to presentation spaces with the same content pattern.

Depending on the design of a content pattern, the interfaces may be designed between concrete categories (as in Fig. 5.13) or may be global. Global interfaces require unique naming schemes for communication channels—methods and public values—but impose less constraints on the design of particular VR-Beans, which do not have to fit to the categories defined in the pattern.

Complex Content: categories as software components

Fig. 5.13 Complex Content: categories as software components

Complex Content: global interfaces as communication channels

Fig. 5.14 Complex Content: global interfaces as communication channels

In Fig. 5.14, an example of a pattern is presented with global communication channels. The Button component activates the touch() method, which is handled by the Game scenario object (redirected to start() ). The scenario object gen- erates events such as display() and play() without knowing which objects (if any) will handle these events. It also sends events such as move() and rotate() to concrete VR-Bean objects, e.g., the Helmet object.

Flex-VR interactive virtual museum exhibition.

Fig. 5.15 Flex-VR interactive virtual museum exhibition.

The use of content patterns significantly simplifies the design of behavior-rich 3D applications, at the same time providing the level of flexibility that enables a user to configure the application from different elements in a meaningful way.

Next post:

Previous post: