Adding interactivity to your world takes it from a static environment to a rich living world. VRMLmagic provides a simple to use system to enable you to quickly add interactions to the objects in your world. Interactions are made up of two parts, firstly you will choose the type of event that causes the action to occur (eg. when user clicks on object) and secondly you will choose/set the action that takes place when this event happens. All of this is done through VRMLmagics dialog system and requires no programming on your part. The following sections cover interaction in more detail.
Interactions can be added to the world as attributes of objects (ie. objects are sensitive to user interaction and can generate the actions you set). To add an interaction to an object, firstly bring up "Objects Settings" dialog (double-click object or select it and use menu Objects - Edit Attributes...). This brings up the Object Settings dialog as follows:
In the bottom left corner of this dialog is the "Interactions" area, this allows you to click on the type of interaction you wish this object to be sensitive to (for more detail on the specific types see the following section). The tick boxes to the right of the types indicate if this object is (or is not) sensitive to this type of action. If it already is sensitive you can click the button to change the actions/sensitivity.
You will notice the small comment on the dialog showing "* interactive in final output, not in preview windows", this is important to keep in mind as it is telling us that when we set an action such as a Touch action (eg. so that when user clicks on it it changes color), that action can only be tested by previewing the final saved world in a webbrowser. It WILL NOT function in the view windows of VRMLmagic, this is because clicking is already used in VRMLmagic to allow you to move/manipulate objects. Hence all "actions" only work in final output not in view windows.
When you click on one of the action types (eg. Touch) you will be shown that Event Handlers dialog (see the Touch version below).
Setting an action to take when an event is detected is essentially the same for all event types and involves several steps:
When you first set the action you will get a request dialog for the information required (eg. the new color to use), if at a later date you wish to change these values you can simply use the "Click to Edit" button (see above) to adjust the values. Another note regarding these attributes is that in some actions you will be given a checkbox "Revert_when_Inactive", if selected this allows you to tell the action to go back to its initial state (the state prior to the action occurring) when the action completes.
When you bring up the "Object Settings" dialog you see the four types of interaction in the bottom left corner. You can add one or all of these types depending on your particular needs. The following sections outline each type and how to use them.
There are two types of "Touch" sensitivity and they are:
Neither of these types require arguments, if you set an action then the object will be sensitive to touch, if you DO NOT set any actions then the object will not be sensitive. You do not need to specifically indicate sensitivity status, VRMLmagic will work that out.
Click events are a one off action (ie. on a click do an action), however IsOver events can have an ongoing/continuous action (ie. while user is still over continue doing action). While the user remains "Over" the system receives a flow of Over events and thus this type of sensor is suited to looping/continuous type actions (eg. spin ...).
A common use for Touch events is to have a looping type action while IsOver is active (eg. Spin Object while Over) and then a one off action event on a Click Event (eg. Go to URL). As with all action types setting the action to take is covered above.
A proximity action is an event (an InRange event) generated when a user moves into (and remains within) the proximity of the object (eg. like a sensor that detects when user is within a given range and then turns on a light or takes a similar action). The objects range of sensitivity can be set by entering a value in the Range field. While the user remains "InRange" the system receives a flow of InRange events and thus this type of sensor is suited to looping/continuous type actions (eg. spin ...). As with other actions, when you specify an action this enables InRange sensitivity, otherwise VRMLmagic leaves it disabled.
This can be particularly useful in helping to create spaces that only come to "life" when the user moves into them. As with all action types setting the action to take is covered above.
A dragging action is an event where the user clicks on and then drags an object in the 3D world. This event can be thought of as feeding a flow of "Drag" events while the drag continues. Hence the actions available (in the Pre-Defined set) reflect this. They include such things as "Rotate Object with drag", "Resize with drag", etc. In this sense the actions available for dragging are different to the common set found for most other action types. They are more specific but can be very effective for generating interactive content that reacts based on user actions. As with other actions, when you specify an action this enables Dragging sensitivity, otherwise VRMLmagic leaves it disabled.
This can be particularly useful in helping to create spaces that enable the user to manipulate items (eg. drag them around, drag to size etc). As with all action types setting the action to take is covered above.
A visibility action is an event (an IsVisible event) generated when this object enters the users field of view (eg. like a sensor that detects when the user can see this object). While the object remains "Visible" the system receives a flow of IsVisible events and thus this type of sensor is suited to looping/continuous type actions (eg. spin ...). As with other actions, when you specify an action this enables IsVisible sensitivity, otherwise VRMLmagic leaves it disabled.
This can be particularly useful in helping to create spaces that only come to "life" when the user can see them. As with all action types setting the action to take is covered above.
The pre-defined actions provide you with a simple interactive way of adding action to your world. By default VRMLmagic comes with around 80 pre-defined actions, intended to cover the commonly desired actions. These fall into several categories:
These actions make use of the VRML standards support for sensors and scripting and as such are a complex item. However from your point of view you can simply select the action and interactively set its attributes to achieve what is a complicated programming result.
We will be adding more actions to VRMLmagic as time goes by. If you have a particular request for an action email us at firstname.lastname@example.org giving details of what you would like to see. Our intention is to provide a default set of actions to cover most common uses. If the demand for particular actions is there we'll look to add them in future versions.
The simple answer here is no, although it is technically possible. This is really only an option for experienced programmers. However if that describes you, we are keen to encourage a development base (ie. a group of developers who can independently extend the capabilities of VRMLmagic).
So if you'd like to develop your own actions email us at email@example.com and we'll help out where we can.
Sometimes you want to cause events to happen to objects other than the one being interacted with (eg. change B's color when A is clicked on). VRMLmagic enables you to do this by providing actions on Linked items.
Setting up such an action is similar to the standard action setting in that you still bring up the objects Settings dialog and you still select the action type. The difference is in the action that you select. For example to set the color of another object (call it B) on a click on (object A) you would:
Note that if you were setting the attribs of a linked light you would need its ID which can be obtained by selecting the light and using the menu Lights - Edit Light Attributes...
As the example demonstrates all you need to do for an action to work on a linked item is to use a "Linked Object/Light: ~~~~" pre-defined action and specify the correct ID for the linked light/object.