Preface
ABOUT
Chong Hang Ieong (willie@cse.unsw.edu.au) is a final year Computer Engineering student in the University of New South Wales. He has a clear mind, self-motivations and flexible at his work. He knows when to make the right decisions and when to do the right tasks.
Chong Hang has worked in various companies, and is greatly involved in computer networking. His experiences range from fixing computer to setting up Internet Server for his company. However, that was just the beginning of his journey. As a member of the Virtual Campus Team, he is converting his experience to make the already interactive Virtual Campus even more interactive, and proving himself is capable of working in any situations.
Chiang Oon Tan (chiang@cse.unsw.edu.au) is an all rounded student. He always likes putting his skills to a test. He is someone who believes in "if there is a will, there is a way". He is also a final year Computer Engineering student in the University of New South Wales.
Chiang Oon has worked as an Engineer Assistant in a hard disk company. His task involved analysing faulty disks and writing programs, but none was as challenging as his current position in the Virtual Campus Team. As working as part of the Virtual Campus Team allows him to express his creativity freely, at the same time has to optimise it for speed and making it user friendly. This enables him to putting his skills to a new set challenge.
Adam Ming Kwong Ti (bdmx@cse.unsw.edu.au) puts up with computer since a very young age. He is a natural in programming, and knows more programming languages than the number of fingers on your hand. He is a course mate of both Chong Hang and Chiang Oon.
Adam has been employed by the top company in Sydney to do programming, but those tasks can only be regard as Entree for him. Virtual Campus will make the Main Course. As Virtual Campus is needed to run under various platforms, this proves to be a new challenge for him.
Chapter
ONE
We are living in a real world, a world where a third dimension exist, a world which cannot be represented by simply using pictures. Over the years, people have used pictures to create a virtual tour of a certain locations. The same applies to the Virtual Tour of our University, but is that good enough? As mention above, the world we live in consists of a third dimension where pictures are lack off. If it were five or ten years ago, where computer are not as powerful as now, using pictures to create a virtual tour is perfectly fine. However, it is not the case nowadays. Today, a normal Personal Computer (PC) at home is more powerful than a network computer ten years ago. Furthermore, with the coming technology of Accelerated Graphic Port (AGP) and 3DFX has made PC to become a monster in graphics.
This does not only apply to virtual tour; it applies to gaming industry, as well as silver screens. In the old days, in order to film a science fiction movie; nine out of ten times, a director would choose to build a model or use rubber puppets than using a 2D pictures. This is because the model is in 3D, and it can make the effects more realistic. Using a 3D model can create the realistic effect, but creating models are expensive. A lot of the times, a director will censor certain part of a movie, due to the impossibility of creating. For example, the director of Star Wars series, George Lucas removed a few scenes from the original Star Wars Trilogy due to the cost and technology. Until recently, he and his team remake the Start Wars Trilogy using silicon graphics. As nowadays, the technology is better than olden days and the cost of creating effects using silicon graphics is much more affordable than making models. Besides, it has better effects as well.
The way 3D graphics are used in gaming industry is slightly different from the silver screens. In some way, it is considered more complicated then the silver screens. As in silver screen, one only has to create a smooth 3D object and capture the animations. In another words, it has limitations to user interactive. Whereas, in gaming one has to make to graphics good, he or she also has to make it interactive also. Over the past 5 years, more and more game programmers have dropped the idea of 2D and gradually move towards 3D gaming. This is because in one hand, 3D graphics provide more realistic graphics; on the other hand it will allow the players to feel more immersive.
As we have seen above, technology is improving each day. Similar with what is happening around our daily lives. We have to keep up with the technology, so that it does not go to waste. We cannot simply take an aged task and put into a new piece of hardware and call it up to date. This is no different between changing your clothes without taking a shower first. This is meaningless, as you will smell as bad as before and after changing the clothes. The same applies to Virtual Tour; we have to keep up with the technology and covert it from 2D to 3D.
Virtual Campus is virtual reality (VR) world of the University of New South Wales Kensington Campus. On the other hand, it is also a new style of Virtual Tour for the Kensington Campus. As we all know, a VR world will allow the user to be more immersive than a 2D world. One of the reason is we are living in a 3D world, as a result, we can adapt a 3D world more easily than a 2D world.


