Doors on Buildings (Ekin): Difference between revisions
No edit summary (change visibility) |
No edit summary (change visibility) |
||
| Line 57: | Line 57: | ||
====How to run VBUDoors Module==== |
====How to run VBUDoors Module==== |
||
After uploading the '''VBUDoors.jar''' and '''VBUDoors_right.jar''' files on the server, you need to restart running wonderland server. Then after opening a client window, you need to insert the desired module. You can do it by clicking ''Insert'' menu on top side of client window and then click ''component'', this will pop-up a new window that shows modules you can run on the server. |
After uploading the '''VBUDoors.jar''' and '''VBUDoors_right.jar''' files on the server, you need to restart running wonderland server. Then after opening a client window, you need to insert the desired module. You can do it by clicking ''Insert'' menu on top side of client window and then click ''component'', this will pop-up a new window that shows modules you can run on the server. |
||
==The idea of 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. |
|||
==References== |
==References== |
||
Revision as of 14:45, 12 May 2011
This page is designed to explain Library Model and its subproject VBUDoors in VirtualBU Project.
Project Description
VBUDoors project is a subproject of VirtualBU project. VirtualBU project aims to create photo realistic of 3D environment of Binghamton University campus.This project is one of the crucial sections of VirtualBU project, which illustrates the campus doors which is animated and has different door models. Basically this project is a module that is used in Open Wonderland projects.
Websites
The URL for the websites for the VirtualBU project is
http://vbu.cs.binghamton.edu:8080
http://vbu1.cs.binghamton.edu:8080
http://vbu2.cs.binghamton.edu:8080
The URL for the website for modeling part of my project is
http://www.cs.binghamton.edu/~steflik/wiki/index.php/Library_-_Ekin_Burak_Ozturk
Project Development
Applications Used
Google SketchUp was used to create 3D model of the Library Tower & The Glenn G. Bartle Library.
The reason I used these applications is that in order to develop modules in Open Wonderland Project easily is to use NetBeans environment, since Open Wonderland is developed in Java and uses Apache Ant to compile and build itself, I used NetBeans IDE for development. Another reason that I used it is Apache Ant is embedded into NetBeans 7.0 .
Prerequisites
- Running Open Wonderland Server
- Scripting-component module that uploaded to server Can be downloaded from Open Wonderland Module Warehouse
Development Process
Modeling
Can be found at My Modeling Section
Coding
Module is developed in Java. For my part I created two different modules that have exactly the same idea. When we think of door openings in real life, we can see that there are two types of the which opens to left side or right side. For my project I used this idea and created two different modules that one of them controls doors that opens to left side and another for right side.
Basically my modules are composition of 3 parts which are Java code, 3D models-there are 5 different door models- and Java script part. For my module I embedded both 3D models and scripts into my module.
In Java code side, I created an empty Open Wonderland module template and edited it as my subproject is described. In this part I created handlers that handles the messages between server side and client side. When you run VBUDoors or VBUDoors_right module in client window you will see a door model is comes by default, but if you right click with your mouse you will see a list of different models which are
1. Door 1
2. Door 2
3. Custom 1
4. Custom 2
5. Custom 3
When you click one of them you will see the door model changes. The handlers that I told above handles these changes by notifying server side. I embedded Java Scripts into module that when you left click on model, you will see that the model will open 90 degrees on left side or right side on the very left or very right axis. Calibrating the axis was another difficult part in my project but after making a very deep investigation on open wonderland forums, I found a way to change model axis in models. That is when a model is uploaded to server, server creates a file with .dep extension and this file keeps everything about the model, all scale factors, transformation factors, vertex factors, edges and color information. I manually changed the axis values in this file and fixed the axis information.
The rest of the project depends on scripts. When you click on a model in the world, this click triggers the scripts to execute. Basically scripts rotates the models on the fixed axis 90 degrees and when one door is opened fully it waits 10-15 seconds and then closes automatically.
So when the module is uploaded to server and run on the client window, it loads the model and waits for right or left clicks. Right clicks enables the user to change door model and sends message to server to tell changing the model. Left clicks triggers script to execute.
How to run VBUDoors Module
After uploading the VBUDoors.jar and VBUDoors_right.jar files on the server, you need to restart running wonderland server. Then after opening a client window, you need to insert the desired module. You can do it by clicking Insert menu on top side of client window and then click component, this will pop-up a new window that shows modules you can run on the server.
References
2. Open Wonderland Documentation
By Ekin Burak Ozturk