Flickr Friday

August 29, 2008

One of the things the Wonderland team is working on is a new default world. The MPK20 world has been with us since the start of the project and it’s overdue for a make over. Among the things I’d like to see is a world which is much more dynamic, interactive and customizable. This brave new world will be the stage for our cool new avatars in 0.5.

Unlike other virtual worlds, Wonderland is written entirely in Java, so we have access to a vast library of Java classes and applications with which to extend the world. The Music In Wonderland demo is a great example of how we were able to create a mashup of a web service ( with a compelling 3D audio/visual visualization. This is just the start. Many community members see the potential and are busily designing and building their own virtual world applications.

These applications are really exciting, and are certainly dynamic, but what about the world itself? What can we do to make the world itself more compelling?

One of the things that has always bothered me about the MPK20 world is that the art on the walls and the standalone posters is baked into 3D models. If you want to change a picture you need a 3D modeling tool. That’s unreasonable. Users ought to be able to control attributes of their world, such as wall art, without having to get under the covers and learn a sophisticated 3D modeling tool. What we need is a "poster" app which you could just click on to change the picture.


I was talking to a member of the Wonderland community recently and she asked me how difficult it would be to integrate a web service with Wonderland. This got me thinking. Maybe I could build a poster app by integrating with a web service?

I knew that Flickr has a web service API, so that seemed like a good place to start. The first step would be to build a Java wrapper for the Flickr web service. It turns out that there’s already one, called flickrj which provides a nice Java abstraction for the Flickr RESTful web service.

Next, I’d need a way to render an image onto a 3D object. Fortunately, Wonderland provides an application framework for 2D applications (check out AppWindowGraphics2DApp). This framework is used by Wonderland’s collaborative apps, including the PDF Viewer, Video Player and VNC Viewer. It provides a 2D canvas you can draw on, a frame (complete with a window border), and event handling that maps 3D events onto a 2D coordinate system. And just like Swing, the framework provides convenient paint(Graphics2D g) and repaint() methods. As a Wonderland 2D application developer, all of the tricky 3D stuff has been taken care of for you by the framework. All you have to do is write the application logic and figure out how to render your data in 2D.

Typical developer!

Ooops! Like many developers I started answering "how?", not "what?"

So, to answer the "what?" question, here some back-of-the-envelope requirements I had in mind for the poster app:

  • it should look like a framed picture (not like an application with a big red/green frame)
  • users should be able to search for new images and choose which one to display
  • it should be able to display an image anywhere in-world (it’s not statically baked into a 3D model)
  • users should be able to use the app for slide shows
  • everyone should see the same images as everyone else
  • if you load an image and log out, the image should still be there when you log back in again


Wonderland already has an application that fulfills many of these requirements: the PDF Viewer. On the surface, the only difference is that the poster app shows images, whereas the PDF Viewer shows pages of a PDF document.

Starting with the PDF Viewer and with the help of flickrj I had an application capable of displaying images from Flickr within a day (drop me a note if you’d like to learn more about how I did this).

As I explored the flickrj API, I discovered a rich set of interfaces for querying Flickr and retrieving images. I chose to support several ways of searching for images:

Search dialog

A Flickr search can return multiple pictures, so I needed a way to display the results. I decided to display the images in a grid:

Grid view

If you click on an image in the grid then that image is displayed full size:

Image view

and if you click it again, you toggle back to grid view.

Getting more dynamic

I now had an application that did everything on the requirements list, but I wanted something that would make the application more dynamic. While browsing the flickr API documentation I discovered the ability to search for recently changed pictures. If you go to and keep refreshing the page you’ll see the latest pictures that people have uploaded. I was astonished to learn that Flickr gets thousands of images uploaded every minute. Last time I looked it was about 5,000 images per minute. That’s over 80 images per second! I was hoping to display all the images as they were uploaded, so you could see Flickr’s "heart rate", but this proved impractical. Even if you had the bandwidth to download 80+ images a second, all you’d see would be a blur. So, I added a new feature, which was a timed search, which displays the most recently uploaded image every 5 seconds. This turned out to be a really compelling feature. It’s quite addictive to watch pictures being uploaded and not knowing what you’ll see next.

This application definitely satisfied my desire to bring "dynamic, interactive and customizable" content into Wonderland. I was quite surprised how compelling it was just to add new art to the world.

If you’re curious to see the app in action, check out the video.

The source code is checked into the wonderland-modules-incubator project:

If you want to use it, you need to obtain your own Flickr API key. Here’s a good place to start:

The Flickr API key goes in the WFS file. Where else? ;)

