3D Graphics and Virtual Reality

Practical exercise 2


Because the IT service do not have the facilities needed to run a decent VRML browser, I have decided to make do with a sort of half-solution. Obviously after spending half of the lectures learning VRML it would be nice to have some practical work on this, so here is what I would like you to do.


Create a VRML world containing at least 3 different objects and have the file ready for the start of your practical in Week 18. You can use any text editor you like to create the VRML file. By referring to the course notes and the VRML specification (now available on the web pages) you should have all you need to create a simple world.

Please remember to comment your worlds and to use a neat and readable text layout. All I really want to do is provide you with an opportunity to write a little VRML world then see what it actually looks like, so you can make it as simple or as complex as you like. I suggest that at the very least you make something like example 1 shown below, this has three different objects in it and requires using transformations. If you want to try for something more complex then thatís great.

I suggest that if you donít have access to a computer or VRML browser that you plan out your VRML world on graph paper before you start writing it. This way you can calculate any values you will need for translations or sizes. It is important that you figure out how your hierarchy of co-ordinate systems will be built, and in which co-ordinate system you will build each object. I also suggest you check the VRML specification for any nodes you are going to use - knowing things such as which way up a cone is built can be very useful.

Example 1

At the very least, you could try and recreate the original VRML 1.0 logo which consisted very simply of a red box, green sphere and blue cone all lined up together. Figure 1 shows an example of this.

Figure 1. Simple example of a VRML world.

If you want to be a bit more advanced then try making the red cube spin round, the green sphere bounce up and down, or the blue cone grow and shrink in size. Or if you are feeling really adventurous then go for all three! Hint: You can use a single TimeSensor node to drive more than one interpolator, and if you set the loop field to TRUE then it will start up as soon as you load the world and continue until you close it.

Example 2

As a more complex example, you could try creating a model of some real-world object. For example the simple desk fan model shown in figure 2. Again, if you want to try and animate this model you could get the fan blades to spin round.

Figure 2. An example model - a simple desk fan.
The blades spin round in this example.


I will bring a laptop computer, running GLView, into the practical sessions. At some point during the practical I will ask for your VRML file and we will give it a try on the VRML browser. It doesnít matter if it has any syntax errors or doesn't work exactly how you had planned - we will figure that out then, and you won't lose any marks. The aim of this practical is just so you can have a go at writing a VRML world yourself and becoming familiar with some of the issues involved. You will be awarded full marks if you produce a VRML model of anything you like, as long as it includes at least 3 different objects and you can explain to me what you've done. If you would like to attempt more complex models or worlds then that is great, I look forward to seeing what you come up with.




Peter Young,
University of Durham