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 {}"
or even calling a script outside the world,
url "script.class" (Java)
The node is able to receive and send an event by eventIn and eventOut field, and generate output events in response to the incoming events. The VRML can perform animations and some complex calculations inside the node such as parabola and lighting. The Script node supports the most popular Script language such as JavaScript, Java and the new VRMLScript. There are many Internet games that already base on the Java Script Node and VRML to provide amazing 3D quality for Internet users. However, we can't just separate the VRML world with the other internet program, and so many companies start to introduce an interface that can make a connection between VRML with other programs, so that developing 3D world will be more easy and suitable for users’ need. The Sony has come first in developing the stand alone VRML browser called Community Place which supports the External Java Interface that can get a Java Windows out of the VRML. The Liquid Reality provides Java standalone browser to let people add their java component in it and recompile it. For the CosmoPlayer, the only one available is a plugin of Netscape and has the Java external connection with the Netscape and other Netscape plugin. Java Applet is also supported. Since Netscape is a cross platform Internet browser, the Cosmoplayer will soon support most platforms as well.
CosmoPlayer with its External Authoring Interface (EAI) becomes one of our thesis main components. The EAI lets the VRML gets control with the outer world. The EAI allows 4 methods of accessing the VRML scene:
The External Authoring Interface is implemented after the Script Authoring Interface (the interface used by scripts inside a Script node). The first 3 access types above are conceptually identical to this interface. For type 1 access, a Browser object is available to the applet to give access to the Browser Script Interface. For type 2 and 3 access, a pointer to a node can be obtained at which point events can be sent to its eventIns and the value of its eventOuts can be read.
There are 2 conceptual differences between the External Authoring Interface and the Script Authoring Interface. The first has to do with obtaining a node pointer through which its eventIns and eventOuts can be accessed. When creating a VRML file a Script node (and therefore the script it contains) can get a pointer to a node with the USE construct (see Instancing). Since the applet has no implicit access to this instancing mechanism an explicit method is provided to get the node pointer from its DEF name string. The 4th access type (eventOut notification) is also conceptually different since creating a ROUTE is not possible between the VRML scene and the applet. The applet must create a method to be called when the eventOut occurs. This method is registered with an eventOut of a given node. When the eventOut generates an event the registered method is called.
Since the nodes in VRML can be named using the DEF construct. Any node named with the DEF construct can be accessed by the applet and is referred to as an accessible node. Once a pointer is obtained the eventIns and eventOuts of that node can be accessed. Since an exposedField implicitly contains an eventIn and eventOut, these are accessible as well, using the set_ and _changed modifiers.
8.2 EAI in Virtual Campus – Effect Panel
We care about the speed of downloading from the Internet, as much as we also care about the quality of the Virtual Campus. We had tried different levels of detail and try different kind of viewpoints, and consequently we got an acceptable speed and quality view for our thesis to be in the Virtual Campus page. However, this is not what we expect to have, since the world can only be viewed in a "normal" and "standard" way. Since our university is so active and innovative, we try to make more effects into the Virtual world so that it looks more professional and realistic. We have combined various special effects to create a ‘night’ view of the Virtual Campus, which seems to look more dramatic.
As we can see - nothing


We added a light source that are holding in the viewer’s hand like a torch, which will follow the user position. Then we add a little wizard into the scene to let it tell you more about the Virtual Campus!
To make more effect still, we add the different view angles for the viewer, we can change the height of viewer as the user actually height, even 6 meters tall guy can be simulated in the world.

We can change the intensity and the view radius of the light or even switch it off in the panel, so people really want to walk in the university in dark or wander around with a better lighting effect as needed.
Also, to show how our Campus looks like, we had implemented some Animation Pathway for the user to walk around the UNSW:
1. From Lower Campus to Upper Campus
2. Around in Lower Campus
3. Around in Middle Campus
4. Around in Upper Campus
5. Around outside the Campus
6. From Upper Campus to Lower Campus
7. From Lower Campus to Middle Campus
8. From Middle Campus to Upper Campus
9. From Upper Campus to Middle Campus
10. From Middle Campus to Lower Campus
So that user can just click on the Animation Pathway box and watch around the whole campus without pressing anymore key.
We desired to make the Virtual Campus become more realistic, but we cannot put anymore texture mapping (A kind of 3D technology, which put some material on the surface of the 3D object to make it look more real), which will decrease the speed of our Campus. We add the natural effect to the Campus such as raining, thunder and sky color.
We can now control the weather of our Campus just by pressing a button, the rain will fall down or the thunder will come.
8.2.2 The Mystery face of UNSW
We can make the world to rain and thunder, the sky becomes 90% dark, and the radius of the light is middle and the 75% of the intensity. We can now see how mystery our Campus actually is in the dark.
8.2.3 Internet Power - MOO
We try to design a interactive VRML scene, we decided a JavaChat program that works fine with our VRML scene, as we can chat with the students or lecturers as soon as they get into the VRML scene. Moreover, we can even see where they are, where they are going. However, since we cannot get a Web server support and also the Security protection inside the Netscape and make us unable to develop the VRML interactive component. However, we did implement one without VRML support, call JavaChat & JavaLocated as well. The JavaChat in the next section and the JavaLocated will be discussed later.
This Panel is again using the CosmoPlayer EAI functions connected to the JavaApplet by the Netscape LiveConnection. This time we use many EAI functions to make the world controlled by the user. Except from the EAI, we also add many animation ROUTE in the VRML node to make the virtual objects moving, just like the View angles of the viewer, the rain, wizard and even more. We used the Building Information DataBase program (develope by the Virtual Campus Group) to generate the Animation Pathway for our user. We are going to discuss in the following section.
8.2.5 The Powerful Panel
Layout
The panel interface is designed using the Java base classes, which looks complex but simple. As we can notice,

The Panel are logically divided into five part of the Panel which is,
and a statusbar for information supply.
The Panel is using the Java GridbagLayout() and GridLayout() to produce, since it is also one of the large job as the Java provide the Layout in a very difficult control method. We had to decide the size and location very careful as we even have to draw the panel by hand and then following the drawing and implementing the code. The code of the layout implement is long and is partly show below,
Label tmp;
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp1 = new Panel();
tmp1.setLayout(new GridLayout(1,1));
tmp=new Label("Building Panel");
tmp1.add(tmp);
gridbag.setConstraints(tmp1, c);
add(tmp1);
c.gridwidth = 1;
c.weightx = 3.0;
gridbag.setConstraints(ViewChoice,c);
add(ViewChoice);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp2 = new Panel();
tmp2.setLayout(new GridLayout(1,2));
tmp2.add(ViewJump);
tmp2.add(ViewFly);
gridbag.setConstraints(tmp2,c);
add(tmp2);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp3 = new Panel();
tmp3.setLayout(new GridLayout(1,2));
tmp=new Label("Light Panel");
tmp3.add(tmp);
tmp=new Label("Weather Panel");
tmp3.add(tmp);
gridbag.setConstraints(tmp3,c);
add(tmp3);
Panel tmp4 =new Panel();
tmp4.setLayout(new GridLayout(3,4));
tmp4.add(new Label("Switch"));
tmp4.add(LightOnOff);
tmp4.add(new Label("Raining"));
tmp4.add(RainOnOff);
tmp4.add(new Label("Intensity"));
tmp4.add(Intensity);
tmp4.add(new Label("Thunder"));
tmp4.add(ThunderOnOff);
tmp4.add(new Label("Radius"));
tmp4.add(Radius);
tmp4.add(new Label("SkyColor"));
tmp4.add(DayNight);
gridbag.setConstraints(tmp4,c);
add(tmp4);
tmp = new Label("ViewPoint Panel");
gridbag.setConstraints(tmp,c);
add(tmp);
Panel tmp5 = new Panel();
tmp5.setLayout(new GridLayout(1,4));
tmp5.add(View1);
tmp5.add(View2);
tmp5.add(View3);
tmp5.add(View4);
c.gridwidth = 1;
c.weightx = 1.0;
// c.gridwidth = GridBagConstraints.RELATIVE;
gridbag.setConstraints(tmp5,c);
add(tmp5);
c.gridwidth = 1;
c.weightx = 3.0;
c.gridwidth = GridBagConstraints.REMAINDER;
gridbag.setConstraints(AniWalk,c);
add(AniWalk);
tmp = new Label("Internet Panel");
c.weightx = 2.0;
gridbag.setConstraints(tmp,c);
add(tmp);
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp6 = new Panel();
tmp6.setLayout(new GridLayout(1,3));
tmp6.add(JavaChat);
tmp6.add(ShowOthers);
tmp6.add(ShowYourself);
gridbag.setConstraints(tmp6,c);
add(tmp6);
gridbag.setConstraints(StatusBar,c);
add(StatusBar);
ViewPoint Panel
The Viewpoint Panel provides two functions, Jump and Fly. As the viewpoint is selected inside the Selection box and then click on Jump Button, the Viewpoint will switch to the selected viewpoint directly, if the user click on the Fly button, the user will fly through the scene and stop at the selected viewpoint. As there can have different feeling for the user.
The implementation of the ViewPoint Panel, as we are using EAI to call the Viewpoint in the scene that predefined. When the Jump button is pressed, the is_bind eventIn is set
String vpt = ViewChoice.getSelectedItem();
StringBuffer sb = new StringBuffer(vpt);
sb.append("_V");
Node vptNode = browser.getNode(sb.toString());
EventInSFBool set_bind=
(EventInSFBool)vptNode.getEventIn("set_bind");
set_bind.setValue(true);
As the is_bind of the selected viewpoint is set to True, the Viewpoint will be active and will be shown at the VRML scene.
When pressing the Fly, we just have to load the viewpoint by the standard LoadURL command in the EAI, which locate the viewpoint as an offset, here is the example,
String vpt = ViewChoice.getSelectedItem();
StringBuffer sb = new StringBuffer("#");
sb.append(vpt);
sb.append("_V");
String s[]=new String[1];
s[0]=sb.toString();
browser.loadURL(s, null);
Then view will then change in the flying view.
Light Panel
There are three function for the light in our hand, the On/Off, intensity and radius. For On and Off, we have to change the SpotLight Node - on field into true or false to provide this function. As for the radius and intensity, we have to change the cutoff Angle and intensity field of the SpotLight Node by getting the value connection with the corresponding scroll bar, which is shown below,
if (evt.target==LightOnOff) {
Node slNode = browser.getNode("Light1");
EventOutSFBool on_changed = (EventOutSFBool)
slNode.getEventOut("on");
boolean tmp = on_changed.getValue();
EventInSFBool set_on = (EventInSFBool)
slNode.getEventIn("on");
set_on.setValue(!tmp);
}
if (Intensity_num!=Intensity.getValue()) {
Node slNode = browser.getNode("Light1");
EventInSFFloat set_intensity = (EventInSFFloat)
slNode.getEventIn("intensity");
set_intensity.setValue(((float)Intensity.getValue())/100);
Intensity_num=Intensity.getValue();
}
if (Radius_num!=Radius.getValue()) {
Node slNode = browser.getNode("Light1");
EventInSFFloat set_cutOffAngle = (EventInSFFloat)
slNode.getEventIn("cutOffAngle");
set_cutOffAngle.setValue(((float)Radius.getValue()/100));
Radius_num=Radius.getValue();
}
Background Panel
The background panel seems to be a lot more difficult to handle because there are many timers and drawing stuffs, also we have to control animations. First, we added the following two VRML scene:

All the rain and thunder are polygons (Polygon: 3D object that requires up many CPU time for calculation), it is impossible to make all the scene full of rain and thunder. And a new technology is applied to our thesis - The function that can make the objects always in front of you. This makes the rain always place in front of the user, so you will feel that the rain is in the whole world, as shown,

The code added are not too much, we have to add a ProximitySensor for the whole Virtual Campus to get control where the user is located, then put the rain in front of the user. The Code for the rain is show below,
DEF ALLWORLD_prox ProximitySensor { size 5000 5000 5000}
DEF rain_move Transform {
children Transform {
children Transform {
translation 0 -0.02 -3
scale 0.4 0.6 0.4
children DEF Rain Switch {
whichChoice -1
choice [Inline { url "Rainx3.wrl"}]
}
}
}
}
ROUTE ALLWORLD_prox.position_changed TO rain_move.translation
ROUTE ALLWORLD_prox.orientation_changed TO rain_move.rotation
For the thunder it is just simply the same. For the On/Off of the rain and thunder, we use the Switch Node in VRML, we can switch the Node on and off. The Switch Node have already show above with the code of rain.
For the color of the Sky, we use the same algorithm with the Light intensity and radius by changing the skycolor field in the Background Node, corresponds to the scroll bar.
Viewer Panel
The four buttons are used to select the four NavigationInfo Node inside the Switch Node, the switch node control which NavigationInfo Node is being selected, since the NavigationInfo control the size of the viewer.
One of the avatarSize fields in the NavigationInfo is to control the viewer’s height related to the ground.
Animation Pathway selection box
It includes the descriptions of the path that we support to the user, as this is generated by the Building Information DataBase (BIDB) that we have talked about in early chapters. The animation have to be routed to the TimeSensor in order to make it run, so when the Pathway is selected, we set true to the is_bind of the starting viewpoint (as the viewpoint section told), then ROUTE the TimeSenor with the Pathway Nodes and then it will automatically start:
StringBuffer sb = new StringBuffer(AniWalk.getSelectedItem());
StatusBar.appendText(sb.toString());
char ch[]={((char) 10)};
StatusBar.appendText(new String(ch));
String s = sb.toString();
Node MovingNode = browser.getNode(s);
sb=new StringBuffer(s);
sb.append("_C");
Node Clock = browser.getNode(sb.toString());
sb=new StringBuffer(s);
sb.append("_T");
Node CubePath = browser.getNode(sb.toString());
sb=new StringBuffer(s);
sb.append("_R");
Node CubePath2 = browser.getNode(sb.toString());
EventInSFBool set_enabled = (EventInSFBool)
Clock.getEventIn("enabled");
set_enabled.setValue(false);
browser.addRoute(CubePath, "value_changed",MovingNode,
"set_position");
browser.addRoute(CubePath2, "value_changed",MovingNode,
"set_orientation");
browser.addRoute(Clock, "fraction_changed",CubePath, "set_fraction");
browser.addRoute(Clock, "fraction_changed",CubePath2,
"set_fraction");
browser.addRoute(MovingNode, "bindTime",Clock, "set_startTime");
set_enabled.setValue(true);
EventInSFBool set_bind = (EventInSFBool)
MovingNode.getEventIn("set_bind");
set_bind.setValue(true);
EventOutSFBool get_isBound = (EventOutSFBool)
MovingNode.getEventOut("isBound);
Internet Panel - MOO related
Internet panel is still in the implementing status, since we have done the code however, we can't get a Web server to start our ChatServer Java class, also the Netscape’s Security problem with the JavaApplet make the code unable to execute. The Panel includes three buttons, the first one control the popup of the JavaChat Window, which use the JavaChat.class discuss at the later chapter. Another component is the JavaLocated.class, which is an addon to the JavaChat program designed for the EAI. With this the Java are now able to send the location of the user to the server, the server will send the location to all the users, and so that we can have all the user locations in our VRML scene.
The Show All button is to display all the user into your scene, as we can see they are in the VRML world, however, this will take lots of cpu time as well.
And we display the other user (active users) using the array to store the nodes information inside the Java code, we get a user counter, maximum up to 100 (in this state) and we refresh the page in once per second. As we get a new user inserted into the scene, we simply using the addChildren() EAI function to add a new node on the scene, then we update the active users by changing their translation and rotation fields, as we get from the JavaLocated. The "Show Yourself" function is switch if you want to send your coordinate to the other user or not, that can keep your privacy inside our scene.
8.3 EAI in Virtual Campus – Low config version Panel
8.3.1 Building Information Page
The aim of developing a page that suitable for the low bandwidth internet connection.
Our thesis is to develope a internet Virtual Campus for our school, however, 3D modeling take a lot of resources from the computer, it need lots of calculation from the CPU, for our standard Virtual Campus, the whole university is model into a single file and display more than 20 building, as a result, for a Pentium 133 with a standard video display card, 14.4K modem, the computer will take about half an hour to load our Virtual Campus, after loading it, there have to wait for a least 1 minute to walk for a step. However, we have to provide a internet Virtual Campus to every students, whatever they are having a PC, Macintosh, Sun Solaris and SGI, they should able to read our Virtual Campus. Then we decide this page for our building information, we divide the page into three parts, as shown

The left top hand corner is our building inside the VRML browser, and on the right hand corner is the Java EAI, which include all the building related button, a status bar which all are implemented by the Java. The JavaApplet also control the bottom frame that change to the corresponding page with the building.
The button in the JavaApplet is connecting the VRML scene using the EAI of CosmoPlayer, actually the CosmoPlayer is having a "Shell VRML World", which contain a null object which keep rotating, the code is as below,
#VRML V2.0 utf8
DEF Camera Viewpoint {
position 0 5 100
}
Group {
children [
DEF BuildingGroup Transform {
children DEF BuildingInline Group {}
},
DEF Clock TimeSensor {
enabled TRUE
cycleInterval 4.0
loop TRUE
},
DEF BuildingPath OrientationInterpolator {
key [0.0, 0.50, 1.0]
keyValue [
0.0 1.0 0.0 0.0,
0.0 1.0 0.0 3.14,
0.0 1.0 0.0 6.28
]
}
]
}
ROUTE Clock.fraction_changed TO BuildingPath.set_fraction
ROUTE BuildingPath.value_changed TO BuildingGroup.set_rotation
The Rotation is not using the Script non the EAI, it keep rotating whenever it is being loaded, we make a TimeSensor Node, and cut the interval into four. Then we get a OrientPosition Node that include four angle, which is 0, 1.5707, 3.1416, 4.7123. Then we link the two nodes together by the ROUTE function. And then link the OrientPositon with the empty Group. As a result, the node will keep rotating.
When the user click on the buttons on the JavaApplet, the related building will be loaded into the VRML view and add into the empty node, then the building will be rotated as the empty node does, and as we can see, the building will switch when they rotate. The function that we use to add the building into the scene is the addChildren function, we first use the function createVRMLString() to create the related building by the JavaApplet, then we use the addChildren() function to add the node into the VRML world. When the other button is press, then we unload the old building by removeChildren() and then load another new one into it. Here is the code that we use to write to control the scene,
parent.removeChildren.setValue(parent.shape);
parent.shape = parent.browser.createVrmlFromString("Inline {url \"../Mapped/"+title+".wrl\"}\n");
parent.addChildren.setValue(parent.shape);
In order to make the button animated, we previous try to use the animation GIF instead, however, the JavaApplet need to spend most of the CPU time to refresh those buttons and even make the whole "Building Information Page" become slower, so we change to adding one Thread (The multi-running sub-program inside the JavaApplet) into the applet, control the frame rate of the animation button, when the mouse is moved over the button, the button will start animate, which will save more system time in refreshing the animation. This code is implemented as a seperate class, which we can re-use for other part of our thesis.
public void run() {
while (true) {
if (parent.imageIdx>2)
parent.imageIdx=0;
else
parent.imageIdx++;
if (parent.active!=null) {
try {
parent.active.paint(parent.active.getGraphics());
} catch (NullPointerException e) {}
}
try {sleep(1000/parent.framerate);}
catch (InterruptedException e) {}
}
However, someone may feel curiosity that why we can just use one simple picture to create a animation button. This is a tricky cheat that we added on the Java code, we use the power Java image library to cut the picture into certain parts, and at each thread time, we change the parts of the picture that we want to display, and as a result, it just like to be an animation. In this case, we can change the frame rate directly by the HTML, (as we put the frame rate as one of the parameter in the applet) so that we can change the speed of the button animate or even stop it by framerate equal to zero. Here is the button of Samuels,
Which is just so simple and small picture to make it can even animate!
As what we have shown above are all the library that we built for this Building Information Page, which is just two small files for downloading, for the main display part, which is much smaller,
add(new BuildingCanvas(this, "Applied_Science_F10"));
add(new BuildingCanvas(this, "Australian_Graduate_School_of_Management_G27"));
add(new BuildingCanvas(this, "Biological_Sciences_D26"));
add(new BuildingCanvas(this, "BlockHouse"));
add(new BuildingCanvas(this, "Chancellery_C22"));
add(new BuildingCanvas(this, "Civil_Engineering_H20"));
add(new BuildingCanvas(this, "John_Goodsell_Building_F20"));
add(new BuildingCanvas(this, "Library_E21"));
add(new BuildingCanvas(this, "Mathews_Building_Theatres_D23_F23"));
add(new BuildingCanvas(this, "Morven_Brown_Building_C20"));
since we have already make all it need by the library, and just have to call the library, for each building, we have to add a line:
addCanvas (this,"Name")
then the button wil automatically setup its location and animation time, what we need is just three more files, which is
That's all for adding a building to it, isn't that easy.
Chapter
NINE
9.1 Introduction
In order to provide a way for users to communicate within the campus, we have introduced a chat program, which is integrated within the interface of the model. This program is essentially the basis of the communicate between users since each user can keep track of who are within the model and hence can talk to them. Moreover, the chat program can contribute to the aspects of academic through the concept of MOO, which is basically a text-based, virtual reality sites that allow people to connect to the same place at the same time, and the people within can interact with cyber-objects in addition to just chatting with other people. The concept of MOO will be discussed later.
9.2 The structure of the Chat system
The Chat program is divided into three parts:
The server is acting as a message-passing unit. Every time a user logs in to the chat program, the server will store the address of the client machine. Then if any users want to send a message, that message will be sent to the server. As soon as the server receives the message, it will send it to all the client addresses that is stored. The server will also check if a packet is from a newly joined user, if not the server will not store the client’s address to avoid storing multiple identical addresses.
On the client side, it consists of two parts, the chat sending and receiving. The sending part basically deals with sending messages. It will create a packet for every message a user entered, and send it to the server side. On the other hand, the receiving client will always listen if any message is send from the server side, if so then it will output the message on the chat terminal. The reason that two programs is required for the client side is that the client has to be able to send and receive message at the same time, and the way to do this is to make two separate programs running concurrently.
9.3 Networking concepts
Since the chat program is a networking application, we will explain the essential networking concepts that we have used in the following sections, which helps to make clear of what is going on when discussing the implementation later.
IP, TCP and UDP
IP (the Internet Protocol) is the most common protocol used in the Internet. It has a number of advantages over other protocols. First it provides robustness by allowing multiple routes between any two points and to route packets around damaged routers. Each computer in the Internet has an unique IP number for identification. If one machine wants to send a packet to another machine and if the normal path is damaged, the Internet Protocol will try to find another path which can also reach the destination.
Although the IP is a good protocol, it is not enough. Sometimes the order in which packets are received will be important. However, since IP allows different packets to send through different paths, the receiving order cannot be guaranteed. Therefore TCP (Transmission Control Protocol) was added to give the receiver the ability to acknowledge receipt of IP packets and request retransmission of lost packets. Also TCP allows the packets to be arrange back to the same order as they were sent on the sender side. However, TCP carries a fair amount of overhead. Therefore, if the order of packets are not important, and the loss of individual packets will have minor effects, then packets are preferred to send without guarantee. This can be done using UDP (User Datagram Protocol), which is an unreliable protocol that does not guarantee the arrival and order of packets, This protocol is good for applications that the users will be unaware of the loss of some particular data. Consider when sending video of audio signal, losing a few bits will not cause serious problems, but it would be a bigger problem when using TCP, which will request for retransmission of every lost packets.
Ports
If each computer did only one networking event at a time, then only the IP address will be all that is required. However, that is not the case. Each computer do many things at once. For example, email needs is different from FTP requests, and also from web traffic, all at the same time. Therefore ports are introduced to solve the problem. Each computer with an IP address has several thousands of logical ports and each of which can be allocated to a specific service. When data is sent to a particular port on another machine, the receiver checks each packet for both the address and the port. If the address matches, the data will be directed to the program interested in data to that port. This is how different types of services are sorted out. There are logically 65535 ports in one machine, and port numbers 1-1023 are reserved for well-know services like finger(port 79), http (port 80) and ftp (port 21) etc. Other port numbers can be used by users.
Sockets
Data is transmitted across the Internet in packets of finite length called datagrams. However, since datagrams have finite length, it is often necessary to split the data into more packets and reassemble it at the destination. Some of the packets may also be lost during transmission, or they arrive out of order. These seems to be a lot of work and complicated. Fortunately, sockets are introduced which allow users to treat a network connection as another stream that bytes can be written onto or read from. The idea of sockets is an extension of the idea that all I/O should look like file I/O to the programmer. The idea shields the programmer from low-level details of the network, like media types, packet sizes, packet retransmission, network addresses, etc. A socket can perform seven basic operations:
9.4 The implementation of the Chat system
The implementation is done using Java JDK1.1. The reason for using Java is that it provides better networking facilities and most importantly, integrating into the World Wide Web, so that every Internet user can use this program all around the world. Moreover, the Java language is platform independent, and therefore programs only have to be written once, and can run on any hardware, provided a Virtual Machine (VM) is available. This also provides an advantage on compatibility.
In our design and implementation, we decided to use UDP as the protocol for the clients and server to communicate, since a reliable connection is not necessary in this case. Moreover, we have considered that besides the chat system, there may be other traffic flow occurring as users may interact with other components of the Virtual Campus at the same time through the Internet (e.g. users may be browsing at the information of the campus, and thus requires loading from the internet). Therefore using UDP may cut down overheads that TCP results and may improve the speed of the Internet connection. On the server side, one port is created to provide the service of receiving messages from clients. A socket is also made to bind to the port created to receive and send data. An array is also implemented to store the IP address of online users. On the client side, two ports are created one for sending packets and the other for listening continuously for data. As mentioned before, the sender and the receiver on the client side have to be running concurrently. This can be done efficiently using Thread in Java. This means that the sender is idle for user to enter message and at the same time, the receiver is listening to the socket binding to the receive port and ready to output the message to the terminal.
In this section, we will break up the codes for three programs: ChatServer.java, which acts as a server, ChatRev.java, which is the sender part of the client and JavaChat.java, which is the listener. Explanations of some critical parts of the codes will be provided.
9.4.2 ChatServer.java
This is program which is run on the server side. It just keeps idle waiting for data packets from clients. As soon as it receives something, it will direct the received packet to all online clients.
public class ChatServer {
protected static int Port = 5000;
public static int defaultBufferLength = 1024;
public static byte buffer[] = new byte[defaultBufferLength];
protected static InetAddress address[] = new InetAddress[10];
public static int user = 0;
As shown above, the server is using port number 5000 in receiving packages. We have also defined the buffer size to be 1024 bytes. An array called address is declared to store the address of online users. The array is set to hold ten elements, but can be changed as needed. The "user" variable is used to keep track the number of online users.
public static void main(String[] args) {
DatagramPacket incoming;
int port;
int len;
try {
boolean login = false;
DatagramSocket ds = new DatagramSocket(Port);
int ptr = 0;
try {
address[0] = InetAddress.getByName("127.1.1.0");
} catch (UnknownHostException e){
System.err.println(e);
}
As shown, some variables are declared within the main module. The boolean variable "login" is used to check if a user is already login or not. The address array is initialized by storing the address of the own server machine for convenience. The UnknownHost error is catched by printing the error to the console.
while (true){
try{
incoming = new DatagramPacket(buffer, buffer.length);
ds.receive(incoming);
ptr = 0;
login = false;
while ( ( ptr <= user )&&( login == false) ) {
if(incoming.getAddress().getHostAddress().equals(address[
ptr].getHostAddress())){
login = true;}
else {
ptr++;
login = false;
}
}//end while
The is an infinite while loop which keeps on listening for incoming packets from clients. Firstly a new datagram packet is make for holding the incoming packets. The other while loop is for checking if the incoming packet is from a user whose address is already stored in the array. The variable "ptr" is used to traverse the address array and check if the current one is the same as the one where the received packet is from. If so login is set to true and exit the loop.
if (login == false){
address[ptr] = incoming.getAddress();
user++;
}//end if
System.out.println("No. of users:"+user);
respond(ds, incoming);
Here, if login is false, which means the packet is from a new user, the address is stored into the array. The number of users is displayed in the console and a function "respond" is called to handle the receiving data.
public static void respond(DatagramSocket ds, DatagramPacket dp) {
DatagramPacket outgoing;
String s = new String(dp.getData(),0,0,dp.getLength());
System.out.println(s);
try{
for (int i=1; i<=user; i++){
System.out.println(address[i].getHostAddress());
outgoing = new DatagramPacket(dp.getData(),dp.getLength(), address[i],3000);
ds.send(outgoing);
}// end for
} catch (IOException e){
System.err.println(e);
}
}
This function is for directing the received message to all online users. First of all, the data from the packet is extracted and converted to string s. Inside the for loop, the string is used to create packets and then send to all online users.
9.4.3 ChatRev.java
This is the program which acts as a receiver on the clients end. It is implemented as thread, so that users can still receive packets when the sending program is running at the same time. This means that the CPU is basically sharing cycles among both sending and receiving program so as to give a feeling that the programs are running concurrently.
public class ChatRev implements Runnable{
protected static int len = 1024;
public static DatagramSocket ds;
protected JavaChat parent;
Thread t;
The variable "parent" is of type JavaChat that is the main client program. It is also the JavaChat program (discussed later) that called this ChatRev program to run.
public ChatRev(JavaChat parent) {
this.parent=parent;
System.out.println(parent.chatwin);
System.out.println("The Receiver is running.....");
t = new Thread(this, "ChatRev");
t.setPriority(6);
t.start();
}
This function creates an instance of ChatRev. The "parent" variable is set to the calling class. A thread is created and then started. Note that a "setPriority()" function is called because in some hardware architecture, the handling of thread is different, and may lead to a situation where the CPU time is not shared fairly, and hence a program may not run at all. In setting the priority of a thread, both threads may run concurrently in some situation.
public void run() {
try{
ds = new DatagramSocket(3000);
System.out.println("The socket is made");
} catch (SocketException e){
System.err.println(e);
}
try{
while (true){
DatagramPacket incoming = new DatagramPacket(new
byte[len],len);
ds.receive(incoming);
String tmpstr=new String(incoming.getData(),
0,0,incoming.getLength());
parent.addText(tmpstr);
}
}
First, a socket is bind to port 3000 for receiving data. Then inside the while loop, it will wait until a packet is received. Then the message is converted into string and output to the interface of the chat system through the call "addText".
9.4.4 JavaChat.java
This is the program where the sending part of the client and the GUI are implemented. The receiving part of the client (class JavaRev) is also called by JavaChat.
In the function init(), the first part is basically setting up the GUI of the chat system. A snapshot of the GUI is shown in the figure below. It basically provides a text area for showing the message received from different users, and also an area for users to type in the message that they want to send.
Figure. A snapshot of the chat system GUI
tmp = new ChatRev(this);
Besides the GUI, JavaChat also create an instance of the ChatRev class, which acts as a receiver listener as mentioned.
try {
ia = InetAddress.getByName("129.94.246.106");
} catch (UnknownHostException e){
System.err.println(e);
}
try {
ds = new DatagramSocket(7000);
} catch (SocketException e){
System.err.println(e);
}
int pos = 0;
In the first try statement, the program attempts to get the InetAddress of the server, which in this case is 129.94.246.106. This number can be changed as needed. In the second try statement, a socket binding to port7000 is created for the sending of packets.
try {
message=name+" Join.";
message.getBytes(0, message.length(),buffer,0);
ds.send(new DatagramPacket(buffer,message.length(),ia,port));
}catch (IOException e) {
System.err.println(e);
}
As shown above, a packet with the desired message is created and sent to the server side using the "send" command to the specific port of the server.
public void addText(String txt) {
char ch[] = {((char) 10)};
String CR = new String(ch);
String a=new String(txt);
if (a==null) {
a=new String("Empty String");
}
MultiLineBox.appendText(a);
MultiLineBox.appendText(CR);
}
The function is used to update the display window every time a message is received or send. This function is actually called by the JavaRev when a packet is received in order to update the display.
On the server side, ChatServer has to be up and running all the time so that clients can have a place to send packets to. And on the client side, since the GUI is written as an applet, it is initially designed to execute within a browser that supports Java, e.g. Netscape 3.0 and up. However, because of some security issues behind browsers in dealing with Java applets, the applet we have written can be run by using an appletviewer. The chat system performs normally using appletviewer. However, the applet will lose the ability to interact with our existing Virtual Campus model. This means that the chat system will run as a standalone application. However, in our further discussion in MOO, we will explain the use of the chat system as a way to provide interactive communication within the model.
Chapter
TEN
10.1 Introduction
The wizard is basically a small window program which provides appropriate information according to how the user interact in the Virtual world. It can also be used as a helper when users seems to have any difficulties within the world. It is designed to provide a simple and user-friendly interface for users. It is also implemented so that more information can be put into the wizard easily. Moreover, the content within the wizard window can be changed easily by just calling a function with suitable parameter, therefore the purpose of the wizard can be extended as wished only with minor changes.
10.2 The structure of the wizard
As mentioned, the wizard provides an easy to provide update information according to what users do within the world. In other words, the wizard will update its display as soon as it receives a call from the main control of the virtual campus model. It all depends on when the model wants the wizard to be updated and what information the wizard is to display, which provides flexibility when the usage of the wizard is going to change. At the moment, the wizard provides information about the building which the user is viewing inside the world. It also provides web links to the schools or faculties which can be found within that building. When users want to know more about a faculty, say, they can click on a button, and a new browser window will pop up, showing information about the specific faculty through linking to the official link of the university. Later when the user changes their view to another building, the wizard window will be updated with other information and links.
10.3 The implementation of the wizard
The wizard is written using Java JDK 1.1, which provides an easy way to transfer control from the wizard to the web browser. In Java, a "showDocument" method defined by the AppletContext interface can be used to display a web page on a browser. The AppletContext is an interface that allows you to get information from the applet’s execution. However this can only be done by passing the AppletContext of the main world control as a parameter when creating an instance of the wizard class. In this way, events occur within the wizard window can actually be used as a control to the browser environment.
10.3.1 The code
ACDemox.java is the implementation of the wizard program. It extends the Frame class, showing that the wizard is basically a window application instead of an applet.
ACDemox(int Size,String name, Image image,URL u, AppletContext context,Image gpin,Image rpin) {
url = u;
fontSize = Size;
fontname = name;
msg = "Welcome to our Virtual Campus. I am a little wizard that helps you to walk around the world. I will also show you some information about the buildings and the corresponding faculty. Feel free to use!";
img = image;
greenpin = gpin;
redpin = rpin;
con = context;
link = new Choice();
setLayout(new BorderLayout());
}
This is a method which basically sets up an the wizard window. All the parameters in this method is passed by the main control EAI of the world. Note that the parameter "context", which is of type AppletContext is passed so that the wizard can make use of the browser context and show appropriate pages if necessary. The figure below shows how the wizard look.
Figure. A snapshot of the wizard.
public void updateText(Graphics g){
if (f==null) f = new Font(fontname,Font.PLAIN, fontSize);
g.setFont(f);
if (fm==null){
fm = g.getFontMetrics();
bl = fm.getDescent();
fh = bl + fm.getAscent();
space = fm.stringWidth(" ");
}
The method updateText is basically performing the task of simple text formatting. First is will get the information of the font using by the method getFontMetrics(). This is necessary since the width and height of each font type is different.
StringTokenizer st = new StringTokenizer(msg);
int x = 105;
int y = 60+fh;
int nextx;
String word,sp;
int wordCount = 0;
String line = "";
while (st.hasMoreTokens()){
word = st.nextToken();
int w = fm.stringWidth(word);
if( (nextx = (x+space+w)) > 295 ){
drawString(g,line,wordCount,fm.stringWidth(line),y+bl);
line = "";
wordCount = 0;
x = 105;
y = y + fh;
}
Next, a method StringTokenizer () is created a string token of the message. It will extract a word from the message at a time separated by an empty space. Each time a word is extracted from the string token and is checked if the displaying line is going to be full is the word is added. If so, a "drawString" function is called which output the line on the display window with justification. If not, then another word is grapped and checked again and so on.
The most important part of the wizard is the retrieval of the information required to display. In our implementation, we have a function called "search" which takes a string as a parameter. This string is actually the name of the buildings in the world. For example, when the user in the world is viewing a particular building, the main control in the world will make a call to the search function (through the ChangeContent call) with the name of the building as the parameter. The search function holds information about the buildings in the campus, so that if an entry corresponds to that particular building is present within the database, a new message describing the building will be extracted and display on the window. Moreover, the relevant WWW links in regards to that building will also be added to the list box, so that if the user wants to know more about a particular area, a list of links can be selected from the list box, and a new browser window with the desired link page will pop up. Here is the description of the code:
public String search(String name) {
remove(link);
In the above ‘remove’ statement, link is the list box. Every time the search method is called, the list box is removed. The purpose is that some buildings may only have one appropriate link, so that the list box is removed to make the interface simpler and easier to use for users. The list box is added when more than one link is present.
if (name.equals("Applied_Science_F10.wrl")) {
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("Applied Science");
link.addItem("School of Chemical Engineering and Industrial
Chemistry");
link.addItem("Department of Safety Science");
return("The Applied Science Building is home to the Faculty of "+
"Applied Science. In the Building you'll also find the
School of Chemical "+ "Engineering and Industrial Chemistry, and the Department of Applied Geology.");}
The above code is one of the entry of the database. Since the Applied Science building houses several departments, we can provide more links, and therefore the listbox is added to the display with appropriate names of the links in it. Moreover, the general description of the building is returned and the ends the search.
public boolean handleEvent(Event evtObj)
public boolean mouseUp(Event evtObj, int x, int y)
These two functions are used to handle the mouse events on the two buttons. The ‘mouseUp’ function is used to sense if the button is clicked. If so, a new browser window with a link page will pop up. The ‘handleEvent’ function is used to change the colour of the button when the mouse is on top of it.
public void changeContent(String name) {
msg = search(name);
Graphics g = getGraphics();
g.clearRect(100,60,200,200);
g.setColor(Color.black);
g.fillRoundRect(100,60,200,200,15,15);
g.setColor(Color.green);
updateText(g);
}
This is the function which the main control of the world will use every time the wizard is required to update.
10.4 The extension of the purpose of the wizard
It is very likely that the wizard may provide more purpose rather than only providing general information and links. However, due to the flexibility of the implementation, it is quite simple in upgrading the purpose of it. It all depends on the main control. For example, when the main control detect that the user are having difficulties in travelling around the world, the main control may call the wizard with a specific parameter. Then the wizard will know that the call is something rather than showing links and general information, and so a simple help page may pop up. Of course, the database of the wizard will also has to be expanded in order to handle more events.
Chapter
ELEVEN
11.1 What are MOOs?
MOOs are text-based, virtual reality sites that allow people to connect to the same place at the same time. This idea originally came from a kind of textual Internet game called the Multi User Dungeon (MUD), which is basically a role-playing game, where the players choose a character and play the game together. In fact the term MOO stands for MUD object-oriented. This means users can actually construct things and interact within the simulated environment simply by linking written modules called objects. In this way, MOO allows the manipulation and interaction with cyber-objects in addition to just chatting with other people.
There has been a lot of MOO sites available though the Internet. Although, MOO was originally derived from the gaming category, many different aspects have been using MOO, such as educational, commercial organizations etc. There are reasons behind the popularity. First of all, MOOs offer the chance to start fresh, to shape and mold one's own attributes, actions and just about every aspect of one's life or personality, so that users can communicate as if they are ‘virtually’ face to face, even through the use of text.
11.2 A small history of MOO
In 1990 Pavel Curtis, a computer scientist with XEROX in California, came across a more sophisticated programming language than MUD, which is MOO, which was written by a University of Waterloo student, Stephen White. It lets users build things in the simulated environment. Curtis and White united, then split and Curtis began building a MOO. Curtis modelled his MOO after the floor plan of his real silicon valley house, naming it LambdaMOO after the object-oriented programming language LISP. In October, 1990 he invited the world in having made the underlying programming available free to anyone on the Internet.
11.3 How does MOO works?
Basically, the programming language used in creating MMO Objects is C++-based, implementing a database full of inherited objects, rights and descriptions, etc. Normally a MOO is a space created on a server computer (usually of a large business or institution such as Xerox or a University). The basic way of connection is using Telnet client. Usually, the method to connect to a MOO will be shown after telnetting to the server. Once a connection is established, the player must connect as a guest or one unique character in the space. First-time users may login as a guest until they are capable to become a character. Since one of the advantage of MOO is to provide users with personalities, they can have permanent identities by applying characters. A character consists of a name, password and gender etc. A wizard (system operator) is available to process those requests.
The format of the MOO is unique to each other. For example, certain MOOs are strictly academic ones, while others are for pure entertainment purposes. Different themes can be associated to MOOs or can take place in a variety of settings, such as mansions (The Palace and LambdaMoo) or a sprawling city (ChibaMoo). Characters can chat around and can interact with objects and other characters. Usually, MOOs are simply a forum for people to interact with each other. The most common activities on a MOO includes chatting, programming or exploring.
11.4 MOO in connection to educational purpose
Another great advantage of MOO is that it provides an easy way in sharing information, so that a group of people can interact more directly with the ideas raised during a session. Moreover, from the viewpoint of education philosophy, when interacting through textual expressions users can process information at a higher cognitive level than speaking or hearing. Therefore it is a good idea to make MOO as the next generation of remote studying. The obvious advantage of remote studying is that the limitation of geographical distances is no longer a problem. However, most methods of remote learning are not active, such as receiving packets in the mail from an impersonal instructor or through watching television while a teacher lectures. Consequently, the learners will become passive learners. There is no immediate respond to questions arised, which will block the learning process dramatically. Therefore the aim is to provide a way of remote studying such that the educational process must be interactive between students to teacher, and also between each student.
The learning process can also be accelerated when a learning community can be set up. With the aid of MOO, students and teachers are brought together from all over the world into a virtual learning environment. In this way, the problem of distance limitation is eliminated by the use of the Internet. The students can also take immediate responds to questions and discuss interactively within each student. This kind of environment can increase the depth of learning. Moreover, the study material is not limited, since the learners can get additional information through the Web, which can also increase the scope of learning.
11.5 Multimedia Capabilities Increase the Depth of Interaction
Although the MOO is a good solution to the remote learning method, the drawback is that it is text-limited. On some occasion, textual representation is not enough. Introducing graphics and audio to the MOO will definitely enhance the educational process. Both the learners and teachers will become more involve in the community. The integration of graphics and sound to MOO can be done by simply transmitting HTML code between users. However the enhancement is still limited since HTML is not dynamic. However, some organization is working on projects which integrate the static HTML into the dynamic MOO in order to provide better interactivity within the virtual environment. The Java technology is also used to some extent so that the compatibility problems due to different hardware and software platforms can be omitted.
11.6 MOO in relation to our thesis project
It has always been a challenge to put graphical component into MOO. As mentioned, since the HTML code is static, it will be difficult to perform immediate update of information. Moreover, the form of the graphical representation is also a problem. The level of enhancement in interactivity depends on how the graphical interface is designed. An ideal graphical interface would be one that can perform the task of interactivity over the Internet, so that everyone on the world can get access of this interface easily. Moreover, for compatibility issues, the interface using should be standardized. It comes out that the best choice for this purpose is using VRML as the media.
Since VRML has been a standard in 3D-modelling throughout the Internet, a lot of companies have developed different sorts of viewers and plug-ins for Web browsers to support this language, and therefore, the compatibility problems can be minimized. Moreover, a 3D environment would be the best choice to make the textual environment more ‘realistic’. In addition, since our thesis project is to construct an interactive 3D modeling of the campus, integrating MOO to the model would greatly increase the interactive component of the model, and on the other hand, the MOO will also benefit from this ideal perfect graphical representation of the virtual environment.
11.7 The integration of MOO into the 3D Campus model
11.7.1 The idea
For the idea , we are intended to integrate simple MOO into the model by using the chat system discussed earlier. Since the chat system provides a link between all login users through the Internet, it can be used as a tool not only to send text message, but can also used to send information about the events happen in the model to all other login users. One of our most important proposals is to make all the users of the virtual campus to be visible to all other users. This means that a user travelling within the model will see other users moving around in the model as well. This design can increase the interactivity within the world since each user is now considered a dynamic object within the world, and so each user can respond to other’s users actions. Moreover, since MOO is an ideal applications for remote learning, the main benefit of this graphical-enhanced MOO is to provide an even more ideal and user-friendly way for users all around the world to learn more about the campus, both geographically and academically. When MOO is conducted for learning academic issues, a text-based may be sufficient. However, when people want to know what a place looks like, only words cannot give a good picture. Therefore we believe that it would be a good idea to integrate the tradition MOO is our 3D model, so that the university staff can login and act as a guide so that a ‘virtual tour’ is possible. The users can be familiar with the campus in a relatively shorter time when someone is there to help. Moreover, the virtual campus provides a good environment for existing students and teachers to perform various activities, as if they are physically on campus. Such activities may include:
Since existing students and teachers are more familiar about the locations of buildings within the campus, these activities can actually be held in the actual location where they are normally held in the real campus. In this way, the users can interactive in a friendly atmosphere, where they can have the same feeling as if they are really on the campus. Users may also find it more interesting rather than typing text on a terminal, and so they may be more involved and participate in what they are learning.
11.7.2 The design
In our design, the main idea is to extend both the chat system and the virtual campus model to perform the function of MOO. In the chat system, each user is able to send packets to a server, and the server broadcast this message to all other login users. Therefore, we can make use of this system to send not only message, but also some information about that user, so that other users can know what is happening to that user. A simple example is the current position of users. Within this system, it is possible to periodically send the position coordinates of the users around. Once the users receive those information from all other people, the main control of the virtual campus will take the coordinates of all users (except yourself) one by one and draw it on the virtual model. Therefore, it is up to the clients or users to display the positions of others, and the servers only have to do the same job as before- directing packets to all login users, and the implementation of a 3D graphical MOO can be achieved quite easily. The following figure gives the brief idea of the arrangement explained.
Figure. The design of the MOO within the Virtual Campus
11.7.3 The implementation
Since the existing chat system and the EAI of the model provides sufficient functionality to perform MOO, only minor changes and required. When concerning the chat system, modifications are not required on the server side, since the server the job of it is just delivering packets to all login users and there is not interaction between the server and the receiving packets. However, on the client sides, modifications are necessary. For example, the sending component of the chat client must be able to handle both the messaging information and the information about the positions of the user. However, since the sending function is already implemented inside the client, we only have to let the sending client knows the type of the sending information. This can be easily accomplished by passing a parameter which identifies the type of the sending information. For example, we can create a String variable called ‘type’. Every time the send function of the chat program is called by the EAI control, the type ‘position’ will be passed. However, if the sending information is from the chat program itself, which is simply text, then the passing ‘type’ variable can be set to ‘text’. It is necessary to distinguish between the types of packets send because the sending component of the client can pack information in different formats, so that the clients receiving that packet can distinguish the types of the message as well. As an example, consider the case when the position vector is required to send to the server. The sending client knows that the type is position and will try to pack the packet in a special format. Since the datagram packet is basically sending bytes of information, it is necessary to create a format which so that when the receiver converts the bytes to string, it will identify the type of the receiving packet. We come through this by introduce some special characters, such as a string ‘@#$’ to be put to the front of every packets of type ‘position’, so that the receiving clients can determine the type of the packet by reading the front part of it. If the receiving packet is of normal message text, the receiver will simply output the text to the terminal window. However, if the receiving packet is of type position vectors, the receiver will update some public variables to store the vectors received and wait for the EAI control to get those values when they are needed. For example, we can construct a new class which has a structure of position vector, and then create and array of that class to store the values. For example, a class called ‘Position’ can look like this:
public class Position {
int X_coordinate;
int Y_coordinate;
int Z_coordinate;
String name;
}
After that, we can create an array of type ‘Position’ to store the values. Each element of the array represents one login users. Since each packet received must contain the name of the sender, the receiver can keep track if an entry is already made for that user. If so, the XYZ position of that entry will be updated. If not, a new array element will be made with the XYZ position as well.
Public Position pos_array[10];
For example, this array can store up to 11 users, but can be changed if required. On the other hand, the EAI control also holds an array of the objects, represented by polygons, of the login users. Periodically, the EAI will read the pos_array from the chat receiver to find out the new positions of login users. It will then update its own object array and translate the positions of the objects representing each user. As a result, each user will see all other login users moving around in the model, as long as they are visible within a certain range. A virtual tour can then be conducted by allowing a person who is familiar with the surroundings to login as a staff guide, and all users can follow the guide to walk around. When they arrive at certain checkpoint or buildings that need to be explained, the guide will communicate with the users via typing in the chat system. The message will be echoed to all users, and question asking is also be done using the chat system. Although the virtual model along have sufficient facilities to make users familiar with the campus, such as automatic path, wizard showing general information and links, etc., the integration of MOO concept can cause a more thorough understanding of the campus through immediate responds to the information received.
In extension to this MOO model, more interactions can take place within the world by allowing more objects in the world to move according to users actions, and the movement of these objects must also be visible to all other users identically. For example, when one user collide with something, say a soccer, the soccer ball can be seen moving by all users. Moreover, the objects representing the login users can also be carefully made so that some body expressions can be performed, such as nodding the head means agree with certain things etc., so that more interactive information can be provided. However, the implementation will be more complex, since the EAI control has to keep track of the positions of various objects in the world, and so a more complicated data structure should be made. The receiving component will also have to distinguish position values not only between users, but also between different types of objects. Moreover, latency on echoing the positions of objects and increased Internet traffic may result.
11.7.4 Difficulties encountered in the implementation
As mentioned earlier, because of the some security protections within the Internet browsers, the chat system cannot be integrated with the browsers, and hence has to be run as a standalone application. The problem about this is that the EAI cannot be able to communicate with the chat system. According to our implementation in Java, we were intending to make an instance of the chat class within the EAI control, and using the function show() to display the chat window. In this way, the EAI can communicate directly to the chat system since it is created by the EAI. Our EAI control is an applet and is running within a browser window, therefore the show() command will also make a browser window for displaying the chat program. However, we have encountered some difficulties when trying to make sockets to some arbitrary ports, because of the security integrated in the browsers actually do not allow us to do so. However, when the chat program is run using an appletviewer, it works properly and no SocketException occurs. One important drawback is that our design and implementation of the MOO integration cannot be preformed properly, since the EAI control cannot gain control of the chat system. One solution to that is to go through the security issues behind browsers and Java so that our chat programs can be granted to users who agree to minimize the security protections. Another drawback concerning about the chat system is that each user may now need a copy of the appletviewer before they can user the chat system, instead of using a browser window.
Chapter
TWELVE
12.1 Introduction
As VRML 2.0 is becoming the ISO standard, the compatibility is supposed to be very impressive. As we can see, the HTML, Java, JavaScript are all very successful in platform independent and compatibility events. As Sun Microsystems provides every platform the Java Development Kits, and the Netscape Communications Corporation provides the Netscape Navigator for most platforms that make all the Internet Web Page can be browsed using the standard interface, VRML is not as lucky as the previous examples.
As we can observe, there are already many developers starting their projects on developing VRML browser to support cross platform. Such as DimensionX (XXXXX by Microsoft) provides a java 1.02 base VRML browser, which can be setup in any system which installed the Java Development Kits (JDK) 1.02. The WorldViewer by Intervista provides the Windows 95/NT and Macintosh version. The CosmoPlayer from Silicon Graphics now provide the SGI and Windows 3.1/95/NT version and promise to support the other platform in the coming year.
However, what is the problem that causes VRML cannot be cross-platform? The fact that make VRML cannot become platform independent is the complicate 3D calculation. The 3D calculation and 3D libraries are all different. When 3D calculation is processed, at least 70% of the system resources are being used, the VRML browser have to prevent this happened by using the suitable 3D graphic library of the system to provide a better performance and stability.
12.2 Development Stratedy
Due to the current compatibility issues, we decide to build our Virtual Campus into three proposals:
1. The best and powerful interface.
2. The most compatible version.
3. The best performance project.
12.2.1 Best and Powerful Interface -- CosmoPlayer/SGI
Our Virtual Campus is designed using the Silicon Graphic CosmoWorld, as a result, it provide the best view in the CosmoPlayer in the Silicon Graphic as well. Moreover, base on the promise of the CosmoPlayer that it will have all platform versions in the coming year, we decided to follow its Java Interface (External Authoring Interface) as our standard interface development media.


As we can see from above, we have supported many effects in our VRML
scenes, such as free rotating, raining and thunder effect. Even network connection are able to implement inside the VRML world. Moreover, the high performance Silicon Graphic machines are used, the loading and running speed of the Virtual Campus loading and running become faster. The whole Virtual Campus Project is so amazing in the UNSW SGI lab Indigo10000 machine.
12.2.2 Most Compatible Version -- HTML base, VRML as a supplementary-Unix
Since up to now there isn't get a good VRML browser for the Unix, which include easy install, user installable instead of administrator install only, good performance and plugin of the Netscape browser. Finally, we support the external browser which can provide a "one-building" browsing function, which can be popup as soon as a building name is selected from the HTML base, which let the user able to view each building one by one. If the processor of the Unix machine is fast, we even provide a whole Virtual Campus file for them to load. The average building loading time is about one minute and for the whole campus to be loaded is about forty-five minutes or even more! The browser that we are using is the Liquid Reality by DimensionX.

12.2.3 Power-Macintosh
At this moment, there is only one viewer that is available for the Macintosh to view the VRML world, the WorldViewer by Intervista, but due to its memory handling, for a Macintosh with more than 32MB of RAM are about to view our whole world without pain. However for a machine that without 32MB of RAM, we recommend to view the "one-building" version as the Unix does.
12.2.4 The best performance project

The most powerful VRML browser that is designed mainly for speed up the VRML scene is the Torch by New Fire, which use the Microsoft DirectX as the 3D library, optimize for the Intel Pentium processor as well as the most powerful PC 3D accelerator chipset 3DFx. This makes the Virtual Campus become 60 frames/sec with the perfect color pattern. However, it supports only in the full screen mode and so the EAI function are obviously disabled.
12.3 Researching on Compatibility
While we are building our Virtual Campus, we are also looking hard to find a VRML browser that is suitable to present our Campus, as we do not want the Virtual Campus become "Silicon Graphic only", so we try hard on supporting other platforms. As we have found, there are ## of VRML browser in different platform that we had try, here are the problem that we face due to the incompatible VRML browser that affect our Virtual Campus development.
|
Speed |
Image Quality |
UnSupport Node |
Hardware Support |
EAI |
Platform |
|
|
CosmoPlayer SGI v1.01 |
Good |
Excellent |
Elevation-Grid |
SGI |
No |
SGI |
|
CosmoPlayer SGI v1.02 |
Good |
Excellent |
JavaScript and Java |
SGI |
Yes |
SGI |
|
CosmoPlayer Windows 1.0 |
Bad |
Average |
No |
Yes |
Win95/NT/3.1 |
|
|
CosmoPlayer Windows 2.0 |
Excellent |
Excellent |
OpenGL, MMX |
Err |
Win95/NT |
|
|
WorldViewer |
Average |
Average |
Direct 3D, Quick 3D |
Yes |
Win95/NT, Mac |
|
|
Liquid Reality |
Bad |
Bad |
Direct 3D, |
No |
Win95/NT,Unix SGI |
|
|
Torch |
Excellent |
Excellent |
Elevation-Grid, Extrusion |
OpenGL, 3DFx, DirectX |
No |
Win95/NT |
|
Sony |
Average |
Average |
Direct3D |
No |
Win95/NT |
Chapter
THIRTEEN
13.1 Conclusions
Virtual Campus is a final year thesis for us. The purpose of it is to create a 3D interactive model of the University of New South Wales Campus. It is written using VRML so that it can be viewed under the Internet. Hence it has to be kept at a modem downloadable rate.
Over months of hard work, add these requirements were met with added features like Online Wizard to teach the viewer how to use or operate the Virtual Campus, at the same time telling the viewer the information about the campus as he or she surfs through. There is also a ViewPoint Controlling Panel, which allow the users to switch viewpoint from a normal size human being to a building size giant. Furthermore, there is a control panel, which allows the viewer to create rain, thunder as well as changing the colour of the sky. The feature can let the viewer experience the Virtual Campus under different weather conditions.
Moreover, there are preset viewpoints in Virtual Campus, which the viewer can activate by simply clicking a mouse. When clicked on these preset viewpoints, Virtual Campus will bring the viewer to that location, giving the viewer a feeling of looking at pictures. However this is far better than pictures as the viewer can interact with the world after. In Virtual Campus, there is an Animated Path which works like a map in 3D. All the viewer needs to do is to select a starting a location and a destination, then Virtual Campus will guide him or her to the destination. This is very for introducing UNSW to a foreigner, as they can get to know the campus better before come over. Besides that, sounds were added into Virtual Campus in order to make it more atmospheric.
Last but not least, Live Chat and "Show yourself" were implemented in Virtual Campus. These two command were implemented in order to make Virtual Campus a Multi-user Interactive World rather than Single-user. Overall, Virtual Campus is a very useful project as it can allow the viewer to play with the features while getting to know the campus better. At the same time, it is helping in promoting the campus.
Appendix
A
Since different platforms may require different VRML browsers, it arises the importance of providing an installation guide to the users using different machines. It is necessary since in some platform, such as Unix, the installation process may be quite complicated, and so a guide will save time on those issues.
Irix on Silicon Graphics
System Requirement: Recommend Texture Mapping Hardware
Internet Browser : Netscape 3.01S only (www.netscape.com)
VRML 2.0 Browser : CosmoPlayer 1.02 only (cosmo.sgi.com)
How to install
For user (not root)
After download the file:
5.3_cosmo_player_1.0.2.tardist for Irix5.3
6.3_cosmo_player_1.0.2.tardist for Irix6.3
6.2_6.4_cosmo_player_1.0.2.tardist for Irix6.2 or 6.4
into your account.
(Assume at the home directory)
make a directory and extract the file into this directory
% mkdir cosmoplayer
% cd cosmoplayer
% gzip -dc ../filename | tar -xvf -
% cd ..
Suppose you have a file call .profile in your directory, edit the file with your familiar editor by adding the following lines:
LD_LIBRARY_PATH=$HOME/cosmoplayer/usr/lib;
export LD_LIBRARY_PATH
After then, try to move the classes directory into your own Netscape 3.01S directory, which is located at the .netscape directory
% cd
% mv cosmoplayer/usr/CosmoPlayer/classes/vrml .netscape
Then the netscape will know where the classes file are located.
and then restart your computer (Logout)
% netscape&
Hopefully the VRML plugin will work. To test the VRML plugin, try goto a VRML scene by typing:
http://turing.vip.cse.unsw.edu.au/bdmx/ThesisNov/Colored/Central_Lecture _Theatre_Block_E19.wrl
You will get the following result...
Unix on Solaris
System Requirement: JDK 1.02 installed, gzip & tar
Internet Browser : Netscape (http://www.netscape.com/)
VRML 2.0 Browser : Liquid Reality 1.0 beta 17
www.microsoft.com/dimensionx/lrHow to install
For user (not root)
After download the file lr-sol10b17.tar.gz into your account.
(Assume at the home directory)
make a directory and extract the file into this directory
% mkdir lr
% cd lr
% gzip -dc ../lr-sol10b17.tar.gz | tar -xvf -
% cd ..
Suppose you have a file call .profile in your directory, edit the file with your familiar editor by adding the following lines:
LR_HOME=$HOME/DownLoad/temp/bin
LD_LIBRARY_PATH=$HOME/lr/lib/sparc; export LD_LIBRARY_PATH
PATH=$LR_HOME:$PATH; export PATH
CLASSPATH=$CLASSPATH:$HOME/lr/classes; export CLASSPATH
Important: If you have no CLASSPATH in your profile, you will get error
with all your java application. You have to ask for where your java
classes file are located and add the classpath in it as well.
For example:
The netscape java file in .netscape and the JDK1.02 classes files are in /usr/java/classes and so on then your should add a line more at your .profile (The previous will still exist, which mean 2 CLASSPATH line.
CLASSPATH=$CLASSPATH:$HOME/.netscape:/usr/java/classes; export CLASSPATH
and then restart your computer (Logout)
% cd lr/examples
% appletviewer viewer.html
Hopefully the VRML viewer will start....
To test the Viewer, try put on a VRML scene by typing:
http://turing.vip.cse.unsw.edu.au/bdmx/ThesisNov/Colored/Central_Lecture
_Theatre_Block_E19.wrl
You will get the following result...
MacOS
System Requirement: Stuffit
Internet Browser : Netscape 3.01 only (www.netscape.com)
VRML 2.0 Browser : WorldViewer 2.0 beta 1 (www.intervista.com)
How to install
After downloaded the file, extract the file and run install.
P.S. Choose the directory remember to choose the Netscape -> Plugin directory
installed.
P.S.2 remember to set the Netscape memory size to 16MB or higher by
[Select the Netscape Program] Get Info and change the memory size
and then restart your computer
Hopefully the VRML plugin will work with Netscape
To test the VRML plugin, try goto a VRML scene by typing:
http://turing.vip.cse.unsw.edu.au/bdmx/ThesisNov/Colored/Central_Lecture
_Theatre_Block_E19.wrl
You will get the following result...
Appendix
B
First of all, we would like to thank our thesis supervisor, Dr. Tim Lambert. Without him, there won’t be any Virtual Campus. Without Virtual Campus, there won’t be any Virtual Campus Team and there won’t be any fun.
Secondly, we would still like to thank Dr. Tim Lambert, as he has been very helpful while we were doing this thesis. Although he is away during session of year, he still provides enormous help to our thesis. We thank you very much, where would we be without you.
Follow closely to our thesis supervisor, we would like to thank our thesis assessor, Dr. Clark Quinn. We thank him for giving us a lot of idea in creating our Virtual Campus. We would also like to thank him for taking his precious time to arrange things for us. We thank you.
Next, we would like to thank all our friends for giving the support and be our guinea pigs to be one of the firsts to test out the Virtual Campus.
Lastly, we would like to thank each other (Virtual Campus Team Members). Without each other’s help, Virtual Campus won’t be a success.
We apologize for leaving anyone out of this list. As the list too long, we cannot possibly remember everyone who has helped us out, but you know who you are, please thank yourselves for us.
Appendix
C
Sir_Robert_Webster.wrl

#VRML V2.0 utf8 CosmoWorlds V1.0
Group {
children [
DEF Front Transform {
children Shape {
appearance Appearance {
material DEF _0 Material {
ambientIntensity 0.518621
diffuseColor 0.308511 0.0999825 0.17934
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/websterw.gif"
}
textureTransform TextureTransform {
translation -0.02 -0.17
rotation 0
scale 6 2
center 0.52 0.67
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -1 1 1,
-1 -1 1,
1 1 1,
1 -1 1,
1 1 -1,
1 -1 -1,
-1 1 -1,
-1 -1 -1,
-0.807433 1 1,
-0.807434 -1 1,
-1 -0.537011 1,
-0.807433 -0.53701 1 ]
}
coordIndex [ 4, 5, 7, 6, -1, 6, 7, 1,
10, 0, -1, 1, 7, 5, 3, 9,
-1, 9, 3, 2, 8, 11, -1, 0,
10, 11, 8, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0,
0.0962836 1,
0.0962832 0,
0.0962832 1,
1 0.231495,
0 0.231495,
0.0962833 0.231495,
0.0962833 0.231495 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
7, 2, -1, 0, 1, 3, 2, 6,
-1, 5, 3, 2, 4, 10, -1, 0,
8, 9, 4, -1 ]
creaseAngle 0.5
}
}
translation 30 6 5
scale 20 6 9
}
DEF LG Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.755806 0.623223
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/chemgwall.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 15 3
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 -10 10,
10 -10 10,
10 -10 -10,
-10 -10 -10,
-10 60 10,
10 60 10,
10 60 -10,
-10 60 -10,
10 10 -10,
-10 10 -10,
-0.62017 10 -10,
-0.62017 -10 -10 ]
}
coordIndex [ 0, 3, 11, 2, 1, -1, 7, 4,
5, 6, -1, 0, 1, 5, 4, -1,
8, 10, 9, 7, 6, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0,
0 1,
0 0,
1 0,
1 1,
0 1,
0 0,
1 0,
0.531008 0,
0.468992 0 ]
}
texCoordIndex [ 0, 1, 12, 3, 2, -1, 4, 5,
6, 7, -1, 1, 3, 7, 4, -1,
9, 11, 10, 7, 4, -1 ]
creaseAngle 0.5
}
}
translation -20 -2 10
scale 3 0.2 1.4
}
DEF Theater Transform {
children Shape {
appearance Appearance {
material DEF _1 Material {
}
texture ImageTexture {
url "textures/rockMarbles.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.390374 0.390374 0.390374 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 7,
6, -1, 6, 7, 1, 0, -1, 2,
3, 5, 4, -1, 6, 0, 2, 4,
-1, 1, 7, 5, 3, -1 ]
colorIndex [ 0, 0, 1, 1, 0, 0 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
colorPerVertex FALSE
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1, 0, 1, 3, 2,
-1, 0, 1, 3, 2, -1 ]
creaseAngle 0.5
}
}
translation 14 9 -16.5
scale 0.9 0.3 0.75
}
Transform {
children Shape {
appearance Appearance {
material USE _1
texture ImageTexture {
url "textures/rockMarbles.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 10 -10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.390374 0.390374 0.390374 ]
}
coordIndex [ 4, 5, 1, 0, -1, 4, 0, 2,
3, -1, 0, 1, 2, -1, 3, 5,
4, -1, 2, 1, 5, 3, -1 ]
colorIndex [ 0, 0, 0, 0, 1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
colorPerVertex FALSE
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 2, -1, 0, 3,
2, -1, 3, 1, 1, 0, -1 ]
creaseAngle 0.5
}
}
translation 21.5 5.5 -16.5
scale 0.15 0.05 0.75
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.516129
diffuseColor 0.31 0.100465 0.180206
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
}
geometry Box {
size 20 20 20
}
}
translation 12 3.5 15
scale 0.2 0.05 0.1
}
Transform {
children Shape {
appearance Appearance {
material DEF _2 Material {
}
texture ImageTexture {
url "textures/ucglass.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 4 3
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
10 10 10,
10 10 -10,
-10 10 -10,
-10 -50 10,
10 -50 10,
10 -50 -10,
-10 -50 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.271481 0.400095 0.860963 ]
}
coordIndex [ 4, 7, 6, 5, -1, 0, 3, 7,
4, -1, 2, 1, 5, 6, -1 ]
colorIndex [ 0, 0, 0, 0, -1, 0, 1, 0,
1, -1, 0, 1, 0, 1, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
1 1,
0 1,
0 0,
1 0,
1 1,
0 1,
1 0 ]
}
texCoordIndex [ 2, 3, 4, 5, -1, 1, 0, 3,
4, -1, 1, 0, 3, 4, -1 ]
creaseAngle 0.5
}
}
translation 13 10 -6.5
scale 0.7 0.2 0.25
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.634654 0.17238
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
}
geometry Box {
size 20 20 20
}
}
translation 12.5 3 -16.5
scale 0.75 0.3 0.75
}
Transform {
children Shape {
appearance Appearance {
material USE _2
}
geometry Box {
size 20 20 20
}
}
translation -20 9.6 10
scale 3.1 0.05 1.5
}
Transform {
children Shape {
appearance Appearance {
material USE _0
texture ImageTexture {
url "textures/blackGlass.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -1 -0.537011 1,
-1 -1 1,
-0.807434 -1 1,
-0.807433 -0.53701 1 ]
}
color Color {
color [ 0.909091 0.909091 0.909091,
0.0850785 0.319799 0.586096 ]
}
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ 1, 0, 1, 0, -1 ]
texCoord TextureCoordinate {
point [ 0.0115104 0.980776,
0.00636843 0.0140814,
0.669686 0.00893945,
0.674828 0.985919 ]
}
colorPerVertex TRUE
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation 30 6 5
scale 20 6 9
}
Transform {
children Shape {
appearance Appearance {
material USE _2
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 -10,
-10 10 10,
10 10 10,
10 10 -10 ]
}
coordIndex [ 0, 1, 2, 3, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 0,
1 1 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation 13 10 -6.5
scale 0.7 0.2 0.25
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.634654 0.17238
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ 10 -10 -10,
-0.62017 -10 -10,
-0.62017 10 -10,
10 10 -10 ]
}
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0 0,
0.531008 0,
0.531008 1,
0 1 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation -20 -2 10
scale 3 0.2 1.4
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.755806 0.623223
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/webwall.gif"
}
textureTransform TextureTransform {
translation 0.028 0
rotation 0
scale 8.5 1
center 0.472 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -0.62017 -10 -10,
-10 -10 -10,
-10 10 -10,
-0.62017 10 -10 ]
}
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0.531008 0,
1 0,
1 1,
0.531008 1 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation -20 -2 10
scale 3 0.2 1.4
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.755806 0.623223
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/rockMarbles.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 2 2
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 -10,
-10 -10 -10,
-10 -10 10,
-10 60 10,
-10 60 -10,
10 -10 10,
10 -10 -10,
10 10 -10,
10 60 -10,
10 60 10 ]
}
coordIndex [ 0, 1, 2, 3, 4, -1, 5, 6,
7, 8, 9, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0.285714 0,
0.0186085 0.00647251,
0.0145631 0.993528,
0.985437 0.988134,
1 0,
0.00242719 0.0226537,
-0.00161809 0.98274,
0.277508 0.98274,
0.997573 0.998921,
0.989482 0.0118663 ]
}
texCoordIndex [ 0, 1, 2, 3, 4, -1, 5, 6,
7, 8, 9, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation -20 -2 10
scale 3 0.2 1.4
}
Transform {
children Shape {
appearance Appearance {
material USE _0
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -1 1 -1,
-1 1 1,
-0.807433 1 1,
1 1 1,
1 1 -1 ]
}
coordIndex [ 0, 1, 2, 3, 4, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
0.0962836 0,
1 0,
1 1 ]
}
texCoordIndex [ 0, 1, 2, 3, 4, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation 30 6 5
scale 20 6 9
}
Transform {
children Shape {
appearance Appearance {
material USE _0
texture ImageTexture {
url "textures/websterw.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 6 2
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ 1 1 1,
1 -1 1,
1 -1 -1,
1 1 -1 ]
}
coordIndex [ 0, 1, 2, 3, -1 ]
texCoord TextureCoordinate {
point [ 0.761573 0.0471605,
0.761573 -0.246994,
0.907288 -0.242908,
0.907288 0.0471605 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation 30 6 5
scale 20 6 9
}
]
}
Heffron Building
#VRML V2.0 utf8 CosmoWorlds V1.0
Group {
children [
Transform {
children Shape {
appearance Appearance {
material DEF _0 Material {
}
texture ImageTexture {
url "textures/blackGlass.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.379901 0.502357 0.8 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 7,
6, -1, 6, 7, 1, 0, -1, 2,
3, 5, 4, -1, 6, 0, 2, 4,
-1, 1, 7, 5, 3, -1 ]
colorIndex [ 0, 0, 0, 0, -1, 0, 0, 0,
0, -1, 1, 0, 1, 0, -1, 1,
0, 1, 0, -1, 0, 0, 0, 0,
-1, 0, 0, 0, 0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0.0166524 0.00379744,
0.664544 1.00649,
0.67997 0.00893945 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1, 0, 1, 3, 2,
-1, 0, 1, 3, 2, -1 ]
creaseAngle 0.5
}
}
translation 33 2 -3
scale 0.8 0.2 0.3
}
Transform {
children Shape {
appearance Appearance {
material USE _0
texture ImageTexture {
url "textures/ucglass.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 3 6
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.327785 0.330658 1 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 1,
0, -1 ]
colorIndex [ 1, 0, 1, 0, -1, 1, 0, 1,
0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1 ]
solid FALSE
creaseAngle 0.5
}
}
translation -30.25 12 -6.75
scale 0.575 1.2 0.375
}
Transform {
children Shape {
appearance Appearance {
material USE _0
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.8 0.796051 0.291017 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 7,
6, -1, 6, 7, 1, 0, -1, 2,
3, 5, 4, -1, 6, 0, 2, 4,
-1, 1, 7, 5, 3, -1 ]
colorIndex [ 0, 0, 1, 1, 0, 0 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
colorPerVertex FALSE
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1, 0, 1, 3, 2,
-1, 0, 1, 3, 2, -1 ]
creaseAngle 0.5
}
}
translation 33 8 -3
scale 0.8 0.4 0.3
}
Transform {
children Inline {
url "inline/Heffron_Theater.wrl"
bboxCenter 0.000185966 8.56344 7.2
bboxSize 45 17.1269 16.6001
}
translation 32.9998 0.00155354 -17.7
}
Transform {
children Shape {
appearance Appearance {
material DEF _1 Material {
}
}
geometry Box {
size 20 20 20
}
}
translation 29.09 4.25 19
scale 0.4155 0.025 0.1
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.323259 0.299375
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
}
geometry Box {
size 20 20 20
}
}
translation -31.15 0.400002 18.5
scale 0.2075 0.04 0.05
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.323259 0.299375
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 -10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
coordIndex [ 2, 3, 5, 4, -1, 0, 5, 3,
1, -1, 1, 3, 2, -1, 4, 5,
0, -1, 1, 2, 4, 0, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 1, 3, 2, -1, 0, 1,
3, -1, 2, 2, 2, 3, -1 ]
creaseAngle 0.5
}
}
translation -31.15 0.400002 19.5
scale 0.2075 0.04 0.05
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.323259 0.299375
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 -10 10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
coordIndex [ 4, 5, 1, 0, -1, 1, 5, 3,
2, -1, 0, 1, 2, -1, 3, 5,
4, -1, 4, 0, 2, 3, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, -1, 1, 3,
2, -1, 2, 2, 3, 3, -1 ]
creaseAngle 0.5
}
}
translation -23.89 0.400002 18.5
scale 0.519 0.04 0.05
}
Transform {
children Shape {
appearance Appearance {
material Material {
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -6.23 0 4,
6.23 0 4,
-6.23 0.5 4,
6.23 0.5 4,
-4.15 0 0,
4.15 0 0,
-4.15 0 0,
4.15 0 0 ]
}
coordIndex [ 2, 3, 7, 6, -1, 0, 1, 5,
4, -1, 0, 4, 6, 2, -1, 1,
5, 7, 3, -1, 0, 1, 3, 2,
-1, 4, 5, 7, 6, -1 ]
solid FALSE
}
}
translation -29.07 4 18
}
DEF Bridge Transform {
children Shape {
appearance Appearance {
material Material {
}
texture ImageTexture {
url "textures/ucglass.gif"
}
textureTransform TextureTransform {
translation 0 0.25
rotation 0
scale 4 2
center 0.5 0.25
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.168745 0.346389 0.721925 ]
}
coordIndex [ 6, 7, 1, 0, -1, 2, 3, 5,
4, -1, 6, 0, 2, 4, -1, 1,
7, 5, 3, -1 ]
colorIndex [ 1, 0, 1, 0, -1, 1, 0, 1,
0, -1, 0, 1, 0, 1, -1, 0,
1, 0, 1, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1 ]
solid FALSE
creaseAngle 0.5
}
}
translation -17.65 8 26
scale 0.104 0.4 0.8
}
DEF Chemistry_Main Transform {
children LOD {
range [ ]
level DEF Main_Chemistry Transform {
children [
DEF Ground_Floor Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.755806 0.623223
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/chemgwall.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 3 1
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -1 1 1,
-1 -1 1,
1 1 1,
1 -1 1,
1 1 -1,
1 -1 -1,
-1 1 -1,
-1 -1 -1,
8.55294 1 -1,
8.55294 -1 -1,
7.22032 -1 -1,
7.22032 1 -1,
2.33262 1 -1,
2.33262 -1 -1,
1 -1 -1,
1 1 -1,
8.55294 1 1,
8.55294 -1 1,
10.5508 -1 1,
10.5508 1 1,
10.5508 -1 -1,
10.5508 1 -1,
8.55294 1 -1,
8.55294 -1 -1,
2.33262 1 1,
2.33262 -1 1,
7.22032 -1 1,
7.22032 1 1,
7.22032 -1 -1,
7.22032 1 -1,
2.33262 1 -1,
2.33262 -1 -1 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 7,
6, -1, 2, 3, 5, 4, -1, 6,
0, 2, 4, -1, 1, 7, 5, 3,
-1, 8, 9, 10, 11, -1, 12, 13,
14, 15, -1, 16, 17, 18, 19, -1,
22, 16, 19, 21, -1, 21, 20, 23,
22, -1, 17, 23, 20, 18, -1, 22,
23, 17, 16, -1, 24, 25, 26, 27,
-1, 27, 26, 28, 29, -1, 30, 24,
27, 29, -1, 29, 28, 31, 30, -1,
25, 31, 28, 26, -1, 30, 31, 25,
24, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0,
0 1,
0 0,
1 0,
1 1,
0 1,
0 0,
1 0,
1 1,
0 1,
0 0,
1 0,
1 1,
0 1,
0 0,
1 0,
1 1 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1, 0, 1, 3, 2,
-1, 4, 5, 6, 7, -1, 8, 9,
10, 11, -1, 12, 13, 14, 15, -1,
12, 13, 14, 15, -1, 12, 13, 14,
15, -1, 12, 13, 14, 15, -1, 12,
13, 14, 15, -1, 16, 17, 18, 19,
-1, 16, 17, 18, 19, -1, 16, 17,
18, 19, -1, 16, 17, 18, 19, -1,
16, 17, 18, 19, -1, 16, 17, 18,
19, -1 ]
solid FALSE
creaseAngle 0.5
}
}
translation -44.65 2 8.5
scale 9.35 2 9.5
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.755806 0.623223
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/rockMarbles.gif"
}
}
geometry Box {
size 20 20 20
}
}
translation 0 0.4 8.5
scale 5.4 0.04 0.95
}
Transform {
children Shape {
appearance Appearance {
material Material {
}
texture ImageTexture {
url "textures/ucglass.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 3 1
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
-10 10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.168745 0.346389 0.721925 ]
}
coordIndex [ 0, 1, 3, 2, -1, 5, 0, 2,
4, -1 ]
colorIndex [ 1, 0, 1, 0, -1, 0, 0, 0,
0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1 ]
creaseAngle 0.5
}
}
translation -29.07 2 7.835
scale 0.623 0.2 0.8835
}
Transform {
children Shape {
appearance Appearance {
material USE _1
texture ImageTexture {
url "textures/ucglass.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ 10 -10 4.37114e-07,
10 10 4.37114e-07,
9.2388 -10 3.82684,
9.2388 10 3.82684,
7.07107 -10 7.07107,
7.07107 10 7.07107,
3.82683 -10 9.2388,
3.82683 10 9.2388,
1.50996e-06 -10 10,
1.50996e-06 10 10,
-3.82683 -10 9.2388,
-3.82683 10 9.2388,
-7.07107 -10 7.07107,
-7.07107 10 7.07107,
-9.2388 -10 3.82684,
-9.2388 10 3.82684,
-10 -10 -1.19249e-07,
-10 10 -1.19249e-07,
0 10 0,
0 -10 0 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.168745 0.346389 0.721925 ]
}
coordIndex [ 0, 1, 3, 2, -1, 2, 3, 5,
4, -1, 4, 5, 7, 6, -1, 6,
7, 9, 8, -1, 8, 9, 11, 10,
-1, 10, 11, 13, 12, -1, 12, 13,
15, 14, -1, 14, 15, 17, 16, -1,
18, 17, 15, -1, 18, 15, 13, -1,
18, 13, 11, -1, 18, 11, 9, -1,
18, 9, 7, -1, 18, 7, 5, -1,
18, 5, 3, -1, 18, 3, 1, -1,
19, 0, 2, -1, 19, 2, 4, -1,
19, 4, 6, -1, 19, 6, 8, -1,
19, 8, 10, -1, 19, 10, 12, -1,
19, 12, 14, -1, 19, 14, 16, -1 ]
colorIndex [ 1, 0, 0, 0, -1, 0, 0, 1,
0, -1, 0, 1, 0, 0, -1, 0,
0, 0, 1, -1, 1, 0, 1, 0,
-1, 0, 1, 0, 0, -1, 0, 0,
0, 1, -1, 1, 0, 1, 0, -1,
0, 1, 0, -1, 0, 0, 0, -1,
0, 0, 1, -1, 0, 1, 0, -1,
0, 0, 0, -1, 0, 0, 1, -1,
0, 1, 0, -1, 0, 0, 0, -1,
0, 1, 0, -1, 0, 0, 0, -1,
0, 0, 0, -1, 0, 0, 1, -1,
0, 1, 0, -1, 0, 0, 0, -1,
0, 0, 1, -1, 0, 1, 0, -1 ]
texCoord TextureCoordinate {
point [ 0.75 0,
0.75 1,
0.6875 0,
0.6875 1,
0.625 0,
0.625 1,
0.5625 0,
0.5625 1,
0.5 0,
0.5 1,
0.4375 0,
0.4375 1,
0.375 0,
0.375 1,
0.3125 0,
0.3125 1,
0.25 0,
0.25 1,
0.5 0.5,
0 0.5,
0.0380602 0.308658,
0.146447 0.146446,
0.308658 0.0380602,
0.5 0,
0.691342 0.0380602,
0.853553 0.146447,
0.96194 0.308658,
1 0.5,
0.853553 0.853553,
0.691342 0.96194,
1 0.5,
0.96194 0.691342,
0.5 1,
0.308658 0.96194,
0.146447 0.853554,
0.0380602 0.691342 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 2, 3, 5,
4, -1, 4, 5, 7, 6, -1, 6,
7, 9, 8, -1, 8, 9, 11, 10,
-1, 10, 11, 13, 12, -1, 12, 13,
15, 14, -1, 14, 15, 17, 16, -1,
18, 19, 20, -1, 18, 20, 21, -1,
18, 21, 22, -1, 18, 22, 23, -1,
18, 23, 24, -1, 18, 24, 25, -1,
18, 25, 26, -1, 18, 26, 27, -1,
18, 30, 31, -1, 18, 31, 28, -1,
18, 28, 29, -1, 18, 29, 32, -1,
18, 32, 33, -1, 18, 33, 34, -1,
18, 34, 35, -1, 18, 35, 19, -1 ]
creaseAngle 0.5
}
}
translation -31.46 2 16.67
scale 0.096 0.2 0.096
}
Transform {
children Shape {
appearance Appearance {
material Material {
}
texture ImageTexture {
url "textures/ucglass.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 3 1
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.168745 0.346389 0.721925 ]
}
coordIndex [ 0, 1, 3, 2, -1 ]
colorIndex [ 1, 0, 1, 0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1 ]
creaseAngle 0.5
}
}
translation 29.09 2 7.835
scale 0.623 0.2 0.8835
}
DEF Level1_Plus Transform {
children Shape {
appearance Appearance {
material DEF _2 Material {
ambientIntensity 0.2
diffuseColor 0.8 0.755806 0.623223
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/chemwall.gif"
}
textureTransform TextureTransform {
translation 0.09 0.13
rotation 0
scale 16 4
center 0.41 0.37
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 7,
6, -1, 6, 0, 2, 4, -1, 1,
7, 5, 3, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1 ]
creaseAngle 0.5
}
}
translation 0 14 8.5
scale 5.4 1 0.95
}
Transform {
children Shape {
appearance Appearance {
material USE _0
texture ImageTexture {
url "textures/squareWindow.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 16 1
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 10,
-10 -10 10,
10 10 10,
10 -10 10,
10 10 -10,
10 -10 -10,
-10 10 -10,
-10 -10 -10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.168745 0.346389 0.721925 ]
}
coordIndex [ 0, 1, 3, 2, -1, 4, 5, 7,
6, -1, 6, 7, 1, 0, -1, 2,
3, 5, 4, -1 ]
colorIndex [ 0, 1, 0, 1, -1, 1, 0, 1,
0, -1, 1, 0, 1, 0, -1, 1,
0, 1, 0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 1,
1 0 ]
}
texCoordIndex [ 0, 1, 3, 2, -1, 0, 1, 3,
2, -1, 0, 1, 3, 2, -1, 0,
1, 3, 2, -1 ]
creaseAngle 0.5
}
}
translation 0 25 8.5
scale 5.15 0.1 0.7
}
Transform {
children Shape {
appearance Appearance {
material USE _0
}
geometry Box {
size 20 20 20
}
}
translation 0 26.5 8.5
scale 5.4 0.05 0.95
}
Transform {
children Shape {
appearance Appearance {
material USE _2
texture ImageTexture {
url "textures/rockMarbles.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 2 3
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 -10,
-10 10 10,
-10 -14 -10,
-10 -14 10,
10 -14 10,
10 -14 -10,
10 10 10,
10 10 -10 ]
}
coordIndex [ 1, 0, 2, 3, -1, 7, 6, 4,
5, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
1 0,
1 1,
0 1,
0 0,
1 0,
0 1,
0 0,
1 0,
0 1,
1 0,
1 1 ]
}
texCoordIndex [ 2, 0, 4, 5, -1, 11, 9, 7,
8, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation 0 14 8.5
scale 5.4 1 0.95
}
]
}
}
}
Transform {
children Shape {
appearance Appearance {
material USE _0
texture ImageTexture {
url "textures/ucglass.gif"
}
textureTransform TextureTransform {
translation 0 0
rotation 0
scale 1 6
center 0.5 0.5
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ 10 -10 10,
10 -10 -10,
-10 110 -10,
-10 110 10,
10 110 10,
10 110 -10,
-10 -10 -10,
-10 -10 10 ]
}
color Color {
color [ 0.8 0.8 0.8,
0.327785 0.330658 1 ]
}
coordIndex [ 5, 4, 0, 1, -1, 3, 2, 6,
7, -1 ]
colorIndex [ 0, 1, 0, 1, -1, 0, 1, 0,
1, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 0,
0 1,
1 0,
1 1,
0 1,
1 0,
1 1,
0 1,
0 0,
1 0 ]
}
colorPerVertex TRUE
texCoordIndex [ 8, 6, 1, 2, -1, 5, 3, 10,
11, -1 ]
ccw TRUE
solid FALSE
convex TRUE
creaseAngle 0.5
}
}
translation -33 2 -2
scale 0.3 0.2 0.1
}
Transform {
children Shape {
appearance Appearance {
material USE _0
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 -10,
-10 10 10,
10 10 10,
10 10 -10 ]
}
color Color {
color 0.8 0.8 0.8
}
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ 0, 0, 0, 0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 0,
1 1 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid TRUE
convex TRUE
creaseAngle 0.5
}
}
translation -33 14 -2
scale 0.3 1 0.1
}
Transform {
children Shape {
appearance Appearance {
material USE _0
texture ImageTexture {
url "textures/rockMarbles.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ 10 10 -10,
10 -10 -10,
-10 -10 -10,
-10 10 -10 ]
}
color Color {
color 1 1 1
}
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex 0
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 0,
1 1 ]
}
colorPerVertex FALSE
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid FALSE
convex TRUE
creaseAngle 0.5
}
}
translation -30.25 12 -6.75
scale 0.575 1.2 0.375
}
Transform {
children Shape {
appearance Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.8 0.663098 0.525569
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
texture ImageTexture {
url "textures/chempalew.gif"
}
textureTransform TextureTransform {
translation 0 0.1
rotation 0
scale 1 6
center 0.5 0.4
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [ 10 10 10,
10 -10 10,
10 -10 -10,
10 10 -10 ]
}
color NULL
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 0,
1 1 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid FALSE
convex TRUE
creaseAngle 0.5
}
}
translation -30.25 12 -6.75
scale 0.575 1.2 0.375
}
Transform {
children Shape {
appearance Appearance {
material USE _0
}
geometry IndexedFaceSet {
coord Coordinate {
point [ -10 10 -10,
-10 10 10,
10 10 10,
10 10 -10 ]
}
color Color {
color 0.8 0.8 0.8
}
coordIndex [ 0, 1, 2, 3, -1 ]
colorIndex [ 0, 0, 0, 0, -1 ]
texCoord TextureCoordinate {
point [ 0 1,
0 0,
1 0,
1 1 ]
}
texCoordIndex [ 0, 1, 2, 3, -1 ]
ccw TRUE
solid FALSE
convex TRUE
creaseAngle 0.5
}
}
translation -30.25 12 -6.75
scale 0.575 1.2 0.375
}
]
}
Appendix
D
BuildingCanvas.java
import java.awt.*;
import java.applet.*;
import java.awt.image.*;
import java.awt.event.*;
import java.util.*;
import java.net.*;
public class BuildingCanvas extends Canvas {
private Image BuildingImage;
private Image cell[];
public String title;
protected MenuBar parent;
BuildingCanvas (MenuBar mb, String nme) {
parent = mb;
title = nme;
BuildingImage = parent.getImage(parent.getDocumentBase(),"images/"+title+".gif");
int tilex =4;
int tiley =1;
cell = new Image[tilex*tiley];
resize (24,127);
try {
MediaTracker t = new MediaTracker(this);
t.addImage(BuildingImage, 0);
t.waitForID(0);
int iw = BuildingImage.getWidth(null);
int ih = BuildingImage.getHeight(null);
int tw = iw / tilex;
int th = ih / tiley;
CropImageFilter f;
FilteredImageSource fis;
for (int y=0; y<tiley; y++) {
for (int x=0; x<tilex; x++) {
f = new CropImageFilter(tw*x, th*y, tw, th);
fis = new FilteredImageSource(BuildingImage.getSource(), f);
int i = y*tilex+x;
cell[i] = createImage(fis);
t.addImage(cell[i],i);
}
}
t.waitForAll();
System.out.println(title+" loaded.");
} catch (InterruptedException e) { };
}
public void paint(Graphics g) {
g.drawImage(cell[parent.imageIdx],0,0,this);
}
public boolean mouseDown(Event evt, int x, int y) {
parent.removeChildren.setValue(parent.shape);
parent.shape = parent.browser.createVrmlFromString("Inline {url \"../Mapped/"+title+".wrl\"}\n");
parent.addChildren.setValue(parent.shape);
try {
URL aURL = new URL(parent.getDocumentBase(),"Informations/"+title+".html");
parent.getAppletContext().showDocument (aURL, "Informations");
} catch (MalformedURLException e) {
parent.status.setText("Error in URL");
}
return true;
}
public boolean mouseEnter(Event evt, int x, int y) {
parent.active=this;
parent.status.setText(title);
parent.getAppletContext().showStatus(title);
return true;
}
public boolean mouseExit(Event evt, int x, int y) {
if (parent.active==this) {
parent.active=null;
parent.getAppletContext().showStatus("Virtual Campus");
}
return true;
}
// public boolean mouseMove(Event evt, int x, int y) {
// parent.active=this;
// return true;
// }
}
ChatRev.java
import java.net.*;
import java.io.*;
public class ChatRev implements Runnable{
protected static int len = 1024;
public static DatagramSocket ds;
protected JavaChat parent;
Thread t;
public ChatRev(JavaChat parent) {
this.parent=parent;
System.out.println(parent.chatwin);
System.out.println("The Receiver is running.....");
t = new Thread(this, "ChatRev");
t.setPriority(6);
t.start();
}
public void run() {
try{
ds = new DatagramSocket(3000);
System.out.println("The socket is made");
} catch (SocketException e){
System.err.println(e);
}
try{
while (true){
DatagramPacket incoming = new DatagramPacket(new byte[len],len);
ds.receive(incoming);
String tmpstr=new String(incoming.getData(), 0,0,incoming.getLength());
parent.addText(tmpstr);
}
} catch (SocketException e){
System.err.println(e);
}
catch (IOException e){
System.err.println(e);
}
}
}
ChatServer.java
import java.net.*;
import java.io.*;
import java.lang.*;
public class ChatServer {
protected static int Port = 5000;
public static int defaultBufferLength = 1024;
public static byte buffer[] = new byte[defaultBufferLength];
protected static InetAddress address[] = new InetAddress[10];
public static int user = 0;
public static void main(String[] args) {
DatagramPacket incoming;
int port;
int len;
try {
boolean login = false;
DatagramSocket ds = new DatagramSocket(Port);
int ptr = 0;
try {
address[0] = InetAddress.getByName("127.1.1.0");
} catch (UnknownHostException e){
System.err.println(e);
}
while (true){
try{
incoming = new DatagramPacket(buffer, buffer.length);
ds.receive(incoming);
ptr = 0;
login = false;
while ( ( ptr <= user )&&( login == false) ) {
if (incoming.getAddress().getHostAddress().equals(address[ptr].getHostAddress())){
login = true;
}
else {
ptr++;
login = false;
}
}//end while
if (login == false){
address[ptr] = incoming.getAddress();
user++;
}//end if
System.out.println("No. of users:"+user);
respond(ds, incoming);
}// end try
catch (IOException e) {
System.err.println(e);
}
}// end while
}// end try
catch (SocketException se){
System.err.println(se);
}
}//end main
public static void respond(DatagramSocket ds, DatagramPacket dp) {
DatagramPacket outgoing;
String s = new String(dp.getData(),0,0,dp.getLength());
System.out.println(s);
try{
for (int i=1; i<=user; i++){
System.out.println(address[i].getHostAddress());
outgoing = new DatagramPacket(dp.getData(),dp.getLength(), address[i],3000);
ds.send(outgoing);
}// end for
} catch (IOException e){
System.err.println(e);
}
}
}//end
ControlPanel.java
import java.awt.*;
import java.applet.*;
import vrml.external.*;
import vrml.external.field.*;
import netscape.javascript.JSObject;
public class ControlPanel extends Applet{
public Browser browser;
public Panel LightPanel;
public Panel ViewerPanel;
public Panel ViewPointPanel;
public Panel WeatherPanel;
public Panel InternetPanel;
// LightPanel
public Button LightOnOff;
public Scrollbar Intensity;
public Scrollbar Radius;
public int Intensity_num;
public int Radius_num;
// ViewerPanel
public Choice ViewChoice;
public Button ViewJump;
public Button ViewFly;
// ViewpointPanel
public Button View1;
public Button View2;
public Button View3;
public Button View4;
public Choice AniWalk;
// WeatherPanel
public Button RainOnOff;
public Button ThunderOnOff;
public Scrollbar DayNight;
public int DayNight_num;
public int RainOnOff_num;
public int ThunderOnOff_num;
// InternetPanel
public Button JavaChat;
public Button ShowOthers;
public Button ShowYourself;
public TextArea StatusBar;
public void init() {
setBackground(Color.black);
setForeground(Color.white);
// JSObject win = JSObject.getWindow(this);
// JSObject doc = (JSObject) win.getMember("document");
// JSObject embeds = (JSObject) doc.getMember("embeds");
// browser = (Browser) embeds.getSlot(0);
while(browser == null) {
try {
browser = Browser.getBrowser(this);
Thread.sleep(200);
} catch(InterruptedException e) {}
}
setLayout(new FlowLayout());
// LightPanel
LightPanel=new Panel();
LightOnOff=new Button("On/Off");
Intensity=new Scrollbar(Scrollbar.HORIZONTAL,70,1,0,100);
Radius=new Scrollbar(Scrollbar.HORIZONTAL,20,1,0,150);
Intensity_num=70;
Radius_num=150;
// ViewerPanel
ViewerPanel=new Panel();
ViewChoice=new Choice();
ViewJump=new Button("Jump");
ViewFly=new Button("Fly");
// ViewPointPanel;
ViewPointPanel=new Panel();
View1=new Button("1");
View2=new Button("2");
View3=new Button("3");
View4=new Button("4");
AniWalk=new Choice();
// WeatherPanel
new ThunderThread(this);
WeatherPanel=new Panel();
RainOnOff=new Button("On/Off");
ThunderOnOff=new Button("On/Off");
DayNight=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,100);
RainOnOff_num=-1;
ThunderOnOff_num=0;
// InternetPanel
InternetPanel=new Panel();
JavaChat=new Button("Chat");
ShowOthers=new Button("ShowAll");
ShowYourself=new Button("ShowYou");
StatusBar=new TextArea(2,40);
// LightPanel
LightOnOff.setBackground(Color.darkGray);
Intensity.setBackground(Color.gray);
Radius.setBackground(Color.lightGray);
// ViewerPanel
ViewChoice.addItem("Main_Gate");
ViewChoice.addItem("Gate_9");
ViewChoice.addItem("Applied_Science_F10");
ViewChoice.addItem("Australian_Graduate_School_of_Management_G27");
ViewChoice.addItem("Biological_Sciences_D26");
ViewChoice.addItem("BlockHouse");
ViewChoice.addItem("Central_Lecture_Theatre_Block_E19");
ViewChoice.addItem("Chancellery_C22");
ViewChoice.addItem("Civil_Engineering_H20");
ViewChoice.addItem("Dalton_Bldg_F12");
ViewChoice.addItem("E12A");
ViewChoice.addItem("Electrical_Engineering_G17");
ViewChoice.addItem("John_Goodsell_Building_F20");
ViewChoice.addItem("Library_E21");
ViewChoice.addItem("Main_Building_K15_J14_K14_J12");
ViewChoice.addItem("Mathews_Building_Theatres_D23_F23");
ViewChoice.addItem("Mechanical_and_Industrial_Engineering_J17_K17");
ViewChoice.addItem("Morven_Brown_Building_C20");
ViewChoice.addItem("Parking_Station_H25");
ViewChoice.addItem("Quadrangle_G15");
ViewChoice.addItem("Robert_Heffron_Building_E12_E13");
ViewChoice.addItem("Roundhouse_E6");
ViewChoice.addItem("Samuels_Building_F25");
ViewChoice.addItem("Science_Theatre_F13");
ViewChoice.addItem("Sir_John_Clancy_Auditorium_C24");
ViewChoice.addItem("Sir_Robert_Webster_Building_G14");
ViewChoice.addItem("Squarehouse_E4");
ViewChoice.addItem("Willis_Annexe_J18");
ViewJump.setBackground(Color.gray);
ViewFly.setBackground(Color.gray);
// ViewPointPanel
AniWalk.addItem("Lower_To_MainGate");
AniWalk.addItem("Lower_To_Somewhere");
AniWalk.addItem("Lower_To_Mc");
AniWalk.addItem("Lower_To_Middle");
AniWalk.addItem("Lower_To_Upper");
AniWalk.addItem("Middle_To_QuadOutside");
AniWalk.addItem("Middle_To_QuadLower");
AniWalk.addItem("Middle_To_Mc");
AniWalk.addItem("Middle_To_Upper");
AniWalk.addItem("Upper_To_CLB");
AniWalk.addItem("Upper_To_MB");
AniWalk.addItem("Upper_To_Samuel");
AniWalk.addItem("Upper_To_BiomedOutside");
AniWalk.addItem("Upper_To_UpperExit");
View1.setBackground(Color.red);
View2.setBackground(Color.green);
View3.setBackground(Color.blue);
View4.setBackground(Color.yellow);
// WeatherPanel
RainOnOff.setBackground(Color.darkGray);
ThunderOnOff.setBackground(Color.gray);
DayNight.setBackground(Color.lightGray);
// InternetPanel
JavaChat.setBackground(Color.gray);
ShowOthers.setBackground(Color.gray);
ShowYourself.setBackground(Color.gray);
StatusBar.setForeground(Color.black);
StatusBar.setBackground(Color.darkGray);
// Layout Setup
Label tmp;
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
setLayout(gridbag);
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp1 = new Panel();
tmp1.setLayout(new GridLayout(1,1));
tmp=new Label("Building Panel");
tmp1.add(tmp);
gridbag.setConstraints(tmp1, c);
add(tmp1);
c.gridwidth = 1;
c.weightx = 3.0;
gridbag.setConstraints(ViewChoice,c);
add(ViewChoice);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp2 = new Panel();
tmp2.setLayout(new GridLayout(1,2));
tmp2.add(ViewJump);
tmp2.add(ViewFly);
gridbag.setConstraints(tmp2,c);
add(tmp2);
c.weightx = 1.0;
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp3 = new Panel();
tmp3.setLayout(new GridLayout(1,2));
tmp=new Label("Light Panel");
tmp3.add(tmp);
tmp=new Label("Weather Panel");
tmp3.add(tmp);
gridbag.setConstraints(tmp3,c);
add(tmp3);
Panel tmp4 =new Panel();
tmp4.setLayout(new GridLayout(3,4));
tmp4.add(new Label("Switch"));
tmp4.add(LightOnOff);
tmp4.add(new Label("Raining"));
tmp4.add(RainOnOff);
tmp4.add(new Label("Intensity"));
tmp4.add(Intensity);
tmp4.add(new Label("Thunder"));
tmp4.add(ThunderOnOff);
tmp4.add(new Label("Radius"));
tmp4.add(Radius);
tmp4.add(new Label("SkyColor"));
tmp4.add(DayNight);
gridbag.setConstraints(tmp4,c);
add(tmp4);
tmp = new Label("ViewPoint Panel");
gridbag.setConstraints(tmp,c);
add(tmp);
Panel tmp5 = new Panel();
tmp5.setLayout(new GridLayout(1,4));
tmp5.add(View1);
tmp5.add(View2);
tmp5.add(View3);
tmp5.add(View4);
c.gridwidth = 1;
c.weightx = 1.0;
// c.gridwidth = GridBagConstraints.RELATIVE;
gridbag.setConstraints(tmp5,c);
add(tmp5);
c.gridwidth = 1;
c.weightx = 3.0;
c.gridwidth = GridBagConstraints.REMAINDER;
gridbag.setConstraints(AniWalk,c);
add(AniWalk);
tmp = new Label("Internet Panel");
c.weightx = 2.0;
gridbag.setConstraints(tmp,c);
add(tmp);
c.gridwidth = GridBagConstraints.REMAINDER;
Panel tmp6 = new Panel();
tmp6.setLayout(new GridLayout(1,3));
tmp6.add(JavaChat);
tmp6.add(ShowOthers);
tmp6.add(ShowYourself);
gridbag.setConstraints(tmp6,c);
add(tmp6);
gridbag.setConstraints(StatusBar,c);
add(StatusBar);
Node vptNode = browser.getNode("Main_Gate_V");
EventInSFBool set_bind = (EventInSFBool) vptNode.getEventIn("set_bind");
set_bind.setValue(true);
}
public boolean action (Event evt, Object SomeObject) {
if (evt.target==ViewFly) {
String vpt = ViewChoice.getSelectedItem();
StringBuffer sb = new StringBuffer("#");
sb.append(vpt);
sb.append("_V");
String s[]=new String[1];
s[0]=sb.toString();
browser.loadURL(s, null);
}
if (evt.target==ViewJump) {
String vpt = ViewChoice.getSelectedItem();
StringBuffer sb = new StringBuffer(vpt);
sb.append("_V");
Node vptNode = browser.getNode(sb.toString());
EventInSFBool set_bind = (EventInSFBool) vptNode.getEventIn("set_bind");
set_bind.setValue(true);
}
if (evt.target==LightOnOff) {
Node slNode = browser.getNode("Light1");
EventOutSFBool on_changed = (EventOutSFBool) slNode.getEventOut("on");
boolean tmp = on_changed.getValue();
EventInSFBool set_on = (EventInSFBool) slNode.getEventIn("on");
set_on.setValue(!tmp);
}
if (evt.target==RainOnOff) {
Node swNode = browser.getNode("Rain");
if (RainOnOff_num==0) RainOnOff_num=-1; else RainOnOff_num=0;
EventInSFInt32 set_whichChoice = (EventInSFInt32) swNode.getEventIn("whichChoice");
set_whichChoice.setValue(RainOnOff_num);
}
if (evt.target==ThunderOnOff) {
if (ThunderOnOff_num==1) ThunderOnOff_num=0; else ThunderOnOff_num=1;
Node swNode1 = browser.getNode("BG");
EventInSFBool set_bind1 = (EventInSFBool) swNode1.getEventIn("set_bind");
set_bind1.setValue(true);
}
if (evt.target==View1) {
Node nvNode = browser.getNode("NVStatus");
EventInMFFloat set_avatarSize = (EventInMFFloat) nvNode.getEventIn("avatarSize");
float avSize[]=new float[3];
avSize[0]=(float) .5;
avSize[1]=(float) 1;
avSize[2]=(float) .05;
set_avatarSize.setValue(avSize);
EventInSFBool set_bind = (EventInSFBool) nvNode.getEventIn("set_bind");
set_bind.setValue(true);
}
if (evt.target==View2) {
Node nvNode = browser.getNode("NVStatus");
EventInMFFloat set_avatarSize = (EventInMFFloat) nvNode.getEventIn("avatarSize");
float avSize[]=new float[3];
avSize[0]=(float) .5;
avSize[1]=(float) 5;
avSize[2]=(float) .1;
set_avatarSize.setValue(avSize);
EventInSFBool set_bind = (EventInSFBool) nvNode.getEventIn("set_bind");
set_bind.setValue(true);
}
if (evt.target==View3) {
Node nvNode = browser.getNode("NVStatus");
EventInMFFloat set_avatarSize = (EventInMFFloat) nvNode.getEventIn("avatarSize");
float avSize[]=new float[3];
avSize[0]=(float) .5;
avSize[1]=(float) 10;
avSize[2]=(float) .5;
set_avatarSize.setValue(avSize);
EventInSFBool set_bind = (EventInSFBool) nvNode.getEventIn("set_bind");
set_bind.setValue(true);
}
if (evt.target==View4) {
Node nvNode = browser.getNode("NVStatus");
EventInMFFloat set_avatarSize = (EventInMFFloat) nvNode.getEventIn("avatarSize");
float avSize[]=new float[3];
avSize[0]=(float) .5;
avSize[1]=(float) 15;
avSize[2]=(float) 1;
set_avatarSize.setValue(avSize);
EventInSFBool set_bind = (EventInSFBool) nvNode.getEventIn("set_bind");
set_bind.setValue(true);
}
if (evt.target==ShowOthers) {
Node psNode = browser.getNode("ALLWORLD_prox");
EventOutSFVec3f position_changed = (EventOutSFVec3f) psNode.getEventOut("position_changed");
EventOutSFRotation orientation_changed = (EventOutSFRotation) psNode.getEventOut("orientation_changed");
float pos[]=position_changed.getValue();
float rot[]=orientation_changed.getValue();
StatusBar.appendText("X:"+Float.toString(pos[0])+" Y:"+Float.toString(pos[1])+" Z:"+Float.toString(pos[2]));
StatusBar.appendText(" ("+Float.toString(rot[0])+","+Float.toString(rot[1])+","+Float.toString(rot[2])+") ");
StatusBar.appendText(Float.toString(rot[3]));
char ch[]={((char) 10)};
StatusBar.appendText(new String(ch));
}
if (evt.target == AniWalk) {
StringBuffer sb = new StringBuffer(AniWalk.getSelectedItem());
StatusBar.appendText(sb.toString());
char ch[]={((char) 10)};
StatusBar.appendText(new String(ch));
String s = sb.toString();
Node MovingNode = browser.getNode(s);
sb=new StringBuffer(s);
sb.append("_C");
Node Clock = browser.getNode(sb.toString());
sb=new StringBuffer(s);
sb.append("_T");
Node CubePath = browser.getNode(sb.toString());
sb=new StringBuffer(s);
sb.append("_R");
Node CubePath2 = browser.getNode(sb.toString());
EventInSFBool set_enabled = (EventInSFBool) Clock.getEventIn("enabled");
set_enabled.setValue(false);
browser.addRoute(CubePath, "value_changed",MovingNode, "set_position");
browser.addRoute(CubePath2, "value_changed",MovingNode, "set_orientation");
browser.addRoute(Clock, "fraction_changed",CubePath, "set_fraction");
browser.addRoute(Clock, "fraction_changed",CubePath2, "set_fraction");
browser.addRoute(MovingNode, "bindTime",Clock, "set_startTime");
set_enabled.setValue(true);
EventInSFBool set_bind = (EventInSFBool) MovingNode.getEventIn("set_bind");
set_bind.setValue(true);
EventOutSFBool get_isBound = (EventOutSFBool) MovingNode.getEventOut("isBound");
}
return false;
}
public boolean handleEvent(Event evt) {
if (evt.id == Event.SCROLL_LINE_UP || evt.id == Event.SCROLL_LINE_DOWN ||
evt.id == Event.SCROLL_PAGE_UP || evt.id == Event.SCROLL_PAGE_DOWN ||
evt.id == Event.SCROLL_ABSOLUTE) {
if (Intensity_num!=Intensity.getValue()) {
Node slNode = browser.getNode("Light1");
EventInSFFloat set_intensity = (EventInSFFloat) slNode.getEventIn("intensity");
set_intensity.setValue(((float)Intensity.getValue())/100);
Intensity_num=Intensity.getValue();
}
if (Radius_num!=Radius.getValue()) {
Node slNode = browser.getNode("Light1");
EventInSFFloat set_cutOffAngle = (EventInSFFloat) slNode.getEventIn("cutOffAngle");
set_cutOffAngle.setValue(((float)Radius.getValue()/100));
Radius_num=Radius.getValue();
}
if (DayNight_num!=DayNight.getValue()) {
Node bgNode = browser.getNode("BG");
EventInMFColor set_skyColor = (EventInMFColor) bgNode.getEventIn("skyColor");
float skyc[][]=new float[3][3];
DayNight_num=DayNight.getValue();
float tmp=((float)DayNight_num)/100;
skyc[0][0]=(float) 0.0;
skyc[0][1]=(float) (0.2-0.2*tmp);
skyc[0][2]=(float) (0.7-0.7*tmp);
skyc[1][0]=(float) 0.0;
skyc[1][1]=(float) (0.5-0.5*tmp);
skyc[1][2]=(float) (1.0-1.0*tmp);
skyc[2][0]=(float) (1.0-1.0*tmp);
skyc[2][1]=(float) (1.0-1.0*tmp);
skyc[2][2]=(float) (1.0-1.0*tmp);
set_skyColor.setValue(skyc);
}
}
return super.handleEvent(evt);
}
}
CounterThread.java
import java.applet.Applet;
import java.awt.*;
public class CounterThread extends Thread {
protected MenuBar parent;
CounterThread(MenuBar mb) {
parent=mb;
start();
}
public void run() {
while (true) {
if (parent.imageIdx>2)
parent.imageIdx=0;
else
parent.imageIdx++;
if (parent.active!=null) {
try {
parent.active.paint(parent.active.getGraphics());
} catch (NullPointerException e) {}
}
try {sleep(1000/parent.framerate);}
catch (InterruptedException e) {}
}
}
}
JavaChat.java
import java.net.*;
import java.awt.*;
import java.applet.*;
import java.io.*;
public class JavaChat extends Applet {
//public class JavaChat extends Frame {
// Start
protected static int defaultPort = 5000;
protected static int bufferLength = 1024;
public static byte buffer[] = new byte[bufferLength];
public static DatagramSocket ds;
public String chatwin;
String info, message;
int port;
String name;
InetAddress ia;
// End
TextField Textbox1;
String displayStr;
public TextArea MultiLineBox;
List ListBox1;
Panel StatusBar;
TextField Textbox2;
ChatRev tmp;
public void init() {
setBackground(Color.black);
setForeground(Color.white);
Label label = new Label("Type :");
label.setForeground(Color.white);
add(label);
Textbox1=new TextField(40);
Textbox1.setBackground(Color.darkGray);
add(Textbox1);
MultiLineBox=new TextArea("Chat Joined",6,60);
MultiLineBox.setBackground(Color.darkGray);
add(MultiLineBox);
ListBox1=new List(6, false);
ListBox1.addItem("Hello01!");
ListBox1.addItem("Hello02!");
ListBox1.addItem("Hello03!");
ListBox1.addItem("Hello04!");
ListBox1.addItem("Hello05!");
ListBox1.addItem("Hello06!");
ListBox1.addItem("Hello07!");
ListBox1.addItem("Hello08!");
ListBox1.setBackground(Color.darkGray);
add(ListBox1);
Textbox2=new TextField(40);
StatusBar=new Panel();
StatusBar.add(Textbox2);
add("South",StatusBar);
displayStr="";
resize(600,200);
// Start
chatwin=new String("JavaWin");
tmp = new ChatRev(this);
port = defaultPort;
name = new String("Tester");
try {
ia = InetAddress.getByName("129.94.246.106");
} catch (UnknownHostException e){
System.err.println(e);
}
try {
ds = new DatagramSocket(7000);
} catch (SocketException e){
System.err.println(e);
}
int pos = 0;
try {
message=name+" Join.";
message.getBytes(0, message.length(),buffer,0);
ds.send(new DatagramPacket(buffer,message.length(),ia,port));
} catch (IOException e) {
System.err.println(e);
}
// End
}
public void paint (Graphics g) {
g.drawString (displayStr,80,150);
}
public void addText(String txt) {
char ch[] = {((char) 10)};
String CR = new String(ch);
String a=new String(txt);
if (a==null) {
a=new String("Empty String");
}
MultiLineBox.appendText(a);
MultiLineBox.appendText(CR);
}
public boolean handleEvent(Event evt) {
String s;
switch (evt.id) {
case Event.KEY_PRESS:
switch (evt.key) {
case 10:
s=new String(Textbox1.getText());
if (s.length()>0) {
// Start
message = name + ": "+ s;
message.getBytes(0, message.length(),buffer,0);
DatagramPacket outgoing = new DatagramPacket(buffer,message.length(), ia, port);
try {
ds.send(outgoing);
} catch (IOException e) {
System.err.println(e);
}
// End
addText(message);
Textbox1.setText("");
}
break;
case 8:
s=new String(Textbox1.getText());
if (s.length()>0) {
s=s.substring(0,s.length()-1);
Textbox1.setText(s);
}
break;
default:
StringBuffer sb=new StringBuffer(Textbox1.getText());
sb.append((char) evt.key);
Textbox1.setText(sb.toString());
}
return true;
}
return false;
}
}
MenuBar.java
import java.awt.*;
import java.applet.*;
import vrml.external.*;
import vrml.external.field.*;
import vrml.external.exception.*;
import netscape.javascript.JSObject;
public class MenuBar extends Applet {
private CounterThread counter;
public int imageIdx;
public BuildingCanvas active;
public int framerate;
public TextField status;
public Browser browser;
public Node root;
public Node[] shape;
private Image img;
EventInMFNode addChildren;
EventInMFNode removeChildren;
private int intDef(String s, int def) {
int n = def;
if (s != null)
try {
n = Integer.parseInt(s);
} catch (NumberFormatException e) {};
return n;
}
public void init() {
// JSObject win = JSObject.getWindow(this);
// JSObject doc = (JSObject) win.getMember("document");
// JSObject embeds = (JSObject) doc.getMember("embeds");
// browser = (Browser) embeds.getSlot(0);
img = getImage(getDocumentBase(), "images/bookshelf.gif");
while(browser == null) {
try {
browser = Browser.getBrowser(this);
Thread.sleep(200);
} catch(InterruptedException e) {}
}
try {
root = browser.getNode("BuildingGroup");
addChildren = (EventInMFNode) root.getEventIn("addChildren");
removeChildren = (EventInMFNode) root.getEventIn("removeChildren");
shape = browser.createVrmlFromString("Shape {\n" +
" appearance Appearance {\n" +
" material Material {\n" +
" diffuseColor 0.2 0.2 0.8\n" +
" }\n" +
" }\n" +
" geometry Sphere {}\n" +
"}\n");
}
catch (InvalidNodeException e) {}
catch (InvalidEventInException e) {}
catch (InvalidVrmlException e) {}
framerate = intDef(getParameter("framerate"),5);
System.out.println(framerate);
counter = new CounterThread(this);
setLayout(new FlowLayout());
status = new TextField(58);
add(status);
add(new BuildingCanvas(this, "Applied_Science_F10"));
add(new BuildingCanvas(this, "Australian_Graduate_School_of_Management_G27"));
add(new BuildingCanvas(this, "Biological_Sciences_D26"));
add(new BuildingCanvas(this, "BlockHouse"));
add(new BuildingCanvas(this, "Chancellery_C22"));
add(new BuildingCanvas(this, "Civil_Engineering_H20"));
add(new BuildingCanvas(this, "John_Goodsell_Building_F20"));
add(new BuildingCanvas(this, "Library_E21"));
add(new BuildingCanvas(this, "Mathews_Building_Theatres_D23_F23"));
add(new BuildingCanvas(this, "Morven_Brown_Building_C20"));
add(new BuildingCanvas(this, "Parking_Station_H25"));
add(new BuildingCanvas(this, "Roundhouse_E6"));
add(new BuildingCanvas(this, "Samuels_Building_F25"));
add(new BuildingCanvas(this, "Sir_John_Clancy_Auditorium_C24"));
add(new BuildingCanvas(this, "Squarehouse_E4"));
add(new BuildingCanvas(this, "Central_Lecture_Theatre_Block_E19"));
add(new BuildingCanvas(this, "E12A"));
add(new BuildingCanvas(this, "Electrical_Engineering_G17"));
add(new BuildingCanvas(this, "Main_Building_K15_J14_K14_J12"));
add(new BuildingCanvas(this, "Dalton_Bldg_F12"));
add(new BuildingCanvas(this, "Mechanical_and_Industrial_Engineering_J17_K17"));
add(new BuildingCanvas(this, "Quadrangle_G15"));
add(new BuildingCanvas(this, "Robert_Heffron_Building_E12_E13"));
add(new BuildingCanvas(this, "Science_Theatre_F13"));
add(new BuildingCanvas(this, "Sir_Robert_Webster_Building_G14"));
add(new BuildingCanvas(this, "Willis_Annexe_J18"));
}
public void paint(Graphics g) {
g.drawImage(img, 0, 30,400,270, this);
}
}
ThunderThread.java
import java.applet.Applet;
import java.awt.*;
import vrml.external.*;
import vrml.external.field.*;
public class ThunderThread extends Thread {
protected ControlPanel parent;
ThunderThread(ControlPanel cp) {
parent=cp;
start();
}
public void run() {
Node swNode1 = parent.browser.getNode("BG");
Node swNode2 = parent.browser.getNode("BG_Thunder");
while (false) {
if (parent.ThunderOnOff_num==1) {
EventInSFBool set_bind1 = (EventInSFBool) swNode1.getEventIn("set_bind");
EventInSFBool set_bind2 = (EventInSFBool) swNode2.getEventIn("set_bind");
set_bind2.setValue(true);
try {sleep(100);} catch (InterruptedException e) {}
set_bind1.setValue(true);
try {sleep(3000);} catch (InterruptedException e) {}
}
}
}
}
ACDemox.java
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.util.*;
import java.awt.event.*;
public class ACDemox extends Frame{
Choice link;
String msg;
Image img;
Image Button_Blue;
Image Button_Red;
Image greenpin;
Image redpin;
Font f;
FontMetrics fm;
int fontSize;
int fh,bl;
int space;
String text;
String fontname;
URL url;
AppletContext con;
String current="";
int mouseX;
int mouseY;
ACDemox(int Size,String name, Image image,URL u, AppletContext context,Image blue,Image red,Image gpin,Image rpin) {
url = u;
fontSize = Size;
fontname = name;
msg = "Welcome to our Virtual Campus. I am a little wizard that helps you to walk around the world. I will also show you some information about the buildings and the corresponding faculty. Feel free to use!";
img = image;
Button_Blue = blue;
Button_Red = red;
greenpin = gpin;
redpin = rpin;
con = context;
link = new Choice();
setLayout(new BorderLayout());
}
public void init(){
}
public void start(){
}
public void update(Graphics g){
g.drawImage(img, 20,40, this);
g.setColor(Color.green);
}
public void updateText(Graphics g){
if (f==null) f = new Font(fontname,Font.PLAIN, fontSize);
g.setFont(f);
if (fm==null){
fm = g.getFontMetrics();
bl = fm.getDescent();
fh = bl + fm.getAscent();
space = fm.stringWidth(" ");
}
StringTokenizer st = new StringTokenizer(msg);
int x = 105;
int y = 60+fh;
int nextx;
String word,sp;
int wordCount = 0;
String line = "";
while (st.hasMoreTokens()){
word = st.nextToken();
int w = fm.stringWidth(word);
if( (nextx = (x+space+w)) > 295 ){
drawString(g,line,wordCount,fm.stringWidth(line),y+bl);
line = "";
wordCount = 0;
x = 105;
y = y + fh;
}
if(x == 105){sp = "";} else {sp = " ";}
line = line + sp + word;
if(x == 105){
x = x + w;
} else {
x = x + space + w;
}
wordCount++;
}
drawString(g, line, wordCount, fm.stringWidth(line), y+bl);
}
public void drawString(Graphics g, String line, int wordCount, int width, int y) {
if (width < 143){
g.drawString(line, 105, y);
}
else {
int toFill = (190 - width)/wordCount;
int remainder = 190 - width - (toFill*wordCount);
StringTokenizer st = new StringTokenizer(line);
int x = 105;
while (st.hasMoreTokens()) {
String word = st.nextToken();
g.drawString(word,x,y);
if(remainder > 0){
x = x + fm.stringWidth(word) + space + toFill + 1;
remainder--;
} else {
x = x + fm.stringWidth(word) + space + toFill;
}
}//end while
}// else
}
public void changeContent(String name) {
msg = search(name);
Graphics g = getGraphics();
g.clearRect(100,60,200,200);
g.setColor(Color.black);
g.fillRoundRect(100,60,200,200,15,15);
g.setColor(Color.green);
updateText(g);
}
public String search(String name) {
remove(link);
if (name.equals("Biological_Sciences_D26.wrl")){
current = "http://www.unsw.edu.au/UNSW/academic/faculty/medicine/medlist.htm";
return("This is the Biological Science Building. This is where the"+
" the Faculty of Medicine is located. The Biomedical Theatres "+
" is also in this building");}
if (name.equals("Samuels_Building_F25.wrl")){
current = "www.cse.unsw.edu.au";
return("This is Samuels Building. It is the home of several Departments "+
"in the School or Computer Science and Engineering. It also "+
"houses the Social Policy Research Centre, the Graduate School "+
"of Biomedical Engineering and the Department of Biotechnology.");}
if (name.equals("Library_E21.wrl")){
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("Library");
link.addItem("UDUS Dis<>conect Help desk");
link.addItem("Law");
return("This is our Library. A hugh variety or valuable resources can "+
"be found here effectively through computer enquires. The Open "+
"reserve, which provides a fast way to access course related "+
"material is located in the 2nd floor. The UniCopy and the "+
"UDIS Communication Department for Internet access is also located here.");}
if (name.equals("Applied_Science_F10.wrl")) {
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("Applied Science");
link.addItem("School of Chemical Engineering and Industrial Chemistry");
link.addItem("Department of Safety Science");
return("The Applied Science Building is home to the Faculty of "+
"Applied Science. In the Building you'll also find the School of Chemical "+
"Engineering and Industrial Chemistry, and the Department of Applied Geology.");}
if (name.equals("Australian_Graduate_School_of_Management_G27.wrl")){
current = "http://www.agsm.unsw.edu.au/";
return("The Australian Graduate School of Management (AGSM) "+
"provides premier management training and research in the "+
"fields of business management.");}
if (name.equals("BlockHouse.wrl")){
current = "http://www.library.unsw.edu.au/~gsd/rad.htm";
return("The Block House is located on lower campus of UNSW and is "+
"between the Round House and the Square House. The RAD department "+
"is situated here.");}
if (name.equals("Chancellery_C22.wrl")){
current = "http://www.unsw.edu.au/main/areas/vc-welcome.html";
return("The Seat of Power at UNSW. Herein resides the Vice-Chancellor "+
"and President, Professor John Niland, along with the "+
"Deputy Vice-Chancellors, and the senior administrative staff.");}
if (name.equals("Civil_Engineering_H20.wrl")){
current = "http://www.civeng.unsw.edu.au/";
return("The Civil Engineering Building is located on upper campus "+
"behind the library.");}
if (name.equals("Mathews_Building_Theatres_D23_F23.wrl")){
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("School of Mathematics");
link.addItem("School of Psychology");
link.addItem("Department of Aviation");
return("Located on Upper Campus of the University of NSW, the Mathews Building houses "+
"the School of Mathematics, The School of Psychology (including Pychsoc) and "+
"The Department of Aviation. The Mathews Building is part of what has come to "+
"be known as the Mathews Complex, incorporating several food outlets, The "+
"Mathews Lecture Theatres, and a newsagency.");}
if (name.equals("John_Goodsell_Building_F20.wrl")){
current = "http://www.commerce.unsw.edu.au/";
return("This is the John Goodsell Building. This building houses the "+
"the office of the Faculty of Commerce. Some tutorial rooms are "+
"also situated here.");}
if (name.equals("Central_Lecture_Theatre_Block_E19.wrl")){
current = name;
return("This is the Central Lecture Block(CLB). It is the main lecture "+
"theatre in the campus. There are 8 lecture halls within the "+
"building, each of which consists of suitable teaching equipment "+
"in order to provide perfect environemts for lectures");}
if (name.equals("Electrical_Engineering_G17.wrl")){
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("The School of Computer Science and Engineering");
link.addItem("Electrical Engineering");
link.addItem("The Photovolatic Special Research Centre");
return("This is the Electrical Engineering Building. The School of "+
"Electrical Engineering and the School of Computer Science "+
"and Engineering is located here.The Photovolatic Special Research Centre "+
"is also housed here. The Rex Vowels Theatre(LG1) "+
"is at the Lower Ground. And also, some computer labs is also "+
"located in the Lower Ground and 3rd Floor.");}
if (name.equals("Mechanical_and_Industrial_Engineering_J17_K17.wrl")){
current = "http://www.unsw.edu.au/UNSW/academic/handbook/engineer/mechan1.htm";
return("This is the Mechanical and Industrial Enginnering Building. "+
"This is where the School of Mechnical and Manufacturing "+
"Enginnering is housed. Different department, such as Aerospace "+
"Engineering, Manufacturing Management and Naval Architecture "+
"can be found here.");}
if (name.equals("Willis_Annexe_J18.wrl")){
current = "http://www.unsw.edu.au/UNSW/academic/handbook/engineer/mechan1.htm";
return("This is the Willis Annexe Builiding. It is basically associated "+
"with the Machanical Engineering and act as a workshop");}
if (name.equals("Quadrangle_G15.wrl")){
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("School of Information Systems");
link.addItem("The School of Accounting");
link.addItem("Tharunka");
link.addItem("The Student Guild");
link.addItem("Contact");
return("This is the Quadrangle Building.It houses the School of Information Systems, The "+
"School of Accounting, and many student facilitys including Tharunka (our "+
"student newspaper), The Student Guild, and Contact.");}
if (name.equals("Sir_Robert_Webster_Building_G14.wrl")){
current = "http://www.cse.unsw.EDU.AU/school/ccday/tour1/buildings/webster.html";
return("This is the Sir Robert Webster Building. The Webster Theatre "+
"is located here. A pc lab is also available for Science students.");}
if (name.equals("Main_Building_K15_J14_K14_J12.wrl")){
link = new Choice();
link.addItem("Select a link and press More info");
add("South", link);
this.show();
link.addItem("School of Physics");
link.addItem("School of Optometry");
link.addItem("Department of Astrophysics");
link.addItem("School of Mines");
return("It is also known as Old Main Building. It houses some very important "+
"departments including the School of Physics, the School of Optometry, "+
"The Department of Astrophysics, and the School of Mines.The Keith Burrows "+
"Theatre is also located here.");}
if (name.equals("Robert_Heffron_Building_E12_E13.wrl")){
current = "http://www.ceic.unsw.edu.au/";
return("The Robert Heffron Building is the home of the School of "+
"Chemical Engineering. Some lectures halls are also available "+
"inside.");}
if (name.equals("Roundhouse_E6.wrl")){
current = "http://www.unsw.edu.au/union/services/food.htm";
return("The Round House is located on lower campus of UNSW, between "+
"the Square House and the Block House. Located on the ground "+
"floor of the Round house is the Fernery coffee house. Yummy!");}
if (name.equals("Squarehouse_E4.wrl")){
current = "http://www.cse.unsw.edu.au/school/ccday/descs/bar.html";
return("The Squarehouse is situated in the lower campus between the Roundhouse "+
"and the Blockhouse. The Uni Bar is situated here.");}
if (name.equals("Science_Theatre_F13.wrl")){
current = name;
return("The Science Theatre provides an excellent environement both "+
"for lectures and conference purposes. Its large capacity is "+
"a good factor in holding special events and functions.");}
if (name.equals("Sir_John_Clancy_Auditorium_C24.wrl")){
current = name;
return("Sir John Clancy Auditorium is located in the the upper campus beside "+
" the Chancellery building. It is an excellent place in holding conference "+
" and concerts.");}
if (name.equals("Morven_Brown_Building_C20.wrl")){
current = "http://www.arts.unsw.edu.au/";
return("The Morven Brown Building houses the Faculty Office of the "+
"School of Arts and Social Sciences and is the base for Art studies.");}
else{
current =name;
return("No info for this building");
}
}
public boolean handleEvent(Event evtObj) {
if(evtObj.id == Event.WINDOW_DESTROY) {
hide();
return true;
}
return super.handleEvent(evtObj);
}
private void addButton(Panel p, String name) {
Button b = new Button(name);
p.add(b);
}
public boolean action(Event evtObj, Object arg){
if(evtObj.target instanceof Choice) {
repaint();
return true;
}
return false;
}
public boolean mouseUp(Event evtObj, int x, int y) {
if ( (x>0) && (x<100) && (y>150) && (y<170) )
{
String temp = link.getSelectedItem();
if (temp.equals("School of Information Systems"))
current = "http://www.fce.unsw.edu.au/OFFICIAL/INFS/IS/";
else if (temp.equals("School of Accounting"))
current = "http://www.ace.unsw.edu.au/";
else if (temp.equals("Tharunka"))
current = "http://129.94.76.189/";
else if (temp.equals("The Student Guild"))
current = "http://www.unsw.edu.au/clients/guild/";
else if (temp.equals("Contact"))
current = "http://www.unsw.edu.au/UNSW/studserv/contact.htm";
else if (temp.equals("The School of Computer Science and Engineering"))
current = "http://www.cse.unsw.edu.au";
else if (temp.equals("Electrical Engineering"))
current = "http://www.ee.unsw.edu.au/";
else if (temp.equals("The Photovolatic Special Research Centre"))
current = "http://www.pv.unsw.edu.au/";
else if (temp.equals("School of Physics"))
current = "http://www.phys.unsw.edu.au/";
else if (temp.equals("School of Optometry"))
current = "http://http://www.optom.unsw.edu.au/";
else if (temp.equals("Department of Astrophysics"))
current = "http://www.phys.unsw.edu.au/astro.html";
else if (temp.equals("School of Mines"))
current = "http://www.mines.unsw.edu.au/";
else if (temp.equals("School of Mathematics"))
current = "http://www.maths.unsw.edu.au/";
else if (temp.equals("School of Psychology"))
current = "http://www.psy.unsw.edu.au/school/";
else if (temp.equals("Department of Aviation"))
current = "http://www.maths.unsw.EDU.AU/avweb/";
else if (temp.equals("Library"))
current = "http://www.library.unsw.edu.au/";
else if (temp.equals("UDUS Dis<>conect Help desk"))
current = "http://www.disconnect.unsw.edu.au/";
else if (temp.equals("Law"))
current = "http://www.austlii.edu.au/unsw/";
try{
con.showDocument(new URL(current),"_blank");
}catch (MalformedURLException e){}
}
else if
( (x>0) && (x<100) && (y>170) && (y<190) )
{hide();}
return true;
}
public boolean mouseMove(Event evtObj, int x, int y) {
mouseX = x;
mouseY = y;
Graphics g = getGraphics();
if ( (mouseX>0) && (mouseX<100) && (mouseY>150) && (mouseY<170) )
{
g.drawImage(redpin, 5,150, this);
g.setColor(Color.red);
g.drawString("More Info",25,165);
} else if
( (mouseX>0) && (mouseX<100) && (mouseY>170) && (mouseY<190) )
{
g.drawImage(redpin, 5,170,this);
g.setColor(Color.red);
g.drawString("Exit",25,185);
}
if
( !((mouseX>0) && (mouseX<100) && (mouseY>150) && (mouseY<170)) )
{
g.drawImage(greenpin,5,150,this);
g.setColor(Color.black);
g.drawString("More Info",25,165);}
if
( !((mouseX>0) && (mouseX<100) && (mouseY>170) && (mouseY<190)) )
{
g.drawImage(greenpin, 5,170,this);
g.setColor(Color.black);
g.drawString("Exit",25,185);
}
return true;
}
public void paint(Graphics g) {
setBackground(Color.lightGray);
g.setColor(Color.black);
g.fillRoundRect(100,60,200,200,15,15);
g.drawImage(greenpin, 5,150, this);
g.drawImage(greenpin, 5,170, this);
g.setColor(Color.black);
g.drawString("More Info",25,165);
g.drawString("Exit", 25, 185);
g.setColor(Color.green);
updateText(g);
update(g);
}
}