Building 3D Worlds with Project Wonderland

laboredbumbaileySoftware and s/w Development

Jun 7, 2012 (5 years and 4 months ago)

488 views

Building 3D Worlds with
Project Wonderland
Kevin Li
Tec h Lead, Gr eat Chi na
Sun Campus Ambas s ador Pr ogr am
Yuan- Xi n.Li @s un.c om
Building Wonderland
What's Project Wonderland?
Agenda
What To Do/Where To Go
Creating and Importing Models
The World Builder
Sun Proprietary/Confidential: Internal Use Only
What's Project Wonderland
Motivation

Sun's workforce has reached
a tipping point
>
On any given day, over 50%
of employees are remote
>
Everyone works remote,
even in the office
>
Social Interaction
>
Remote Management
>
Brainstorming


Challenges
>
Tools for distributed work
>
Culture of innovation
Why a Virtual World?

Current technology lacks
sufficient emotional bandwidth
>
Social networking, email, IM,
text messaging, webcasts, etc.
>
Need to Capture “Backchannel”
>
Need channels with higher
Allow employees to confide in
managers, people to establish
trusting relationships, and extroverts to thrive
>
Supports informal learning

Virtual world technology promises a solution
What's Project Wonderland?
Project Wonderland is a toolkit for creating
collaborative 3-D virtual worlds. Within those
worlds, users can communicate with high-
fidelity, immersive audio, and can share live
applications such as web browsers, open
office documents, applications and games
http://lg3d-wonderland.dev.java.net
Software Architecture
How the World Works?

The world is divided into discreet volumes called “cells”
>
Cells are nested into a tree structure
>
Very similar to a scene graph (but not quite)
V
>
Cell tree divides scene graph into network sized chunks
Project Darkstar Game Server
Project Darkstar is
already:

Easy to program

Multi-threaded

Fault tolerant

Open and flexible

Freely available

Community-
driven
Project Darkstar further aims to be
fully distributed, enabling
massive scalability across multiple game server nodes
Open Source

GPL v2.0 Release

Downloads

Source & Binaries

Multi-Platform Client & Server

Technical Forum

Darkstar Developer Support

Documentation

http://wonderland.dev.java.net
Open Art Path

Authoring, use existing tools:
>
Commerical:
>
Maya, Photoshop
>
Free:
>
Blender, Gimp

Use x3d as interchange format
>
ISO standard, defined by
Web3D consortium
>
XML file format
>
Follow-on to VRML
>
J3dFly translator

Open Content & Curriculum
Repositories
>
Fedora, Drupal, D-Space, etc
Achieving the Goals

Supporting Social Interaction
>
Immersive stereo audio
>
3D space ideal for multiple,
simultaneous conversations
>
Spaces designed for informal
interaction (Demo Floor,
Team Room)
>

Mixed-reality conferencing

Sharing
>

Live applications

Extensibility
Wonderland Extensibility

Extend the world with artwork and Java code
>
Client based on standard Java3D API
>
Build custom 2D or 3D collaborative applications
>
Extend server to connect to enterprise software
Major Features

High-fidelity, immersive stereo audio

Application sharing in 3D world

Security

Enterprise Integration

Highly extensible

Intellectual Property Rights
Technical Requirements


Modern game hardware” Client
>
3D accelerated graphics
>
128MB video memory
>
ATI or nVIDIA
>
~1GB RAM

Server : Dual-core AMD Opteron, 2-RU, Twin Disks
>
Solaris, Ubuntu Linux, Windows, Mac OSX
>
Single & Multi-node

Java 6

Scales down to laptop for developers
Vision

Real work
accomplished in
the virtual world

3-D Web –
Federation
of virtual worlds
Sun Proprietary/Confidential: Internal Use Only
Building Wonderland
Running Project Wonderland

Binary Version
>
https://lg3d-wonderland.dev.java.net/binary-builds.html
>
Running via executed files: Server, Voice Bridge and
client
>
Arts are loaded from default art server. (There may be
firewall problems for loading)
Running Project Wonderland

Building from Source Code
>
Requirements
>
JavaSE 5 or 6
>
Apache Ant (Add to $PATH)
>
CVS or Subversion (Using Netbeans is a good choice)
>
Regist on
https://www.dev.java.net/servlets/Join
>
Check out workspace lg3d-wonderland
>
With CVS commands:
>
cvs -d :pserver:<username>@cvs.dev.java.net:/cvs
login
>
cvs -d :pserver:<username>@cvs.dev.java.net:/cvs
checkout lg3d-wonderland
Running Project Wonderland
>
Check out lg3d-wonderland with Netbeans
Running Project Wonderland

Check out lg3d-wonderland-art workspace
>
cvs -d :pserver:<username>@cvs.dev.java.net:/cvs
checkout lg3d-wonderland-art
>
With Netbeans:
Running Project Wonderland

Check out wonderland-modules workspace
>
svn checkout https://wonderland-
modules.dev.java.net/svn/wonderland-modules/trunk
wonderland-modules --username <username>
>
With Netbeans 6.5:
>
Repository URL:
https://wonderland-
modules.dev.java.net/svn/wonderland-modules
>
>
Rename trunk → wonderland-modules
Running Project Wonderland

Building Source Code
>
lg3d-wonderland, lg3d-wonderland-arts, wonderland-
modules must be in the same directory, e.g. /Wonderland
>
Modifying build.properties (or my.build.properties):
>
wonderland.useLocalArt=true
>
Building in three terminals (command line windows)
>
cd /Wonderland/lg3d-wonderland
>
ant run-sgs
>
ant run-bridge
>
ant run
Sun Proprietary/Confidential: Internal Use Only
Creating and Importing Models
Creating 3D models (Demo)

Creating models with Blender or Maya
>
http://www.blender.org

Exporting x3d 3D model files

Using build-in importing tools in Wonderland

Saving as compiled models, e.g. wood.j3s.gz

Building worlds with WFS (next step)
Creating 3D models

WFS – Wonderland File System

WFS structure:

Creating a new WFS, e.g. in /my-wfs

Creating a file named building-wlc.xml
>
Let's have a look
Creating 3D models

building-wlc.xml
>
Java Bean Long Term Persistence
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.6.0-dp" class="java.beans.XMLDecoder">
... body ...
</java>
>
Including a basic cell:
<object class="org.jdesktop.lg3d.wonderland.darkstar.server.setup.
BasicCellGLOSetup">
Creating 3D models
>
Defining the server side cell type
<void property="cellGLOClassName">
<string>org.jdesktop.lg3d.wonderland.darkstar.server.cell.
SimpleTerrainCellGLO
</string>
</void>
>
Defining the position of the Cell
<void property="origin">
<void index="0">
<double>50.0</double>
</void>
<void index="2">
<double>50.0</double>
</void>
</void>
Creating 3D models
>
Defining the bounds of the Cell
<void property="boundsRadius">
<double>100.0</double>
</void>
<void property="boundsType">
<string>BOX</string>
</void>
>
Defining the model file of the Cell
<void property="cellSetup">
<object class="org.jdesktop.lg3d.wonderland.darkstar.common.setup.
ModelCellSetup">
<void property="modelFile">
<string>models/box.j3s.gz</string>
</void>
</object>
</void>

box.j3s.gz must be in lg3d-wonderland-art/compiled_models/models
Creating 3D models

Put /my-wfs into lg3d-wonderland/src/worlds

Modifying the default wfs in build.properties or
my.build.properties:
>
wonderland.wfs.root=
file:$
{src.dir}/worlds/my-wfs

Run Server and Client
>
ant run-sgs
>
ant run
Sun Proprietary/Confidential: Internal Use Only
The World Builder
Using Web Administration Tool
Using Web Administration Tool
Using Web Administration Tool

Requirements
>
Make sure you have JAVA_HOME defined
>
Make sure you have JAVA_HOME/bin and ANT_HOME/bin
in PATH
>
Make sure ANT_OPTS=-Xmx1g
>
A JSP/Servlet container (GlassFish v2, Tomcat, Jetty)
>
Set wonderland.useLocalArt=true in build.properties

Create a keystore for Java Web Start
>
cd lg3d-wonderland/build-tools/webstart
>
keytool -genkey -keystore wonderlandKeystore.jks -alias
wonderlandSig

Enter lg3d-wonderland and execute :ant pkg-war-
combined
Using Web Administration Tool

Adding java3d core into Wonderland.war
>
Download java3d-local.jar from
https://lg3d-
wonderland.dev.java.net/servlets/ProjectDocumentList?
folderID=10294
>
Unpack all files in java3d-local/app into Wonderland.war/
app
>
Modify Wonderland.war/app/Wonderland.jnlp:
<extension href="java3d-1.5.3-build2.jnlp"/>
Using Web Administration Tool

Now change the art properties in build.properties:
>
wonderland.art.url.base=
http://localhost:8080/Wonderland/localart/art
>
wonderland.useLocalArt=
false

Deploy Wonderland.war on GlassFish:
>
asadmin start-domain domain1
>
asadmin deploy Wonderland.war

Run Wonderland Server and Voice Bridge as usual

Visit in the Web Browser:
http://localhost:8080/Wonderland
Adding Customized Components
into World Builder

Unpack catalog.json from Wonderland.war/worldbuilder

Add component description in catalog.json:
>
name: "Box (Custom)",
>
library: ["Custom"],
>
tileImageURL: "box-tile.png",
>
iconImageURL: "box-icon.png",
>
modelURL: "models/worldbuilder/office-
conservative/box.j3s.gz",

Put all texture files and box.j3s.gz into proper directory
both in lg3d-wonderland-art and Wonderland.war
Saving Your World

Click “Save World” button in the World Builder

Find your world WFS in
USER/.wonderland/wonderland-wfs

Put wonderland-wfs into lg3d-wonderland/src/worlds

Modify build.properties:
>
wonderland.wfs.root=
file:$
{src.dir}/worlds/wonderland-
wfs

If you want to start client by Java Web Start, pack
Wonderland.war again.
Adding modules into your app

Find modules in wonderland-modules
>
PDF Viewer, Video Player, Audio Recorder...
>
Find xxx-wlc.xml e.g.
wonerland-modules/src/modules/apps/2d/tightvncviewer/VNC-
wlc.xml

Modify the xml file according to your requirement

Place the xml file into your WFS
X11 Application sharing

X11 applications can be only launched in
UNIX/Linux
>
Solaris, OpenSolaris, Ubuntu...

SMC
>
./src/scripts/runsmc
>
src/conifg/apps-solaris/
apps-smc.xml
What's Next?

Graceful adaptation to less
capable devices

Full-featured telephony and
conferencing

Increased expressiveness
through
sensor-based
gesture recognition

Take advantage of “virtual”
nature
of space

Identity, security, access
control,
authentication
SunSPOT

Sun Small Programmable Object Technology
>
Real-time wireless sensors
>
Data visualization
>
Motion Capture

Internet of “Things”

Open Grant Program

http://sunspotworld.com/proposals/
Sun's Open Community for Immersive Education

CMS/LMS Integration

Federated Identity

Digital Repository Integration

Best Practices: Architecture, Tools, Pedagogy

Open Curriculum

Industry Partnerships & POCs
http://sun
-
isig.org/
Project Wonderland Resources

Project Wonderland Community Website:

http://wonderland.dev.java.net
>
Download: Binary Distribution, Source Code
>
Learn: Tutorials, technical articles, faq
>
Start: User, Developer & System Administrator resources
>
Participate: Forums, how to get involved

Some Localized documents:
http://developers.sun.com.cn/blog/functionalca/category/Wonderland

Source Code:

https://lg3d-wonderland.dev.java.net/source/browse/lg3d-wonderland/
>
Browse or check out Project Wonderland source code

Download Binary Distribution

Join the community

Participate on the forums

Checkout the source code

Do Project Wonderland tutorials

Collaborate with your friends

Build your own 3D VWs!

Have fun!
Project Wonderland
Get Ahead of
the Curve
http://wonderland.dev.java.net
THANK YOU!
Building 3D Worlds
with
Project Wonderland
Kevin Li
Tech Lead
Sun Campus Ambassador Program
Yuan-Xin.Li@sun.com