We’re really collecting a nice collection of apps in the incubator project, including Jordan’s auto-teleporting Portal app, the Batik SVG browser I built, and the hot off the press HTML Viewer that our WPI interns are building. Come join us in our wonderland-mo
dules-incubator sandbox and show off your 2D and 3D Wonderland applications!


Wonderland 0.4 Released!

August 18, 2008

After more than 8 months of work, the Wonderland team is happy to announce our 0.4 stable release. You can find the release here:

Download Wonderland 0.4

This release is focused on adding new applications and capabilities to the existing Wonderland platform, including:

  • New multi-user applications: PDF viewer, video player, VNC viewer
  • Enhanced audio connectivity with dial-out and dial-in
  • Web based administration, including a web-based world builder
  • Major stability improvements, especially in larger worlds and with shared applications

As the 0.4 release manager, I’d like to personally thank the team for their hard work and endless testing to track down those last few complicated bugs. I’d also like to thank the community for their invaluable feedback through the process.  Of course, the best reward is seeing all the cool things people are doing with Wonderland!

A web browser for Wonderland

August 15, 2008

In Sun Labs, we know the summer is really ending when our intrepid interns start heading back to school.  This year is unfortunately no exception, and our current intern Antonio, is heading back to New Mexico.  While we have more interns starting soon, we are certainly going to miss Antonio.  Before he leaves, we’ve asked him to post an update on his work this summer.  This guest post was contributed by outgoing intern Antonio Arredondo, a PhD student in computer science at New Mexico State University.

Today completes my internship at Sun Microsystems on Project Wonderland. I was tasked with creating a low-end client for Project Wonderland, and that is what I have accomplished (a working version).

I took the Web 2.0 approach of creating a AJAX application that would interact with the Wonderland server, via a web server (Glassfish/Tomcat). I started by looking for a AJAX framework that worked with Java, and found DWR. This project allowed me to use Comet (long lived connections) to send information between my web client and the Wonderland server.

Web UI

Once the communication framework was chosen, I created a simple web page that would handle the map view. The map view uses the idea of having a over-head view of the world, and placing an icon to represent each person logged in. As the person moves, the icon gets updated to the new position.

Once this was finished, I decided that making a mobile version would be an easy extension. The mobile version consists of making the map view fill the entire web page, while keeping the menu at the very top. I was able to accomplish this by writing specific CSS and Javascript for the mobile browser, while maintaining as much common code for both desktop and mobile browser.

Wonderland has now become more accessible to those users that do not currently have the necessary 3D hardware to run the GUI client. The web client, both desktop and  mobile version,  represents another step in Project Wonderland’s goal of providing a scalable multi-user environment.  If you would like to try it out, you can check it out for yourself.  Just check out the lg3d-wonderland and wonderland-modules source using the "webui" branch.

I want to thank Sun Microsystems for the opportunity along with Nicole, Paul, and the rest of the Project Wonderland Team.

A Virtual Academy In Wonderland

August 12, 2008

It seems like it is nearly every day that we learn about a group using Wonderland in a novel way — and today’s guest blog entry by Chris Harris from VEGA is no exception. In one aspect their work, they control the appearance of a 3D model airplane inside Wonderland by an application that runs externally. Well, I’ll let Chris say more about it…

Guest blog contributed by "A Virtual Academy" principal training designer Chris Harris from VEGA

A Virtual Academy in Wonderland

As a provider of bespoke training solutions, VEGA has a reputation for delivering solutions that save money, improve capability, and transform training. One of the services that we provide at VEGA is the creation of training material, from straightforward PowerPoint slides right through to high fidelity simulations. Our clients are regularly talking about, and experimenting with techniques to deliver this training remotely. While our existing technology already allows remote delivery, there is a lack of classroom atmosphere and instructor-student and student-student relationships can suffer. One way to overcome these problems involves a virtual academy: a meeting place in a virtual world where the training can take place in a collaborative way. (Read about our vision here).

Free-Play Simulations

When you’re learning how to fly a satellite or maintain a fighter aircraft, it can be difficult to get your hands on the real thing. The people who operate them tend to be wary about letting some newbie play around with millions of dollars of high-tech hardware. That’s understandable, but it makes training the next generation of scientists or technicians difficult.

Here at VEGA, our solution is to produce a simulation of the equipment instead. This is a computer program that runs on a standard desktop PC. It behaves in the same way as the "real thing" so the learner gains the experience they need in operating controls, following procedures, or diagnosing faults. This approach has many advantages. For a start, a simulation is much less expensive to provide to your students. If you need to do so, you can give each student their own system. You don’t need to try fitting the real equipment in the classroom, and it’s far easier to move a computer down the hall than it is moving a satellite or a gas turbine engine. If the learner does something that breaks the simulated version of the machine, you just start over.

