Clock Tower

From CS486wiki
Jump to navigationJump to search

This page is designed to explain what is Clock Tower project.


Project Description

Clock Tower project is a subproject of VirtualBU project. The Project aims to create photo realistic of 3D environment of University Union building and a clock module in VirtualBU project which uses Open Wonderland Project. The module is animated and rings hourly like Library Tower's clock.

Website

The URL for the website for the project is http://vbu.cs.binghamton.edu:8080 The website is used to download the client program and manage the server for uploading modules and models.

Content

The website consists client tool that can be downloaded to enter the VirtualBU world and server administration page to manage the server.

Development

The website is a template that is created automatically when the Open Wonderland Server is run. As additional work I will submit a configured one. The reconfigured page will prevent server administration of unauthorized users.

Prerequisites

Project Development

There are two parts of the project;

Modelling Part

Applications Used

  • Google SketchUp
  • Maya 8.5 with ColladaMaya 3.05B

Open Wonderland project supports various 3D model files, like Google SketchUp (.skp) Alice (.ase) and COLLADA (.dae) files. For the most of the modelling Google SketchUp is used. To model University Union building which also holds the clock tower, I used Google SketchUp. In order to upload models to Open Wonderland server, they have to be in .kmz or .dae format. .skp files are exported to .kmz files with SketchUp application. To model clock itself I used Maya 8.5 | ColladaMaya 3.05B.The reason for that as it is animated model, only .dae files is supported in Open Wonderland. With Maya 8.5 and ColladaMaya 3.05B plugin I created an animated clock model. Basically I created clock model in Maya 8.5. The Maya model consists thee nodes which are the clockBase shape, hourShape and minuteShape nodes. By using Maya Animation tools I fixed the clockBase node's position and animated the remaining nodes. By using ColladaMaya 3.05B plugin, I exported the animated Maya model as .dae file format without loosing its animation compatibility. The models can be downloaded from following links;

Coding Part

In Open Wonderland for development Java is being used. For coding part I am required to write a module that uses the animated clock model to illustrate the clock on the Clock Tower at University Union building.

Environments Used

  • NetBeans IDE 6.9.1

What is Module in Open Wonderland

A Wonderland world consists of:

  • Cells, that represent visible objects
  • Components, attached to cells, that add specific features to cells
  • Cell renderers, that use the graphics engine API to make cells visible on-screen
  • Art and other resources

Once these have all been created, they need to be packaged in some way for easy upload to the server. This is done using a Wonderland MODULE. A module is basically a wrapper file that contains all the Wonderland building blocks according to a specific structure. This structure lets the server know where all the different building blocks are. A module is actually a Java jar file. Server and Client Programs If lots of people are visiting the same virtual world, we have to make sure that everything in the world is the same for everyone. For example, if you're playing a game inside Open Wonderland and your friend tells you to pick up a health pack, you both have to be able to see the same health pack, at the same time, in the same location. And if someone else comes along and takes the pack, everyone else in the game has to know that the pack is no longer available. So, Wonderland has to keep track of all the objects in the world. This is very difficult – but Open Wonderland has been designed to make it easy. Wonderland is an example of a client-server application. To see what this means, we'll look at some of the main requirements for a virtual word.

  • Every user in the virtual world must see the same things as everyone else.
        If Nicole and Jon are in a room together, and Nicole sees a book in the room, then Jon must see the same book in the same location.
            # If anything changes, everyone should be kept up to date. If Nicole picks up the book, Jon should see that it is now no longer on the shelf, but is being held by Nicole.
            # Users should be able to connect at any time and see the current state of the world. If Jon has to leave the world for some reason, and while he is gone Nicole puts the book on a table, when Jon visits the room again, he should see the book on

the table (assuming it hasn't moved since then).

            · Users do not need to know anything about the physical location of any other user in the real world. Nicole does not need to know that Jon is really in San Francisco or that another user is in Singapore, nor do they need to know that Nicole is in Massachusetts. They do not need to communicate directly with each other in the real world. Their computers also do not need to communicate with each other directly.

Wonderland is split into two parts, a server program, and a client program (we say that Wonderland has a client-server architecture):

          Server
             · The virtual world is stored on a computer at a particular IP address. The actual address is defined as a URL.
             · The server knows everything about the virtual world: it stores all the objects that will be displayed, controls how different parts of the Wonderland system communicate with each other, and knows which users are inside the virtual world.
          Client
             · The client is on another computer, at a different IP address.
             · The client must log into the server to join a virtual world.
             · After the client logs on, the server sends a copy of the virtual world to the client. (Actually, the client can cache data locally, but on entering a new virtual world, the data is sent to the client by the server.)
             · Note that there can be lots of different clients, each running on a different computer. There can also be more than one server, though this is rather complex.

Your computer is the client, asking the Wonderland server to send you all the data you need to display and interact with the virtual world.

       • The client is the program that you run on your computer – a Wonderland client.
       • The server is the program that runs on the other computer – a Wonderland server.

If another person (say, Jon) wants to join you in the virtual world, they must log on to the same server as you, and request their own copy of all the virtual world data. Now, you both have the same virtual world displayed on your computer. If you change something about the world, e.g. move a book, Jon needs to know what happened (or he'll get confused). So, when you pick up the book, four things are done:

       · your client sends the new position of the book object to the Wonderland server
       · the server updates its own copy of the book object
       · the server then sends the new position of the book to Jon's client program
       · Jon's client updates its own copy of the book object, and displays it in its new location

Now everyone is up-to-date. All this communication is handled by Wonderland. But we must still write code to plug our own cells into the Wonderland communication system. This is also packaged inside a module, along with everything else.