However, Virtual Campus is not simple just 3D model of the Kensington Campus. It has more than that; it will allow the user to interact with it freely like the famous first person PC game, QUAKE. In some way, it has more depth that QUAKE. This is because QUAKE is created from nothing, everything in there is imaginative, but this is not the case in Virtual Campus. In Virtual Campus, there is real scenery exist before our eyes, and we have o capture these scenery and convert them into Virtual Reality Modelling Language (VRML).
VRML is the best way to implement 3D graphics to a Web page. Using VRML we can create a space parallel to our homepage, only more effective, designing it without any boundaries of two dimensions witch normally constrain us while making a HTML page. Using VRML we can create a dynamic world of Kensington Campus on the Internet. Besides that we can control and enhance the world with scripts, and programs. More importantly, VRML allows users to interact with the world. At the same time, we can play sound or movies within the world as well as having animated objects in the world.
Having just a 3D world is an edge over a 2D world, however this is not good enough to be regard as Virtual Tour. In order to make it regard as Virtual Tour, viewpoints were set and small programs were written for enhancement. Furthermore sound nodes and animation objects were added in order to make the world more atmospheric.
There are four versions of Virtual Campus, one with texture mapping for high-end machines and the other with only colour polygons for low-end machines. However, these two different versions will have the same features. The third and fourth versions are the texture mapped and non-texture mapped of "building introduction". These two versions will introduce each building one by one, this will speed up the virtual world and it contains information of the chosen buildings.
1.3.1 Preset Viewpoint
For the first two versions, they are the virtual world of complete Kensington Campus. As mentioned above, preset viewpoint is one of the features in here. These preset viewpoints allow the user to jump from one location to another. Thus, it makes the life of someone who has never been to University of New South Wales easier. As he or she can select a viewpoint of where he or she wants to go to from a menu and gain a first impression of how and what that building looks like. After going to a desire viewpoint, he or she can then take over the control and move around the world. This has an advantage over a picture, as picture has a fixed viewpoint whereas this one does not and it allows the user to interact freely with it.
1.3.2 Path Guideline
Follow after the preset viewpoint, there is a "Path Guideline". Path Guideline will show the user the path from a selected location to another. This acts like a "You Are Here" sign, but it has better effects. As those "You Are Here" sign will only tell you your current location, but not the path to your destination. You still have to find the path to your destination yourself. The Path Guideline will do both for you, it not only tells you your current location, and it will animate you the path to your destination with just a few clicks on the mouse. This eliminates the old style of "mouse looking for cheese in a maze" way of path guideline. Eliminating the old style means there is an improvement and improvement means more efficiency.
Having a Path Guideline is very useful to someone how has been to UNSW. However, it is not the case for an outsider. As an outsider will know nothing about UNSW, with just the Path Guideline he or she will only gain a little more knowledge of UNSW. Hence, a wizard is needed for the Virtual Campus. This wizard will give information based on the current position of the user. For example, when the user is in front of the Electrical Engineering building, the wizard will inform the user that he or she are in front of that building and what faculty can be found inside that building. Moreover, it will also provide a link, linking to the official Computer and Electrical Engineering Homepage. This will enable the user to find out more about course he or she is interested in and know more about the building he or she should head towards.
1.3.4 Live Chat
Learning things from a wizard is easy, but learning things from another person is even easier. Virtual Campus has a live chat feature, which allow all the users who are currently connected to the site to chat and make new friends. This chat can use as a discussion group as well. An outsider can ask a senior in the chat of the information, which are not included in the web page. Furthermore, he or she can learn more about the university based on different people’s viewpoint. As for the head of the school, he can learn more from the students’ viewpoint of the current academic style. From there, he or she can find out what improvement should be made.
1.3.5 Online Tutorial
With all those features, there need to have a tutorial on how to control this Virtual Campus. Thus, an online tutorial is created. This online tutorial gives a thorough information from the very basic to the more advance functions. The basic tutorial includes how to install a VRML browser for different platform to how to use the VRML browser. This tutorial proceeds slowly from the basic to more advance things like operating the Interface of Virtual Campus. Moreover this tutorial will also recommend the user which browser to install for which platform. As there are a lot of different VRML browsers available for downloading. Some browsers are better than another. This online tutorial will list out all the recommended browsers we have tested.
1.3.6 Weather Panel
A year has 365 days; it is not possible for all these day to be a sunny day or daytime. Hence, we have created a "Weather Panel" within Virtual Campus. This weather panel will allow the user to choose between day and night time by simply modifying the light intensity. Furthermore, it has features like making it rain inside the Virtual Campus. All these features enable the user to experience various conditions of the Virtual Campus.
Virtual Campus has a lot of benefits to both the creators and users. As we all know, creating a non-benefit thing is no different from wasting your precious time. Furthermore, a non-benefit thing is regarded as garbage. Luckily, Virtual Campus is not like that.
1.4.1 Benefits to the Creators
One of the most interesting benefits of Virtual Campus to the creator is probably because it is pure fun. There is no one in the world that like doing the same task over and over without stopping. The same applies to us, the creators of Virtual Campus. Virtual Campus is divided in several tasks, these tasks include gathering data of buildings, landscape, writing programs, creating textures, designing our approach toward our aim. We are free to circulate around these different tasks, thus this helps us getting motivated.
Moreover, we are free to express our creativity. As there is no restricted way of constructing a Building (3D object). The only thing we have to watch out is the final outcome. Apart from constructing a building, we can further expressing out creativity by creating an atmosphere for the Virtual Campus. This is what is missing in a 2D Virtual Campus.
1.4.2 Benefits to Publics
Virtual Campus is created using VRML; thus it is in 3D. As mentions above, 3D will provide a better perspective than 2D. Hence it has an edge over 2D. Furthermore, 3D objects can provide a view than cannot be done in 2D. For example, when zooming for a close up of a 2D image, you will lose some details of the picture. This will not happen using a 3D object. Moreover, a user can freely rotate a 3D object but not a 2D picture. Rotating a 3D object will allow him or her to examine every single spot of the object. Thus, this is a benefit to the user as the user can get to know more of the Kensington Campus using a Virtual Campus than using a 2D Virtual Tour.
Virtual Campus is very good tool for promoting UNSW. This is because it is written in VRML, and which is a standard language for describing interactive 3D objects and worlds delivered across the Internet. It does not require a special hardware or software to view it. All one needs are Internet access and a browser. As a result, people around the world can get to know UNSW campus better even before stepping his or her foot on the UNSW ground. More importantly, for overseas students, they can visit the Virtual Campus before coming over. This allows them know and understand more about the campus, so that they will not feel so foreign when they reach the university.
The compound of UNSW is not very large, but for one to fully know every locations of within the campus is almost impossible. Virtual Campus can allow the user to get to know the campus better even if he or she has been to the campus before. With the Path Guideline feature, one can find out the way to reach a destination by applying a few clicks on the mouse.
Last but not least, Virtual Campus allows the users to have a gathering in the net. It can even allow the users to make new friends in the net.
Chapter
TWO
2.1 What is the Internet?
Since there is an important connection between our thesis topic and the Internet, there is a need to give a brief discussion about the Internet, why it become so popular and the technologies involved in browsing the Web.
The Internet is an international network of computers connecting together universities, companies, research department, homes, etc. You can think of the Internet as a giant, electronic highway system. It is simply a very large collection of computers that talk to each other in a standard way. In fact the Internet is the world’s largest IP-based network. It is an amorphous group of computers in many different countries on all seven continents that talk to each other using the IP protocol. Each computer on the Internet has at least one unique IP address by which it can be identified. Most of them also have at least one name that maps to that IP address. To make sure that hosts on different networks on the Internet can communicate with each other, few rules that don’t apply to internal networks need to be followed. These rules mainly deal with the assignment of addresses to different organizations. If everyone randomly picked the Internet addresses they wanted, conflicts would arise when different computers showed up on the Internet with the same address. In order to avoid this problem, Internet addresses are assigned to different organizations through the Internet Network Information Center (InterNIC), and generally acting thorough intermediaries called Internet Service Providers (ISPs). When an organization wants to set up an IP-based network, the InterNIC will validate the application, and well assign a block of addresses. Currently, two sizes of address blocks are available, called Class B and Class C. A class C address block specifies the first three bytes of the address, and allows room for 254 individual addresses. A class B block only specifies the first two bytes of the addresses, which leaves 65,000 different addresses for use.
In the past decade, with the improvement in communication technologies and telephone networks, the Internet becomes a hot issue. Large companies and organizations began to connect their branch from different countries together through the Internet. Moreover, due to the price reduction in computer hardware, personal computer (or PC) becomes affordable, and people therefore can easily access the Internet by using a modem and the existing telephone lines. The fee for the Internet Service is also going down regularly. Another reason for the rapid growth of the Internet is that it is not limited by the boundaries of countries. People start to put more resources on the Internet, while people from other countries can freely access those resources. Therefore, the Internet greatly shortens the distance between each other, and also provides a direct and easy way of communication. There is not doubt to say that the Internet is becmoming part of our daily life.
There are various form of media within the Internet. The most common and well-known type is the World Wide Web (WWW). This is a graphic-enriched media which provides almost all kinds of information. And in fact, the rapid growth of the Internet is greatly due to the development of the WWW. Other types of traffic in the Internet include email, telnet and ftp, etc. The telnet is for remote accessing a user account and ftp is basically for file transfer.
Some of the beginners may get confused that the World Wide Web is the whole of the Internet. This implies that although the Internet consists of many different form of traffic, Web Browsing becomes the major purpose of the Internet for average users. Web browser becomes the most common tool for wandering around the Internet. It enables users to display the incredible amount of information available on the Web. Browsers from different companies, such as Netscape Navigator and Microsoft Internet Explorer, are available. However, all browsers basically display formatted text documents and images embedded within them. The text formatting is controlled by a language called HyperText Markup Language (or HTML). HTML commands are embedded within the text to achieve various text and image formatting. With HTML, users can design their own homepage and put it into the Web. Links can also be included in a homepage to connect to other pages in the Web. There are currently a lot of homepage editor software in the market, which greatly helps people to build up their own pages in few easy steps, and hence increase the content of the Web in a rapid way.
2.2 2D Vs 3D in the Internet
Traditionally, most of the web pages we are searching are 2-Dimentional. It is very likely to find a page with lots of images, with text describing those images, and links to direct to other pages. Moreover, most pages are lack of motion and not interactive. Although some format like animation gifs can make images look like moving, but users cannot interact with the motion and therefore the information provided is limited. If the contents of these pages are not specific and can be represented easily by text, then these pages should be fine. However, for example, a company is trying to sell a product through the Internet by setting up a page for that product, would it be suitable if we only put a snapshot of the product on the page?
Figure. 2D representation of an Ethernet cable.