Virtual World and Training Simulation Parallels

When I first started finding out about virtual worlds like Project Wonderland, I saw a lot of parallels with the simulation approach. Each user moves around in a world which behaves in much the same way as the "real thing." People gain experience from their activities in virtual worlds like they do in real life. What happens in a virtual world can be as far-removed or as faithful to reality as it needs to be. Each class can have their own "room" – which can be any environment you can think of. And like simulation, creating and travelling to a virtual world keeps your costs down: you can get your students working together in a virtual classroom, even if they are on different sides of the Atlantic.

If the two approaches had all these things in common, what would it be like if we combined them? VEGA is always looking for ways in which new technology can help our clients. After chatting to my colleagues Darren Harvey and Bernd Hoehner, we started working on a way to link our simulations to objects within a virtual world. We picked Wonderland for a number of reasons – I’d seen Rupert Key talk about the project at Virtual Worlds Europe in London in 2007; it’s open source, which means we could look at the code; and it’s written in Java, which meant our programmers could get to grips with things quickly.

Project Wonderland

Almost immediately, we were using Wonderland as a venue for virtual meetings between our offices in Bristol and Welwyn Garden City in the UK. Other people in the company noticed, and interest grew quickly.

While the avatar system on Wonderland 0.4 is customisable and easy to use, the results seemed to be too cartoon-like for many of our potential users. We found that a lot of people we showed it to asked if it would be possible to make their avatars look like them. We came up with a simple solution which added a larger head over the top of the Wonderland avatar. We then mapped a specially prepared bitmap on to this object to give us a fairly convincing representation of the real person. I was surprised how important head shape is when you’re trying to make an avatar look convincing. People’s heads come in many different shapes and sizes, and "one size fits all" really isn’t good enough when you’re aiming for a realistic presence in-world. Having said that, the results we came up with in a very short space of time are perfectly recognisable versions of my colleagues. Still, we’re looking forwards to getting our hands on the new avatar system in version 0.5!

If you’re involved in training, you’ve probably come across Learning Management Systems (LMSs). When we set out to build our virtual academy, we initially thought of it as an LMS you can walk around inside. We customised the environment and provided a set of formal classrooms which could be used for training sessions, with an entrance lobby that would help direct students to where they needed to go.


VEGA Virtual Academy Map


But as we worked with Wonderland, we expanded our approach. We added equipment models to the main hall, and enlarged the collaborative working areas so users could get together to share information and plan activities.

Most importantly, we wanted to see if our simulation technology would fit inside the Wonderland environment. Would it work? Would it be useful?

Virtual Academy Demonstrator in Project Wonderland

In a short time frame, Bernd had imported one of our aircraft models into a classroom in Wonderland and linked it with a basic aircraft simulation running as a separate application on a simulation server at our company headquarters.

A window in Wonderland displays the user interface: an aircraft cockpit and controls. The simulation models the behaviour of a combination of systems including the hydraulics, fuel, avionics, engines and so on. Meanwhile, the aircraft model in Wonderland is passed the current state of various simulation parameters and responds accordingly.


VEGA Virtual Academy


To put this more simply: if you move the landing gear lever in the simulation, the wheels on the Wonderland model will go up or down. Push the stick, and the ailerons move. Kick the pedals, and the rudder responds. It was a great moment seeing this happen in the virtual world we had created, and everyone we showed it to got excited about it too. The next thing I knew, we were demonstrating it at the annual ITEC show in Stockholm, Sweden – and the reaction there was extremely good.

We continue to use Wonderland for meetings, and I’m regularly asked to demonstrate our virtual academy to visitors. Given my experiences so far, I’m convinced there’s a strong future for the technology, and I’m looking forwards to seeing what future releases of the project bring us!

Chris Harris
Principal Training Designer

Project Wonderland v0.4 – Release Candidate 1

August 4, 2008

The Project Wonderland team is pleased to announce Release Candidate 1 of Version 0.4. This release represents a near-final version before the official v0.4 release is made. Community members are invited to download and test this version and report back any problems they find!

The Release Candidate 1 of Version 0.4 adds a number of new features over Version 0.3, including enhanced audio and telephony support, a PDF viewer, VNC viewer, video player, cone of silence, microphone platform, whiteboard, and in-world audio and video recorders. Release Candidate 1 of Version 0.4 also adds support for several new gestures (nodding, waving, and pointing) and also a single web page for launching the Wonderland client and world builder.



How to set up a shared Wonderland server

August 1, 2008

