Backgrounds | Lights | Navigation


 

 

Including a background in your Virtual World

This can't be done within Cosmoworlds so we will have to edit the VRML code itself.

First open the file in Jot or WordPad depending on your operating system.

Then just under the line that says

#VRML2.0 UTF CosmoWorlds 

put the following text in your file.

backGround { 

bottomUrl    ["yourimage.gif"]
backUrl       ["yourimage.gif"]
frontUrl       ["yourimage.gif"]
leftUrl         ["yourimage.gif"]
rightUrl       ["yourimage.gif"]
topURL       ["yourimage.gif"]
            }

The terms (called fields in VRML) bottomUrl, backUrl ...   allow you place images in the infinite distance.  These fields make a cube that your viewpoint is always within.  For example, the backUrl puts your image at z = -infinity and the frontUrl field puts your image at z=+infinity.  You can use the same image or different images in each field depending on the concept you are trying to model.

back to top

Lights

Since the Sun is basically just a big point light that is the appropriate node for use in our solar system models. However, you must be aware that in reality the Sun is very far away and the light rays coming from the Sun are parallel, unlike the light rays from a close light bulb.
Lights are easy to add in both VRcreator and CosmoWorlds, but some of their properties are not easy to edit in either program. The following node or something similar is what you should look for in your VRML file.

PointLight {

ambientIntensity 0
attenuation 1 0 0
color 1 1 1
intensity 1
location 0 0 0
on TRUE
radius 100

}

The color and intensity fields are used in the computation of the vertex color for objects in your world. They apply light of the given color and intensity to the bobject, which is mixed with the objects's own color to produce a final shade for that vertex. For example, a blue light shining on a red object will make it look purple.

The ambientIntensity field is added to the ambientIntensity of the object's Material node. The total ambient intensity is then multiplied by the diffuseColor and added to the overall color of the object to make it brighter. This simulates the effect in the real world where rooms with many birhgt lights tend to make all objects brighter, even those in dark corners. This is because light scatters from the numerous reflections, and even from interactions with particles in the air. So for objects like the Earth and Moon, they have a very low diffuseColor because they do not create their own light, but reflect sunlight.

The radius defines how far your light extends in your world. So for the node above radius is set to be 100 meters. If you have an object at 110 meters away from your point light it will not see the light, so you will have the make the radius larger. A good value is 10,000 or so.

attentuation is important because in the reality light drops off as the distance squared. That is, if you walk from 2 to 4 meters away from a light source the intenisity of the light has dropped by a factor of 4. To simulate this real world effect in VRML the following values should be used in the attenuation field

attenuation 0 0 0.01

back to top

Navigation

The following code snippet can be included early in your VRML file. This snippet usually should go right after the first line of program.

NavigationInfo {

avatarSize [0.25, 1.6, 0.75]
headlight FALSE
speed 1.0
type "FLY" "EXAMINE" "WALK"

}

avatarSize defines how big you are as you walk/fly through your world.
headlight defines whether your world starts with the headlight feature on (TRUE) or off (FALSE). If you want to show phases of the Moon this needs to be set to FALSE.
type allows you to set the type of interface for your users. If you want to avoid the gravity problem the should be set to FLY. However, some browsers don't recognize FLY so the other two type of interface should be included as a fallback.
speed allows you to set how fast you or a user moves through your world. If speed is set to 1 and your scale is in meters, then you will walk at 1meter/second.

back to top