This is a 2D image of an Ethernet cable. As we can see, different patterns are used to represent different layers of the cable. However, there is no information about the other side of the cable. We cannot also achieve any thickness information from this image. You can only guess the shape. Moreover, users cannot get an enlargement of a specific part of the object. These limitations will lead to the decrease of sales of a product. However if the same object is represented by a 3D model, users can get more information of the object.
Figure. 3D representation of an Ethernet cable.
For example, as shown in the above figure, the thickness of each layer, the shape of the cable, etc. Moreover, it would be a great idea if the users can also interact with the object. They can change the view, examine the model, and also zoom in to particular spots they want to. In this way, since customers will have a clear idea of the product, they will be more confident in buying. Together with the Internet, a product will have a chance to be known by a large population of Internet users. But problems arise in deciding what language to be used in order to build 3D models that are compatible with web browsers. It turns out that a language called Virtual Reality Modeling Language (or VRML) becomes the most suitable and powerful language in generating 3D model in the Web. With the help of VRML, lots of advantages can be achieved in different areas, apart from business. For example, in the medical point of view, the structure of a human body can be put on the Web to help people understand the various functions of the body. And for entertainment, it will be a good idea to create animations integrated with sound and put it on the web, which can be handled by the VRML efficiently. With VRML, the interactions between users and the 3D objects can be maximized together with the Internet. Users can gain a large amount of information of a particular object without having to actually see the physical object, and with the Internet, the number of users is not limited, and hence it is obvious that VRML will open up a new dimension in the 3D modeling through the Internet.
Chapter
THREE
3.1 Introduction
VRML is an acronym for the Virtual Reality Modeling Language. It is a file format for describing interactive 3D objects and worlds. VRML is designed to be used on the Internet, intranets, and local client systems. VRML is also intended to be a universal interchange format for integrated 3D graphics and multimedia. VRML may be used in a variety of application areas such as engineering and scientific visualization, multimedia presentations, entertainment and educational titles, web pages, and shared
virtual worlds. VRML has been designed to fulfill the following requirements:
Enable the development of computer programs capable of creating, editing, and maintaining VRML files, as well as automatic translation programs for converting other commonly used 3D file formats into VRML files.
Provide the ability to use and combine dynamic 3D objects within a VRML world and thus allow re-usability.
Provide the ability to add new object types not explicitly defined in VRML.
Capable of implementation on a wide range of systems.
Emphasize scalable, interactive performance on a wide variety of computing platforms.
Enable arbitrarily large dynamic 3D worlds.
VRML is capable of representing static and animated dynamic 3D and multimedia objects with hyperlinks to other media such as text, sounds, movies, and images. VRML browsers, as well as authoring tools for the creation of VRML files, are widely available for many different platforms. VRML supports an extensibility model that allows new dynamic 3D objects to be defined and a registration process that allows application communities to develop interoperable extensions to the base standard. There are mappings between VRML objects and commonly used 3D application programmer interface (API) features.
3.2 The history
In our thesis, we are using the VRML2.0 standard, which provides an ideal solution to platform independent Internet 3D modelling. However, before we reveal the powerful features of VRML, it is important to know briefly why and how the VRML standard evolves and the VRML community which has done a great deal in the development of the standard, and in promoting VRML to make it an universal standard.
In 1994, Mark Pesce, was invited to present a paper at the First International Conference on the World Wide Web. Pesce and partner Tony Parisi had developed Labyrinth, a prototype three-dimensional interface to the Web. His presentation sparked a consensus: the conference attendees agreed there was a need for a common language to specify 3D scene descriptions. Work on the VRML specification began immediately following the WWW Conference. Consequently, an electronic mailing list was set up to assist in the discussion of the specification for VRML. Within a month, there were over a thousand members. The list membership quickly agreed upon a set of requirements for VRML: platform independence; extensibility; and the ability to work over low-bandwidth (14.4 kBps modem) connections.
After much deliberation, the proto-VRML community selected the Open Inventor ASCII File Format from Silicon Graphics, Inc. as the basis of VRML. The Inventor File Format supports complete descriptions of 3D scenes with geometry, lighting, materials, 3D user interface widgets, and viewers. It has all of the features that developers need to create highly interactive 3D applications, as well as an existing tools base with a wide installed presence. A subset of the Inventor File Format, with extensions to support networking, is the underpinning of VRML. Rikk Carey and Gavin Bell adapted the Inventor File Format for VRML, with extensive input from the www-vrml mailing list, and the support of Silicon Graphics Inc.
Some of the leading technical experts on the VRML mail list then formed the VRML Architecture Group (VAG). The VAG's goal was to foster consensus in the VRML community in order to develop a scalable, fully interactive standard for 3D shared worlds. The first meeting of the VAG was held August 1995 in Half Moon Bay. The second meeting was held October 1995, in Construct's offices in San Francisco. It was at this meeting that the VAG changed its strategic focus from technical design to process guidance. This shift resulted in a Request-For-Proposals (RFP ) for VRML 2.0. The third meeting was held in February 1996 in Intervista's offices in San Francisco, to discuss the process relating to the VRML 2.0 RFP. During this meeting, the VAG proposed a formal process for the selection of a VRML 2.0 specification. The fourth meeting, in March 1996, was a return to Half Moon Bay. The VAG reviewed the RFP polling results and unanimously agreed that the Moving Worlds proposal would officially become the working document for VRML 2.0.
On August 4,1996, the official VRML 2.0 Specification was released at Siggraph 96 in New Orleans. At the fifth VAG meeting in New Orleans, the VAG finalised the formal announcement of the VRML 2.0 Specification, agreed to issue RFPs for a compressable binary format and an external authoring interface to the VRML 2.0 specification, and initiated the formation of the VRML Consortium.
3.3 Characteristic of VRML
The VRML specification defines a file format that integrates 3D graphics and multimedia. Conceptually, each VRML file is a 3D time-based space that contains graphic and aural objects that can be dynamically modified through a variety of mechanisms. VRML defines a primary set of objects and mechanisms that encourage composition, encapsulation, and extension. The semantics of VRML describe an abstract functional behaviour of time-based, interactive 3D, multimedia worlds. VRML does not define physical devices or any other implementation-dependent concepts (e.g., screen resolution and input devices). VRML is intended for a wide variety of devices and applications, and provides wide latitude in interpretation and implementation of the functionality.
Each VRML file:
a.implicitly establishes a world coordinate space for all objects defined in the file, as well as all objects recursively included by the file;
b.explicitly defines and composes a set of 3D and multimedia objects;
c.can specify hyperlinks to other files and applications;
d.can define object behaviours.
An important characteristic of VRML files is the ability to compose files together through inclusion and to relate files together through hyperlinking. For example, consider builiding a house model in a file called house.wrl. The file may also contain references to other VRML files, such as door.wrl, window.wrl etc. The enclosing file, house.wrl, defines the coordinate system that the doors and windows reside in. Each door/window file defines the world coordinate system that it resides in but that becomes a local coordinate system when contained by the house file.
Another essential characteristic of VRML is that it is designed to be used in a distributed environment such as the World Wide Web. There are various objects and mechanisms built into the language that support multiple distributed files, including:
e.in-lining of other VRML files
f.hyperlinking to other files
g.using established Internet standards for other file formats
h.defining a compact syntax.
3.4 Features and Concepts of VRML
In this session, a brief overview of some powerful features will be discussed together with examples in helping to reinforce the concepts. Most of the features described here are used within the implementation of the project.
3.4.1 VRML File
A VRML file is a textual description of the VRML world. This files describes how to build shapes, the position of the shapes, their colour, etc. The extension of VRML file is .wrl. When a browser reads a VRML file, it builds the world described in that file, and as you move around, the browser draws the world. Normally, VRML file contains these items:
The VRML Header
The VRML header is needed in all VRML files. It provides information to browsers the type of the files. For example, consider the header below:
#VRML V2.0 utf8
This header means that the file is a VRML file, complaint with version 2.0 of the VRML specification, and the file is using the international UTF-8 character set.
Nodes
A VRML file contains nodes that describes the properties of the objects built. There are nodes describing shapes, colours, lights, viewpoints, position, orientation, etc. Usually, a node contains the type name of node, and a number of fields which describes the attributes of the node. For example, consider the example node below:
Cylinder {
height 5.0
radius
2.0}
As shown, this node describes a cylinder object with fields height and radius. Both fields have numerical values assigned which specify the values of the associated fields. Note that fields are optional within nodes since each field has a default value that is used by the browser if a value is not specified. For example, a default cylinder has a radius of 1 unit and height of 2 units.
Node Names
The nodes can be given names. The advantage is that when a node is given a name, it can be re-used in the world if necessary without having to define another object with the same attributes. This can save the processing time since only the original object is processed. This can also make updating easy throughout the world since if the original object is changed, the other instances which use the original will also be changed, instead of going through all objects and make modifications. For example, to define a name for the Cylinder node:
DEF my_cylinder Cylinder {. . .}
And in making an instance of my_cylinder, we can use the USE statement like this:
USE my_cylinder
Describing Shapes
A VRML shape has geometry, that defines its 3-D structure, and it has an appearance based on material, colour and texture. These attributes are represented by two fields, geometry and appearance in a Shape node. In VRML, several primitive shape geometries are predefined, such as box, cylinder, cone and sphere, which can be used straightaway. These basic shapes can be used to create more complex objects. However these objects have to be grouped in order to do so. Consider the following simple VRML example, which create a simple hut:
#VRML V2.0 utf8
Group {
children [
# Draw the hut walls
Shape {
appearance DEF Brown Appearance {
material Material {
diffuseColor 0.6 0.4 0.0
}
}
geometry Cylinder {
height 2.0
radius 2.0
}
},
# Draw the hut roof
Transform {
translation 0.0 2.0 0.0
children Shape {
appearance USE Brown
geometry Cone {
height 2.0
bottomRadius 2.5
}
}
}
]
}
In this example, one cylinder and a cone is used to build the hut. Moreover, this two shapes are grouped together using Group{} node. Note that the node that groups together the group’s shape is called the parent. The shapes that make up the group are called its children. A group can have as many children within as possible. Moreover, groups can have other groups as children as well.
VRML Space
Since VRML deals with 3D building space, 3D coordinate system is required. The three axis, X,Y and Z are hence defined in VRML. In the 3D space, X is positive to the right, Y is positive upward, and Z is positive toward you in the space.
Events and Routes
VRML provides suitable resources for making the objects within a world dynamic. For example, a box within a world may move with a mouse click, trigger a sound and so on. In this case, wiring instructions are required. Wiring involves a pair of nodes to wire together, and also a wiring route, or path, between the two nodes. When a route is built between two nodes, one node can send information to the other nodes through the route. The information sent is called an event, which usually includes floating-point values, colour values, or 3D coordinate values. A more complex dynamic world can be built by routing multiple nodes together.
Node Inputs and Outputs
In order to send and receive events, some points within a node has to be able to connect to the outside. Most of the VRML nodes can be wired. For example, nodes that create lights have an input jack for turning them on and off. If this jack is wired, then the switching of the light can be controlled. Some nodes may have more than one input and output jacks as well, so that different attributes can be changed dynamically. A node’s input jack is called an eventIn which sends events, while the output jack is called an eventOut, which simply receive events from the other end of the wiring.
Wiring Routes
A VRML circuit is built by describing a route from the eventOut of the sending node to the eventIn of the receiving node. When the first node activates the route by sending an event, the event travel to the second route through the route, and the node reacts. The type of reaction depends on several factors:
For example, when an event TRUE is sent to the eventIn of a light node, and if the light is on already, no changes occur. However, if the light is previously turned off, it will be turned on by this event.
3.4.2 Building predefined Shapes
As mentioned in the previous session, shape has geometry and appearance, both defined by a Shape node. A shape’s exact geometry and appearance are controlled by the choice of nodes and by the field values of these nodes. There are several basic objects predefined by VRML that can be used in Shape node. These objects include Box, Cone, Cylinder and Sphere nodes. Each of these node has one or more fields that can be modified to change the dimensions of the objects. The appearance of a shape is described by the Appearance and Material nodes.
The Shape Node
The Shape node has the following syntax:
Shape {
appearance NULL # exposedField SFNode
geometry NULL # exposedField SFNode
}
The value of the geometry can be changed by routing an event to the exposed field’s implied set_geometry eventIn. When an event is received, the geometry field is set, and the new geometry can be sent out through the geometry_changed eventOut. The geometry field value can be a Appearance node and a Material node.
The Appearance Node
The Appearance node specifies appearance attributes and can be used an field value of the appearance field in the Shape node.
material NULL # exposedField SFNode
texture NULL # exposedField SFNode
textureTransform NULL # exposedField SFNode
The value of the material field can be a Material node. The default NULL value is equivalent to a default, glowing white material.
The Material Node
The Material Node specifies the material attributes and can be used as a value to the material field of the Appearance node. It basically contains fields used to modify the material of the object such as ambient intensity, diffuse and emissive color, shininess, and transparency etc.
The Primitive Shapes as geometry field value
There are some primitive shapes defined in VRML that can be acted as the value for the geometry field in the Shape node. There nodes include:
The Group Node
The Group node is used to group specific object in the world to make them as one entity. There is a field children[] which specifies a list of child nodes to be included in the group. Usually, the children will be other group nodes.
3.4.3 Positioning, Rotating and Scaling Shapes
In VRML, shapes are built centered around the origin and hence any number of coordinate systems can be created with a world. Each coordinate system is positioned, or translated relative to another coordinate system. When a new coordinate system is relative to another, we say that the new coordinate system is a child coordinate system that is nested within the parent coordinate system. Moreover, that parent coordinate system can also be nested by other parent. Hence this parent-child relationship creates a family tree of coordinate systems. The root of this tree is the world coordinate system, which encompasses everything in the world. When a shape is translated, it is moved relative to the world coordinate system. The power of this concept is that, you can create each piece of the world independently. Each shape created is built within its own coordinate system. Then several such systems can be grouped together within a parent’s coordinate system. The parent can then be grouped with other shapes to form a larger parent coordinate systems, and so on.
When a new coordinate system is created with a Transform node, it contains the appropriate fields for translating, rotating and even scaling the object in that coordinate system. For translation, we specify the translation distance in the X,Y and Z directions between the parent’s origin and the new coordinate system’s origin. When dealing if rotation, the values of the rotation field in the Transform node can be modified if required. However, we have to specify both the rotation axis and the rotation angle and direction in order to make an object to rotate in a coordinate system. The following table shows some common rotation axes:
|
Direction |
Rotation Axis Values |
|
To the right along the X axis |
1.0 0.0 0.0 |
|
Up on the Y axis |
0.0 1.0 0.0 |
|
Out along the Z axis |
0.0 0.0 1.0 |
Table. Values of some rotation axes
The rotation angles is specified in radians. The angles can be positive or negative, depending on the direction you want to rotate the object with respect to the rotation axis specified. By default, the center of rotation is located at the origin of that coordinate system. However, it can also be specified.
Sometimes it may be necessary to scale the size of the object created. This can be easily accomplished in VRML by modifying the value of the scale field within the Transform node. VRML is able to scale a coordinate system, increasing or decreasing its size relative to their parent coordinate system. In this way, the shapes built within that coordinate system can also be scaled. To perform scaling, the scale factors of the three axis have to be specified. This means that you can scale an object differently on each axis. We can also specify a scalecenter other than the origin as it is the case with rotation.
3.4.4 Inlining Files
It is very common that different objects are created in different world and in different files. The most trivia advantage is that those objects can be reused easily. For example, it is a good idea to built a door in one VRML file, since there is a great chance that it will be used by several buildings, so that whenever a building needs that door, we can use that it. Another advantage is that when one of the object is complex and is made up of a lot of different objects, it will be hard to manage when we build all objects in the same file. Our project is a good example, Each building consists of thousands of polygons, and it would be very hard to made all the buildings into one big file. Moreover, it is difficult for maintenance too. When something is wrong, it will be a nightmare to good through that long file just to find out one mistake.
VRML actually provides a good solution to that problem. Any VRML file can be inlined using an Inline node. The location of the file to be inlined is specified in the url field in the Inline node. The URL tells the browser where to get the file, and can indicate files on the Web or on the local hard drive. Moreover the Inline node includes fields in which the size and center of a bounding box for the inlined files can be specified. The bounding box provides the benefit of delay reading, so that when the bounding box is outside a certain range from the viewer, the inlined file is not load until the viewer is within the range, so can save the time of downloading the files until it is really needed.
3.4.5 Using Faces in building Shapes
The primitive geometry nodes predefined in VRML can be used to create various simple shapes, but they may not be enough if more complex objects are going to build. Sometimes it is quite difficult to construct irregular shapes using those primitive geometry. For example, in developing our project, we have encountered many cases that are not satisfactory when using basic shapes to construct because they are not realistic enough in this way. Fortunately, VRML provides a very flexible set of nodes for users to construct geometries using points, lines, and faces. In this session we will concentrate on the discussion of using faces in building complex shapes, which we frequently use this technique in constructing objects in our project.
A VRML face is a flat shape like a square or triangle. A face set is a collection of these faces. In order to build a face, it is required to specify the perimeter of the face using a set of coordinates. The area within the face is filled and shaded to make it looks like solid. In building faces like this, we need to build a list of coordinate indexes each with a corresponding coordinate in X,Y,Z. The VRML browser will automatically connect those points together according to the order of the indexes. Then the perimeter is closed by connecting the last coordinate back to the first one. The area formed within will be filled. For example, if a square face is required, the coordinates for the four corners are shown in the following table:
|
Coordinate Index |
Coordinate (X,Y,Z) |
|
0 |
-1.0 -1.0 0.0 |
|
1 |
1.0 -1.0 0.0 |
|
2 |
1.0 1.0 0.0 |
|
3 |
-1.0 1.0 0.0 |
Table. The coordinates for the four corners of a square
To build a square, a sequence of index can be defined such as, 0,1,2,3. The VRML browser will then follow the sequence to find out the corresponding coordinates, and then join them together in that order. It is recommended to build faces using coordinate indexes listed in counterclockwise order. Since only the front face are drawn to save processing time, there is a convention that the front of the face is the side of the face you see if its perimeter is traced in counterclockwise. Building 3D shapes using Indexedfaceset is simply building more faces and joining them together. VRML enables us to mark the end of one face and the beginning of the next by using the special coordinate index –1. With the help of Indexedfaceset, a lot of complex objects can be built efficiently and look realistic without having to join primitive geometry together.
3.4.6 Elevation grids
In building virtual worlds, sometimes it is necessary to build a piece of land or a terrain. For example, in our project we have to build a landscape of the campus so that various buildings can be put onto it to constitute a realistic model. Although the IndexedFaceSet node provides an efficient way in building different shapes, the landscape may often covers a large area, and so making up an index with all corresponding XYZ coordinates will be a time-consuming and non-efficient process. However, VRML provides the ElevationGrid node designed specifically to build terrain grids and landscape. Using this node, we only have to specify the dimension of the terrain grid, the spacing between grid points and the elevation at each grid point. Faces are then automatically created for each grid square to create the terrain grid.

There are fields within the ElevationGrid node that are allowed to change the field values, such as the xDimension, xSpacing, zDimension, zSpacing and the height, which is the elevation. It is important to node that the spacing between grid points can greatly influence the quality of the shape created. For example, consider the following figures which shows a puddle splash built by using a 10x10(fig (a))elevation grid and a 40x40 elevation grid (fig(b)).
(a) (b)
Fig (a) A puddle splash having 10x10 grid elevation grid and (b) having a 40x40 grid
As shown in the above figures, it is quite obvious that 10x10 elevation grids is not enough to reveal the structure of the puddle splash. On the other hand in fig(b), a smoother, realistic model is the result of using more grids. However, one drawback in using more grids is that more faces are actually used to make up the model, and so more time is needed in processing, which may slow things down. Therefore, in our project, we have also considered carefully the number of grids to be used, so that a realistic landscape can be built without using too much processing time.
3.4.7 Level of Detail (LOD)
As more and more objects are built within the world, it will take the browser longer and longer time to display them on the screen. Consequently, if the model gets even bigger, the browser will spend almost all the time processing and have not enough to display the objects, and cause the world seems to be not moving at all. We must keep the balance between lots of details for maximum realism and quick drawing for maximum interactivity. However, there is a technique which can solve the problem. In real life, when something is far enough, you cannot see as much detail as it is close to you. Therefore, in our virtual world, we can a high detail object with a low detail one when it is far away from the viewer. Objects that are really far away need not to be drawn at all. In this way, the browser will have less polygons to draw, and so can increase the interactivity. In VRML, this technique can be applied using the LOD (level of detail) node. For example, in our project, we have implemented the LOD so that when the viewer is far away from a building, that building will actually represent by using a block of approximately the same dimensions as the original one. Since only one block is required to draw instead of all the polygons that made up the high detail building.
In order to implement LOD on an object, first of all several different versions of the object with various details have to be created. After that, those shapes can be enclosed within the LOD node. There is a field within the LOD node called level, which are used to include those versions of the object. The highest detail version is listed first. There is also a level field within the node, which is used to provide values to the browser as to where to display the other versions of the object based on how far away the viewer is from the object. The distance between the viewer and a shape is called the range. The first value in the range field specify the distance at which to switch from the first to the second version of the shape, and so on.
3.4.8 Controlling Viewpoint
If a world contains only one object, it would be fine to let users to interact with the object freely without any help. However, when the world is getting bigger with more objects added to it, the user may find it hard to navigate in the world. The may ‘lose their way’, where they cannot find a particular object in the world. Therefore, a lot of time will be wasted in finding information within the world, and interactivity may lose most of its benefits. In order to overcome this, some sort of guidance should be available in order to help users in finding what they need quickly and efficiently. A good way is to set up predefined viewpoints in the world. Every time the world is loaded, the browser automatically positions the viewer at the predefined viewpoint position and the viewer is allowed to navigate from that point. The viewpoints can then act as reference points in the world so that the viewer still got some points to relate to if they are lost.
In VRML, viewpoints are controlled by Viewpoint nodes that specifies a viewing location within a coordinate system. There is also a viewpoint stack, which is maintained by the VRML browser. The Viewpoint node on top of the stack is the current viewpoint and is the one the browser uses to control the position and orientation of the viewer. Note that when the coordinate system of the current viewpoint changes, then the viewer within this viewpoint is also changed as well. There is a field called description within the Viewpoint node which can be used to give a name to a viewpoint. This name will be displayed by the browser in a viewpoint menu, which shows all viewpoints available. In our project, we have created viewpoints for all major buildings and sites so that when the viewer wants to look for a particular building, they can just choose it either in the menu button implemented ourselves, or use the existing one from the browser. Note that for some browsers, such as cosmo player, an option is available to set whether to fly through from the current viewpoint to the other or not. If so, the viewer will fly through the path between these two viewpoints. If not, the viewpoint will be changed immediately as a slideshow.
Apart from the Viewpoint node, there is also a node which is used the control the behaviour of the avatar. An avatar is a symbolic-virtual-world representation of a real-world person. The features of an avatar can be divided into two parts:
In VRML, the NavigationInfo node is available to control both aspects. There is one field that we have concentrated on in our project, which is the visibilityLimit field. This field controls a range which is visible from the viewer. Anything which is out of range will not be drawn. This technique can greatly reduce the number of polygons to be drawn at one time, since in our project, a lot of buildings can be drawn only when the viewer approaches them.
3.4.9 Colours and Textures
In order to make worlds more realistic, not only the shapes of the objects have to be looks similar, but also the appearance of those objects have to look like real objects too. As mentioned earlier, each Shape node contains a field called appearance, which basically controls how an object may look like through the colouring and brightness etc. VRML provides a node called Material node that specifies the material attributes and may be used as the value of the material field in an Appearance node. Some of the fields in a Material node include controlling for diffuse and emissive colour, transparency, ambient intensity and shiniess etc. Setting different values in these fields may result in quite different appearance. For example, you can make the object looks shiny, looks glowing, or even make it transparent. Within the virtual campus, there are constructions where we have made them transparent, such as windows, doors, etc. We have also added the shiny effect to the metallic objects to make them more realistic.
Although in some cases, the Material node can give a fairly enough feeling of realism, there are cases which need extraordinary amount of visual details. Consider a tree. From far away, the tree looks like a large greenish blob. When we move closer, a trunk and leafy canopy can be seen. More closer and branches and clumps of leaves are visible and so on. In that case it is impractical to create a complex shapes in order to represent this extraordinary detail object. Therefore a technique called texture mapping evolves which allows us to take a picture from the real world and map it on any shape in VRML worlds. Texture mapping can save a lot of time. The building of complex shape is not required, but instead just take a picture of the real object and map it on a simple shape, say a box. Moreover, VRML provides a lot of option in texture mapping just to make it easier to use.
VRML supports four of the most common image file formats for storing texture images: JPEG, GIF, PNG, and MPEG. Both colour images and greyscale images can also be used. Transparency images can be used as well. When an image with pixel transparencies is mapped to a shape, the pixel transparencies control transparency from point to point across the shape. Therefore, where on the image is transparent, the corresponding location on the shape is also transparent. The ImageTexture node specifies texture-mapping attributes and may be used as the value of the texture field in an Appearance node. One drawback of texture mapping, from our experience is that it really depends on hardware support. For example, in our project, we have created two versions of each buildings, one texture-mapped, and one with no texture, but with more polygons to increase its detail. When we tested using the Indigo machine from Silicon Graphics, the mapped displayed in an unacceptable slow speed. However, when we tested with the high-detail non-mapped one, it runs quite fast. Moreover, it’s surprising that when the mapped one is tested on a PC, it still runs faster than in the Indigo machine, which is more powerful than a normal PC. Therefore, the performance of texture-mapped world really depends on the architecture and hardware support of machines.
3.4.10 Lighting
Lights in a VRML world are equivalent to the purpose as lights in the real world. Apart from the default headlight which is automatically created by the VRML browser, there are other types of light sources available and can be placed anywhere within the world. VRML supports three node types to control lighting effect: PointLight, DirectionalLight and SpotLight. Suitable use of these nodes can make the world more realistic and also can also act as devices to highlight some important spots of the world.
A point light is a light source that emanates light in a radial pattern is all directions, as if the light rays are coming from a single point. A point light is created by specifying its location in the world, its intensity and its colour. The light intensity can be varied from 0 to 1, and the colour of it is controlled by RGB colour. A directional light is one that seems to be situated in an infinity point in the world, so that the light rays are parallel and point to the same direction. The sun in real life is similar to the directional light in VRML. A directional light is created by specifying an aim direction for the light. The aim direction is defined the same way as defining rotation axes. The direction is the line between the origin and the second point which is under our control. Directional lights also support intensity and colour fields. Note that the default headlights from VRML browsers are actually a white directional light which aims forward and always illuminates anything in front of you. A spotlight is a light aimed in a specific direction, and constrained so that its rays emanate within a light cone. In VRML, it is created by specifying the location, aim direction, and the cutoff angle and beam width to control the angular spread of the beam.
In our virtual world, besides the default headlight that we were using, we have also put into the world a spotlight which always follows the position of the viewer so that it’s position and orientation is always the same as the viewer. This spotlight is acted as a torch in our world The cutoff angle and the illumination level of the light source can be changed using the EAI interface which will be discussed later.
3.4.11 Adding background and Sound
In real life, we are always surrounded by the sky, no matter it is a shiny or rainy day. In some 3D model, the surrounding is mostly outdoors, and so the sky can be seen by the viewers easily. Of course the sky and the background can be constructed by using shapes and polygons. However, this would waste the browser’s drawing time on something not worth to do. To create efficient world backgrounds, VRML provides the Background node, which can be used to control the sky and ground colours and may be set up a panorama of background images as well. This node enables us to create an outdoors environment with using any polygons, and therefore can save drawing and processing time. Moreover, with the help of background binding, the background can also be changed according to some events or as time goes by as an animation. In our project, we have made use of background binding to change the colour of the sky to make a feeling of lightning by flashing to another background colour, and restore the original colour quickly. The colour changing from morning to night of the sky can also be accomplished using this method.
The realism of the world can also be increased by the integration of sound by using the Sound node provided by VRML. For example, a background music can be created. Sounds can also be added that are triggered by circuits, such as the sound when closing doors, etc. In order to add sound to the world, two components are involved, which are the sound source and the sound emitter. The sound source provides a sound signal, and the sound emitter turns the source’s signal into sound you can hear. In VRML, two types of sound format are supported, which are the wav file format and the General MIDI type 1 file. Moreover, there are field inside the Sound node which specify the minimum-range ellipsoid and the maximum-range ellipsoid that surrounds the Sound node’s location. When the viewer is inside the minimum-range ellipsoid, the volume can be heard in full range. However, when the viewer is between the minimum and the maximum range, then the volume will be fading until it reaches the border of the maximum range ellipsoid. If the viewer is outside the maximum-range ellipsoid, then no sound can be heard at all.
In our project, we have put in several Sound nodes throughout the campus. For example, we have put a node with the sound of birds as a general background sound. We have also put in some nodes of people talking in places with lots of people, such as library lawn, Quadrangle, etc. to simulate the actual situation.
3.4.12 Animation Position, Orientations and Scale and the use of Proximity
There are several components and nodes in VRML that allows us to put in animations into the worlds. These includes:
For example, in our Virtual campus, we have made some animations within the world. This includes the open of the door. When a person walks near the automatic door in real life, the door will open and when the person walks away from the door, it will close automatically. We simulate this action by using first using a ProximitySensor node, which will send an eventOut to the eventIn of the TimeSensor node. This triggers the clock and it will then send and eventOut to the PositionInterpolator node’s eventIn when the clock’s fractional time changes. The PositionInterpolator will then send the coordinate of the position to the eventIn of the set_translation of the door object, and so the door will open and close base on this concept.
3.4.12 Sensors
The TouchSensor, PlaneSensor, SphereSensor and CylinderSensor nodes sense the viewer’s pointing-device move, click, and drag actions for the shapes that are built within the same group as the sensor node. When these nodes are enabled, the viewer actions are converted into outputs that can be routed to other nodes to trigger animation or enable the viewer to manipulate shapes in the world.
Chapter
FOUR
4.1 What is Cosmo World?
Cosmo world is a program by Cosmo™ Software, a Division of Silicon Graphics. Cosmo World is a program for creating Virtual Reality Modeling Language (VRML) codes. It has capability of creating VRML codes without having to worry about looking at the codes. It can say that it is similar to some 3D programs like 3D studio Max, Corel Dream 3D. The only different is the files created using Cosmo World are saved in VRML 2.0 format.
4.2 What is the Advantage of using Cosmo World?
Cosmo World is a "What You See is What You Get" (WYSWYG) program. This helps the user to know what he or she is doing while creating a VRML object. As we all know a picture saves a thousand words, this WYSWYG function allow to the user to spot what and where he or she went wrong while creating a VRML object. However, this will not be the case if the VRML object were hand coded. VRML is not like other program where there is a compiler to tell you where you went wrong. When there is an error or mistyped in the coded, the VRML browser simply won’t load the VRML world up. Thus, using Cosmo World can gain a lot of advantage. It not only makes creating VRML easier, it also helps preventing careless mistyped.
4.3 What functions are available in Cosmo World?
As a VRML editor, naturally Cosmo World has to support all the basic nodes, like the Shape node, which is use for defining all the shapes in VRML. Then, there is the Appearance node specifies the appearance attributes of the shape. Material node which specifies the material attributes of the object. There are also, Box, Cone, Cylinder, and Sphere nodes, which are used for creating object shapes.
Apart of supporting these nodes, Cosmo World has an editor for each of these nodes. Hence, using the editor for the specific nodes, the user can create a 3D object without having to look at the VRML codes. As for more advance users, they may want to create an unusual shape. Cosmo World has an IndexFaceSet editor and Extrude Shape Editor. However, as a user, we found that sometimes it is easier to create an unusual shape hand coded than using Cosmo World.
Chapter
FIVE
5.1 The acquisition of relevant information
In order to get started of the started of this thesis project, a certain amount to information and materials are necessary so as to act as our reference materials. Based on these materials, we can go and discover more relevant materials for constructing the virtual campus environment. In this session we will discuss about how we obtain resources for this project, and also the procedures taken in processing the information in hand.
5.2 Obtaining information from various Departments
Being the students in this campus for a few years, we should be able to get a quite clear picture of the overview of the campus, such as the locations of buildings, how they look like, and perhaps their approximate heights. However, when it comes to be put on paper, guessing is not enough. The best way is to find some information with accuracy so that we can base on, and may even make some minor modifications on those values if necessary. The first thing we thought of if to seek help from different departments within the campus. The reason is that there are always some departments on campus which may due with the campus environment. For example, the publishing department is one of these. Since their job mostly concentrate on various kinds of publications about the University, it would have a high possibility of having some sort of information about the campus which is quite precise and accurate. Therefore we approached the Publications and Printing sections located in the Chancellery. We spoke to the helpful staff there about our needs, and we are presented with a map similar to the one printed inside the almanac.
The map provides us a clear picture of the general overview of the whole campus. However, since this map is only for general publications, details are hidden, such as scales and heights of each constructions within the campus. Therefore, we had to seek more references before we can start straightaway. Then we had talked to the Work and maintenance Department situated near the Fig Tree Theatre. This department mainly deals with the job of maintenance planning of the campus, so more detailed information could be found here. After talked to the staff there, we had got a detailed real scaled map containing information about the point heights of the buildings. This map tends to be a very helpful throughout the whole development process of the project, since every time we planned to construct new buildings, we have to refer to this map for the actual dimensions of those buildings. Moreover, we can also figure out the distance between buildings so that we can accurately put the finished buildings together, and hence this map acts as our main reference about the campus in our project.
Although the map just described is very valuable to our project, one essential element is not available from the map, which is the elevation of the landscape of the campus. It is not hard to recognize that part of our campus is built on a steep slope. This means that the elevation of the ground changes quite dramatically from one point to the other. For example, say the ground level of the Electrical Engineering building is quite different from that of the Library, although they are quite close together. Therefore, in order to make our model more realistic, we have to figure the height of the ground on different spots of the campus so that we can construct a landscape which looks similar to the real campus. After another discussion with the Work and Maintenance Department, we had got a grid plan of the campus with the spot height of the ground on many regular spots. Contour heights are also available on the map, where the heights of several spots are the same, for example on a hill. With this piece of information, we had built a landscape model (discussed later), where all buildings are put on it and form the basic model of our virtual campus.
5.3 Obtaining information by taking photographs
After we have collected enough fundamental information, we were able to constructing the model. Our first approach is to construct buildings first. The reason is that we had already got the actual sizes of buildings from the maps we got. Moreover, our campus is composed of a large amount of buildings situated
all over the place, therefore an early start would be necessary. Another reason is that, through the construction of buildings, we can gain more experience on the tools we are using. Every building will make us more familiar with our tools and hence after a few buildings, we can make the full use of the existing tools. Therefore, we can speed up the construction time for each building at an early stage. However, we cannot merely rely on the values on the map in building realistic 3D models. Therefore, actual observations of the real buildings is necessary, and we accomplished this by taking photographs everywhere within the campus, maintaining concentrating on buildings. For this reasons, we have borrowed a digital camera, so that the photos can be stored in files, instead of doing film processing, which is expensive and not efficient in referring. We can refer to the files easily by opening a display window. The main purpose of taking photos is to capture the characteristics of buildings. An model will look realistic if it contains the key features of the original. It is very easy for people to lose the details of a piece of information as time goes by. Therefore as we went to observe the buildings, we brought along the camera. The advantage is that those photos helped us to save the time in observing the buildings again and again only to refresh our memory. As an example of the photographing we did, consider the two photographs below, which show the Library building from different angles. With this sort of information, we can start planning what shapes are used to construct the buildings, and how many of those objects are needed in order to make them look realistic.


Figure. Photographs showing different views of the Library.
5.4 Taking approximate measurements of the buildings
As we took photographs while we were observing the buildings and surroundings, some brief notes also have to be taken. Although those photos provides most of the information we required in constructing buildings, there may still be some bits of information which are not provided in the photos. For example, if a buildings consists of a row of poles, a snapshot may not capture the whole row, and so the number of poles is not sure. In this case, we had to made some brief notes and drawings about number of poles, approximate distance between poles, and so on. Sometimes we might also write down the color or texture patterns of the objects, since the photos may provide wrong color patterns due to different lighting from different angles. However, only approximate values are good enough since modifications will be made anyway when the buildings were being constructed to suit the needs.
Chapter
SIX
6.1 Planning
When designing a VRML world we are free of normal limitations such as gravity or laws of structure but keep in mind that our work can be rejected by the public (eg. because of a wall that blocks a passage). We also have to avoid unnecessary polygons-due to a larger file or increased polygon count our world can be also rejected. Our aim is to make a world that can be shown and accepted to anyone. Moreover, we need to ensure that the world we created looks similar to the real life Kensington Campus of UNSW.
For construction of a large VRML the easy and most efficient way is to use a VRML modeller or a professional CAD application. Worlds created using VRML modeller can then be transferred to VRML using its filter. We used Cosmo World to create most of our world, some parts were manually typed, and we also have a written Visual Basic program to combine our worlds.
When building a VRML world, there are a few basic steps that we have to take. First of all, we have to gather the information. After that the information will be processed. When the processing step is completed, the information will not ported over to VRML directly, it will undergo a designing step before it is ported over to VRML. When the porting step has completed, colouring step will begin, follow by texturing step. When a world is complete, it will be tested and at the same time Level of Details (LOD) will be set.
6.2 Collecting Data
To create a VRML world, the very first things we need are the coordinates of the 3D model. As this is a 3D model, every node in the world is closely related to another. One little mistake can lead to a different outcome. Thus, when we collect the data, we have to pay particular attention to the scale. As have mention before, this Virtual Campus is a VRML model of the actual Kensington Campus, so we have to make sure that the buildings we created is the same as the building in real life. We have to make sure that other people can recognise the building from the VRML model.
Before we start our data collecting session, the only information we have is a little map in the student diary. Obviously that is not good enough to use as a reference. This is because the map in the student diary is too small, and we all know the smaller the scale, the larger the error is going to be. Therefore, the very first thing we do is to get a larger map of Kensington Campus from the appropriate departments. For more information of those departments, please see above.
Even though we have obtained a larger map from the appropriate departments, we still cannot start out world building part. This is because, the information in the map is an overhead view of the campus. In another words, it does not have any information of the every single floor. As a result, we have to measure every floor by ourselves. For example, Quadrangle building is a 5-storey structure. In the map, we only have the parameter of the building, but no other information, especially information on the Cafeteria, Ground Floor and First Floor. To obtain information on those floors, we have to measure it personally.
With only 3 people in Virtual Campus team, it is very hard to obtain the exact readings of all the buildings in the campus. Hence, we utilise the method where professional programmers used, estimation. We measured all the floors we possibly could, but for those out of reached area, we will estimate it to as close to the real building as possible.
For example, if there are N windows on a building and they are evenly spread out. We take the building width (B) minus the total number of windows (N) multiply by the window’s width (W) and divide it by N to obtain the separation of the window (S).
S = (B - N*W)/N
While collecting the measurement for the buildings, we collect information on building colour as well. Different buildings have different colour. Again, our aim is to keep the colour buildings in Virtual Campus as close to the colour of the buildings in real life as possible. However, we discovered that for some buildings, they would look better and more similar to the buildings in real life if we use artificial colour. More detail of colouring the buildings will be discussed below.
Similar for texture mapping, while we were collecting information of building measurements. We jot down the shape of the windows and doors of the buildings. All these information will be used when we map the buildings. How we mapped the buildings will be discussed below.
6.3 Designing and Processing Data
When the collecting data procedure is done, we move on to the Processing Data step. In processing data, the data we collected will be reorganised, and from there we will decide what and how to do with the data. In another words, we have to plan our designing style. This is because, there are a lot of ways to implement a building, some ways are better than another. For some method, you will lose some details but gain some speed. On the other hand, there are methods that make u lose speed and details. The way we choose the method depends on how large the original building is. For example, Central Lecture Block (CLB) is a small building. Thus, we will try not to remove any details from it. On the other hand, Quadrangle is a huge building; some details have to be sacrificed in order to gain speed.
That was just the beginning of our design. In this designing, we have to look ahead; we have to decide how each building should be stored. Our aim is to come up with a design, which is suitable for a modem download rate and easy for future maintenance.
Based on the side of University of New South Wales. Even before we started our Virtual Campus, we can tell than Virtual Campus will be a huge file if we use only one file. From that point, we have come to a conclusion, as large file will take longer to download. Thus it is not suitable for modem download via Internet. Furthermore, using large file will make the world slower. As we have to wait until the whole world to load up before we can interact with it. As in term of maintenance, it is harder to main large file than smaller files. Similar with a book, it is easier to read a book that is divided in to chapters than a book that is not.
In order to make file smaller, we choose to use WWW Inlines. That is to have a world importing other worlds. As a result, we use one file to store one building, and this building file can further divided into smaller files by having inlines for different parts of the building. For example, Electrical Engineering Building and Mechanical Engineering Building have similar shape, thus we can create an inline and let the two buildings share. This will not only make the loading time of the building faster. It will also prevent inconsistent shape for the buildings.
Besides using inline, we also use a lot of Nesting Coordinate System to improve the performance of Virtual Campus. Nesting Coordinate System is to create a coordinate system within coordinate systems. This Nesting Coordinate System is created using the DEF and USE command in VRML. Using DEF and USE enable shape specifications to be shared. Thus, it will save a lot of typing and shorted the length of our VRML files. Additionally, shapes named by DEF and instanced by USE all shares the same node specifications. For example, in front of the Library there is a series of red glass door. Instead of writing VRML codes for all the doors, we can use DEF and USE to shorted to code. Below is an example of how DEF and USE were used in one of the Buildings.
DEF Qpole Transform {
children DEF QUAD_Pole Transform {
children LOD {
range [ 40, 100 ]
level [
Inline {
url "inline/QUAD_pole.wrl"
bboxCenter 0 0 0
bboxSize 0.75 3 0.25
}
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.0625
diffuseColor 0.8 0.609 0.275
}
}
geometry Box {
size 0.75 3 0.25
}
}
Group {
children [
]
}
]
}
translation 6.387 1.5 -0.237
scale 0.5 1 0.5
}
}
Transform {
children USE QUAD_Pole
translation 0.799999 0 0
}
6.4 Porting to VRML
Having the design planed and data processed. We then port the data over to VRML. As mentioned above, we used Cosmo World to create most of our world. Cosmo World is a VRML editor, more importantly it is WYSWYG. This allows us to notice our mistake when we spot some funny shape in our VRML world. For more information on Cosmo World, please refer to the section on Cosmo World.
Before we start porting the data over to VRML codes. In order to make our lives simpler in the future, we decided to make the direction of our buildings the same, that is we make the x-axis equal to East in real life and z-axis equal to South. This agreement may not seem very useful, but it will come in very handy when we combine all the building into Virtual Campus. As when we do the combination, we do not have to rotate the building. If there were only 5 of 10 buildings in UNSW, rotating every building is not a problem, but this is not the case. There are over 50 buildings in UNSW. Hence this decision is very necessary.
When we start porting the data to VRML, we always keep one phrase in mind, "Large polygon counts can reduce the performance of Virtual Campus". In order to reduce the polygon counts, we simplify the building in our Virtual Campus while maintaining the "look alike" with the real building. For example, the stairs in Virtual Campus, instead of implementing every single steps of the stair we use an angled platform for replacement. This is because an angled platform utilises much less polygons than actual steps. A 5-step stair will use up to 20 polygons whereas an angled platform only requires 2 polygons. This replacement will greatly help in Virtual Campus’ performance.

Apart from using Cosmo World to create our world, some of the worlds were manually keyed in, this due to the limitation of the Cosmo World in the lab. For example, the Cosmo World in the lab does not know create Text node for VRML. It can only create a node called CoTextGraph, which is not compatible with other VRML browsers. Furthermore, using Cosmo World to create an Elevation Grid will end up with the same result. Hence, we have to manually key in VRML codes for some of the worlds.
As mentioned earlier, we divide the Virtual Campus using WWW Inline into to smaller files so that it is easier for maintenance. However in order to combine all these smaller files into Virtual Campus is not that easy. There are three ways we can do to do the combinations. First is to use Cosmo World as the tool for combination, second is to do it manually by hand, and third is to write a program to combine all the files together. Using Cosmo World is not recommended, this is due to the version of Cosmo World does not support the VRML world we created manually. Furthermore, if we do the combination in Cosmo World, it will be very slow, as Cosmo World has to load all the buildings into memory before the combination can be done. We did not pick the second choice either. This is because combining all the files by hand is very complicated, and we have to make sure every character we key in is correct, otherwise the world would not run under the VRML browser. As a result, we picked the third choice, which is writing a program to do the combination for us.
This program is written in Visual Basic, the reason this is the better choice is because it is 100% compatible with all the manually keyed in VRML world. Moreover, it does not requite to load up the all the inline before combining the buildings. Hence, it is faster than using Cosmo World for combining the buildings. Last, it will not perform careless mistake like typing mistake. For more details on our Visual Basic Program, refer to the Visual Basic Section.


6.5 Landscape using Elevation Grid
In our virtual campus, we have used the function of elevation grid to create the landscape of the whole campus. The values for making up the landscape is obtained from the grid map we got from the Work and Maintenance Department. We actually divided the map into uniform squares and find out the elevation on each vertex of the squares. After that, we got sufficient information for making up the elevation grid. A snapshot of the landscape created is shown in the figure below.

Figure. The landscape of the Virtual Campus
6.6 Sound within Virtual Campus
By the use of Sound node in VRML, the realism of the Virtual Campus can be greatly increased. We have actually implemented several sound nodes with the campus. For example, we have put a node about the center of the campus with the sound of birds as the background sound of the world. The range of this node is large enough to be audible any place in the world. Moreover, different nodes with smaller range are put in different place over the campus with different source. For example, we have put a node near the library node with a sound of people yelling and talking. We have also put another sound node near the main entrance with the sound of moving cars to simulate the atmosphere around the street.
6.7 Animating the world
Inside the Virtual Campus, the animation technique in VRML has been used to increase interactivity within the world. An example is the animation door, located in the ground floor of the Chancellery. First, a ProximitySensor node is put in the centre of the door. Within a certain range to the sensor, the enterTime node of the sensor will be triggered, which is routed to a clock. This clock is then routed to a PositionInterpolator node which specifies the path of the animation of the door. The same will happen when the viewer moves away from the sensor, except a different PositionInterpolator node is being routed.
6.8 Lighting effect in the world
In our world, we are basically using the default white directional light source as the main light source of the world. Moreover, with the help of external Java Interface (discussed later in detail), a torch is simulated by creating a spotlight which always follow the position and orientation of the viewer. Moreover, this intensity and the cutoff angle of this light source can also be controlled.
Using the default light seems to be fine most of time. However, not all browsers manipulate lights source the same way. For example, we have encountered some problems in the Newfire torch browser(for PC, which support 3Dfx acceleration) when using the default light source. The world seems to be very dark and therefore we overcame it by putting several directional lights pointing to different angles to make the world brighter.
6.9 Viewpoints setting in the world
Viewpoints play an important role in our Virtual Campus. Since our campus is fairly large, with a lot of buildings, people who are unfamiliar may find it hard to find a way to a specific building. Therefore, in setting up viewporints, the viewer can actually jump to specific location instead of walking on his own. Moreover, when the viewer is using the viewpoint, the online wizard will also be activated and updated with the corresponding information about the location the viewer is looking at. For example, if a person has changed his viewpoint to Library, then the wizard will show the information about the library, and will also provide suitable links for additional information.
6.10 Colouring the Buildings
When the VRML porting is done, we obtain a world in black and white. This world may contain all the building shapes but it is not enough to let a stranger know what it is. It still does not have the information on the colour of the buildings. Without the colour it is very hard for a stranger to recognise the building. Thus colour is needed to add into the Virtual Campus.
There are two ways of colouring a building, the first way is to use Material node, and the other way is to use Color node. The material node specifies material attributes and may be used as the value of the material field in an Appearance node. Whereas the Color node creates a list of colours and maybe used as the value of the color field in coordinates-based geometry nodes, such as the PointSet, IndexedLineSet, IndexedFacedSet, and ElevationGrid.
Color node is use to control parts of a shape, and material node is used to control the overall appearance of a shape. In Virtual Campus, we apply both these two nodes. For the object that only has a one colour we will use the material node. On the other hand, for object with different colour sides, we will use the color node.
Using both material and color node may make the building look even close to the real life building. However, these two nodes will only give out the overall colour of the building. It will not colour say, the door brown and the window blue. In order to colour the window blue and the door brown; we have to crop the shape of the window or door out of the original polygons before it can be coloured separately.
Although cropping a window or door out of a polygon can make the building to have windows, at the same time it also increases the total number of polygon counts of that building. Cropping a window out of a polygon may seems that doubling the number of polygons, but it is not the case. It actually increases the polygon counts by 5.
As mention above, the more the polygon counts the lower the performance. In order to have the windows and not the large amount of polygon increment. We use other method to make the windows. That is we created a new polygon and places it on top of the original polygon. That way, instead of increasing the total number of polygons by 5. We increased extra two polygons for each window placed.

6.6 Texturing the World
With the buildings coloured, the windows added. We have a fully coloured building. However, there are still some details missing. This is because the real world is filled with an extraordinary amount of visual detail. Just that the wall of a building, a wall is made of bricks. Using just colour is almost impossible to implement a wall with all the bricks. Even if it can be done, it will use up thousands of polygons. Which is not advisable.
In order to gain all these detail back, is to use textures. Textures can create extraordinary detailed shapes, and it saves a lot of time, since we don’t have to create a new polygon for each window or door. Furthermore, when seen from a distance, a texture-mapped object can fool the viewer into believing what they see. In directly this implies that "large polygon counts can be reduced by use of textures".
Furthermore, when using colourful objects due to a large Material node performance falls, solution is to use Texture node. Best performance Texture node shows on objects such as wood furniture, bricks, plants, paintings and similar. Textures can be created in any paint program as long as it is saved in JPG or GIF format.


In order to texture a building, the first thing we have to do is create the textures. When we create a texture, we have make sure of a few things. First, the left of the texture has to be able to join with the right, only that way the texture can be used as infinitely repeated texture image.



When the textures are created, they will be mapped into the buildings using the texture coordinates. Texture coordinates enable us to select a relevant piece of a texture image and map that to a shape. For some part, these textures will be rotated before mapping into the building for better results.




6.7 Testing and Optimising the World
When the world is completed, we have to test it locally and globally (on the Web) to insure that every one can visit our Virtual Campus. We tested it under different platform using different platform. The thing we watch out for when testing is the speed and compatibility.
For the speed, we modified the world to make it faster by adding Level of Details (LOD) and Visibility. Setting LOD is the have different version of the same thing in the same node, when one if very close to the object, the full details will be shown, and when one gradually moves away lower and lower details of that object will be shown. This can greatly help in increasing the speed of Virtual Campus.




Visibility works in a similar as LOD, but instead of sensing the object from the viewer, visibility sense whether a box-shaped region in the virtual world is visible from the viewer’s position and orientation. In another words, when a user is at the main gate of Virtual Campus, the buildings located at the upper campus are not loaded up.
Chapter
SEVEN
7.1 Introduction
Building Information DataBase (BIDB) is a Windows 95/NT Program that implements by our group. The reason of creating this program is for maintenance purpose, since we would like to provide a good and easy interface not only in the Virtual Campus web site but also in the Virtual Campus construction and maintenance environment. The BIDB provide the full Graphic User Interface (GUI), people can easy to update the Virtual Campus as they wish to.
The BIDB provide a safety space for our data to store, since it is re-readable, changeable and easy to maintenance. The Information that BIDB include are as below,
7.3 Features Overview
The BIDB program is used to generate the VRML main code for the UNSW Virtual Campus. It provide the exact location of where the Building should be located, Auto Z-axis generation which will adjust the Building landscape level corresponding to the university landscape file, the landscape file is created by our group member. More, the Animation Pathway, which can simply click the mouse on the UNSW 2D road map and create the 3D pathway included in the source file generation. Further, the BIDB even try to increase the performance of Virtual Campus in the standard computer system by implementing a primary level of Level Of Detail (LOD) that create a basic building outline to let user view faster through the internet. Also, due to the compatibility problem, BIDB add a function that converts the ElevationGrid (a node type in VRML) into indexface (another node type). Since indexface can be support by most of VRML2.0 partially compatible browser or plugin such as Torch by New Fire, CosmoPlayer for Silicon Graphic version 1.01. Furthermore, in order to save the time for updating the Java Panel of the system, BIDB even can generate partial component of the Java code that related to the Building viewpoint, path, object name and even more.
7.3.1 VRML Generation V1.0
The first version of the BIDB is mainly acted as a simple DataBase, which store the building information. The reason of developing this program is to maintain the Building information out of the VRML file, since it is too difficult to edit the VRML file with lots of varies data inside, it is better to generate the file from the database instead. So, the first version the BIDB include just a simple map of UNSW, generates the VRML source file without Z offset, every building in the scene are at the same Z level. Which Square House and Samuels Building are in the same level!


7.3.2 Landscape Import V1.2
As we know, the UNSW campus is located in the middle of the hill, it is impossible to present our Virtual Campus in a horizontal plane of land. So we decided to calculate the landscape of the University and put in the VRML format. We get the landscape paper map from the Work and Maintenance Department and we create it into the ElevationGrid format. The reason that we choose as the ElevationGrid because it provide the small file size and smooth surface which is very suitable for Internet. However, the ElevationGrid file is hard to read and we cannot get the Z offset of the file as we suppose to be. Finally, instead of calculation, we pretend to update the BIDB by adding a parser to read the VRML ElevationGrid node, and add the getZ() function that can calculate the Z-coordinate automatically.
7.3.3 Animation Pathway Recorder V2.0
After finish the main design of the Virtual Campus layout. Next step have to do is to implement the function that the Virtual Campus planned to have. In our goal, we would like to provide the Multi-user interface, Road Director, Information Directory and Free Walk. Road Director is the first part that we intend to do. As we know that is the most exciting stuff that we can put into the VRML interactive component. However, calculate for the pathway is time consuming and is hard to maintenance and adding new pathway. Then we implement a new add-on to the BIDB, which is a new and powerful GUI that support Adding Check Point to the Campus. Once the checkpoints are set, then we can make pathway from one checkpoint to the others. The path can create by within ten single mouse clicks within five second, which is fast and good for presentation and further maintenance.
7.3.4 Level Of Detail V2.1
As soon as some of the large building in the UNSW Campus is built, the user will suffer from the heavy resource used by the CosmoPlayer in PC, since it is a Netscape/Java base program without any Windows95/NT support, it become unexpectedly slow in browsing. As a result, we have to make the primary level of Level of Detail (LOD) to increase the speed of VRML world. The lower LOD object is generated by BIDB so which make the loading time of the Virtual Campus at least ten time faster than before.
7.3.5 MiniMap, Better LOD, Add Stuff Function V2.2

The speed of the Virtual Campus is the bottle neck of our design, as we put more building into the scene, we find out that even Silicon Graphic feel pain with our thesis. So we try to make a Mini-VC (Mini-Virtual Campus).
Also we find out that the base LOD is too simple that people are not easy to recognise which building it really was. The BIDB then update by adding another Add-On with Zoom function which can more accurate to sketch the Virtual Campus and build up the Mini-Map, which can also be used as the LOD. At the same time, we need to add the Road scene as well, which is the front door, the stair, tree and etc. We then add an extra function in this Add-On to let the sketch can record the Road scene object.
7.3.6 ElevationGrid To IndexFace Convertor V2.3
After finish the overall Virtual Campus VRML component, except the code on interface, we have to due with the compatibility of our VRML scene, since it is an Internet product, we have to make it available everywhere. We try different Browser and get the best two of different platform. Some of them are still under development and without the ElevationGrid Node of VRML, like SGI CosmoPlayer 1.0.1, CosmoWorld 1.0.1. After the convertor is out, we are able to run more widely available, though the quality of Indexface landscape is lower.


7.4 Release
Although it is not really a release program, a import event that have to mention about is, the Building Information DataBase is base on the developing procedure for a Virtual City, which is base on global condition, not only for the UNSW Virtual Campus. The Programs are able to change to any other area without virtual construction in a few easy step.
Chapter
EIGHT
8.1 VRML and Java
In order to provide a interactive world, the VRML 2.0 (VRML97) specification has included the Script node. The Script node is used to program the behavior in the scene. The function of the node is to receive events that are given out from the other nodes or user action sensor, and then perform some programming codes that change somewhere else inside the scene. The Script Node Reference are shown below:
Script {
exposedField MFString url []
field SFBool directOutput FALSE
field SFBool mustEvaluate FALSE
eventIn eventTypeName eventName
field fieldTypeName fieldName initialValue
eventOut eventTypeName eventName
}
The Script node supports Java, JavaScript and VRMLScript. Which is written in the url field,
url "vrmlscript:
function {}"
o