This week we’ve been doing final testing before our Wonderland 0.4 release (the last few bugs are always the hardest).  To test the binary releases, I’ve been setting up the Wonderland server every day for our group.  I feel like I have a decent recipe going, which I thought I’d share with anyone else out there who wants to set up a Wonderland server.

What you need

The goal is to install the Wonderland server and web administration on my local Solaris server. (Note: the instructions for Linux should be identical, except using the Linux binaries instead of the Solaris ones). Once I do that, everyone on the team will be able to launch the client via Java Web Start.  No installation required!

If you’d like to try it yourself, you’ll need a Linux or Solaris server, a remote login to the server, and about 1GB of free disk space.

Download the software

I start out by logging in to my server (dstar3) and creating a directory to put the Wonderland code in.  Since this particular setup is for a demo, I’ll call the directory "demo":

[laptop ~]$ ssh
[dstar3 ~]$ su
[dstar3 ~]# mkdir -p /export/home/wonderland/demo
[dstar3 ~]# chown -R jkaplan /export/home/wonderland
[dstar3 ~]# exit
[dstar3 ~]$ cd /export/home/wonderland/demo

 In this case, I’m creating a directory in /export/home, and changing it to be owned by my user.  A better option would be to create a new user for Wonderland, and do the installation as that user.  In either case, you can install in any directory you have write permissions to.  You’ll just need to update the paths for the WFS root in the instructions below.

(Linux note: most Linux distros don’t let you directly do "su".  Instead, replace the command done as root with a call to "sudo", for example: "sudo mkdir -p …").

Next, I download the three pieces of software I will need.  First, I get the latest nightly build of the Wonderland server for Solaris:

[dstar3 demo]$ wget
13:08:16 (419.82 KB/s) - `' saved [145567905/145567905]

Note that these directions assume a very recent build, preferably 20080730 or later.

Next I download the Wonderland.war file for web administration:

[dstar3 demo]$ wget
13:16:40 (411.92 KB/s) - `Wonderland.war' saved [202958941/202958941]

I chose the bigger one (with local artwork) so I can be sure everyone will get the same art:

Download Wonderland

Finally, I downloaded the Glassfish application server, which I will use to host the web administration:

[dstar3 demo]$ wget

Now I have all the pieces I need:

[dstar3 demo]$ ls -l
-rw-r--r--   1 wonderland other    202974858 Jul 30 13:52 Wonderland.war
-rw-r--r--   1 wonderland other    64375686 Apr 11 23:10 glassfish-installer-v2ur2-b04-sunos_x86.jar
-rw-r--r--   1 wonderland other    145567905 Jul 30 04:54

Install the Wonderland server

Next step is to set up the Wonderland server. First I unzip it:

[dstar3 demo]$ unzip
creating: lg3d-wonderland/

The next step is to edit the files with the right values for my server:

[dstar3 demo]$ cd lg3d-wonderland
[dstar3 lg3d-wonderland]$ vi
# Set the hostname to be used for outbound socket connections.
# Java finds it hard to figure this out automatically. This is used by the voice bridge
# and the X app sharing s/w for making outbound socket connections.

The values I change are:

  • local.hostaddress – the address of the Wonderland server, which is the same as the address of the web server in this case.
  • wfs.root – the location of wfs files to load in this world. The demo world is a cleaned up version of the MPK20 space, with content like PDFs loaded off the internet. It also has two additional spaces: a lecture hall with PDF and video and a playground for the world builder. You can change the settings for this world by editing the wfs file in the demo-wfs directory.
  • art.url.base  – where the clients will download artwork from.  In this setup, clients download the artwork from the deployed Wonderland.war file.  This enables advanced features like art upload.

The server is now configured! To make life easier, I wrote a little script to launch all the separate pieces of the server. I put this in the lg3d-wonderland/bin directory:

[dstar3 lg3d-wonderland]$ vi bin/
echo "Starting Voice Bridge"
./bin/ > wonderland-bridge.log 2>&1 &
sleep 15
echo "Starting Wonderland Server"
./bin/ > wonderland-server.log 2>&1 &
sleep 15
echo "Starting Server Master Client"
./bin/ > wonderland-smc.log 2>&1 &
echo "Wonderland started"

To run the server, I just need to make the script executable, and then run it. It will automatically put all the Wonderland server processes in the background:

[dstar3 lg3d-wonderland]$ chmod +x ./bin/
[dstar3 lg3d-wonderland]$ ./bin/
Starting Voice Bridge
Starting Wonderland Server
Starting Server Master Client
Wonderland started

Once the server is running, you can check the log files in the lg3d-wonderland directory if anything doesn’t work right:

[dstar3 lg3d-wonderland]$ ls *.log
wonderland-bridge.log  wonderland-smc.log

Configure Wonderland.war

Now that the server is all set, it’s time to turn to the client. I want to launch the client via Java Web Start, so users can just click on a link to run the latest version of Wonderland. To do this, I need to deploy Wonderland.war to a web container. Before I do that, though, I want to make a few quick changes to the .war file to configure it the way I want.

To make changes to the .war, I am going to uncompress the config files I want to change, modify them, and then update the war with the new file. The three things I want to change are to change the location of the WFS files to match the value I setup in the server above, to add new default placemarks for the lecture hall and world builder area, and also to enable developer features so users can reload the world after we make changes with the world builder.

First, I unpack the files we want to change from the war file I downloaded into a temporary directory:

[dstar3 lg3d-wonderland]$ cd ..
[dstar3 demo]$ mkdir war
[dstar3 demo]$ cd war
[dstar3 war]$ jar xvf ../Wonderland.war WEB-INF/web.xml app/config-webstart/PlacemarkConfig.xml app/Wonderland.jnlp
inflated: WEB-INF/web.xml
inflated: app/Wonderland.jnlp
inflated: app/config-webstart/PlacemarkConfig.xml

Then I edit the web.xml file to put in a WFS path that matches the one I put in to the  file: 

[dstar3 war]$ vi WEB-INF/web.xml

Now I copy over the placemarks file with the placemarks for the default world.  If you want to change placemarks the user will see, this is the time to do it.  Just edit that PlacemarkConfig.xml file after you copy it:

[dstar3 war]$ cp ../lg3d-wonderland/worlds/demo-wfs/PlacemarkConfig.xml app/config-webstart/

Next I edit the Wonderland.jnlp file to enable developer features:

[dstar3 war]$ vi app/Wonderland.jnlp
<property name="sun.java2d.noddraw" value="true"/>
<property name="wonderland.experimentalfeatures" value="false"/>
<property name="wonderland.developerfeatures" value="true"/>

Then I can update the war file with the updated configuration files:

[dstar3 war]$ jar uvf ../Wonderland.war .
adding: app/(in = 0) (out= 0)(stored 0%)
adding: app/config-webstart/(in = 0) (out= 0)(stored 0%)
adding: app/Wonderland.jnlp(in = 4223) (out= 1157)(deflated 72%)
adding: app/config-webstart/PlacemarkConfig.xml(in = 3118) (out= 501)(deflated 83%)

And finally clean up my temporary directory:

[jkaplan@dstar3 war]$ cd ..
[jkaplan@dstar3 demo]$ rm -rf war

There are lots more things you can configure in Wonderland.war, like the directories it uses to store artwork and WFS. To see a full list, see the web administration docs.

Install Wonderland Web Admin in Glassfish

Finally, I need to deploy the newly configured Wonderland.war file to a web container. I’m going to use the Glassfish container I downloaded earlier, although you should be able to use Tomcat or Jetty if you prefer.

Installing Glassfish can be done in two easy steps. Step one is to unpack the distribution file:

[dstar3 demo]$ java -mx768M -jar glassfish-installer-v2ur2-b04-sunos_x86.jar
Accept or Decline? [A,D,a,d] A
installation complete

Step two is to run the setup script to configure Glassfish. The Glassfish site has great docs about all the settings you can change (like directories and port numbers) in the setup.xml file. Make these changes before running the next step. I just use the default, which will put the web server on port 8080:

[dstar3 demo]$ cd glassfish
[dstar3 glassfish]$ chmod -R +x lib/ant/bin
[dstar3 glassfish]$ ./lib/ant/bin/ant -f setup.xml Buildfile: setup.xml
Total time: 31 seconds

Now I start up Glassfish:

[dstar3 glassfish]$ ./bin/asadmin start-domain
Starting Domain domain1, please wait.

And finally, I deploy the updated Wonderland.war file:

[dstar3 glassfish]$ ./bin/asadmin deploy ../Wonderland.war
Command deploy executed successfully.

Now the Wonderland client code is installed in the Glassfish server. If there are any problems, you can check the Glassfish server log:

[dstar3 glassfish]$ ls domains/domain1/logs/
jvm.log     server.log

Running the Wonderland Client

OK, everything should be up and running at this point.  From my browser, I can go to

And I should get the Wonderland launch page:

Wonderland front page

Now that it’s up, what can I do with this demo?  Check out our latest video to see some of the cool new features in Wonderland 0.4!

(Updated 8/2 to remove bad characters )

%d bloggers like this: