Skip to content

Unity exporter tutorial

Bartek Drozdz edited this page Sep 13, 2011 · 13 revisions

This tutorial illustrates how to export a simple scene from Unity3D to J3D. The scene is composed of geometries, materials, textures, light sources and a camera. J3D currently supports a limited amount of materials and directional light only.

To complete this tutorial you'll need to files.

  1. The package containing a sample scene that will be exported to J3D/WebGL (link coming soon)
  2. The package containing the Unity Exporter scripts (link coming soon)

Download both files to your hard-drive, open Unity3D and create a new project. Next, right-click in the Project panel and choose "Import Package..."

1. Import package

Locate the tutorial UnityPackage file and choose it.

2. Locate the tutorial file

The project contains a few assets - meshes, materials and textures, as well as a scene called tutorial-scene. Open that scene and you should see something like this:

3. Open the tutorial scene

The scene features a few objects on a floor as well as a camera and one light source. J3D supports only directional ights so far, so this is the type of light used here.

4. Import the exporter package

Right-click the Project panel again and choose "Import Package..." again. This time choose the UnityPackage that has the J3D exporter scripts in it. Unity always show you what files are in a package. In this case that's what you should see:

5. J3D Menu

As soon as you import the package, a new folder called "Editor" will appear in the project panel as well as a new main menu item called J3D. it typically comes between Terrain and Window menus. Select all the objects on the scene using Crtl/Cmd+A in the Hierarchy panel or in the Scene view and from the J3D menu choose "Export".

A panel giving you a few options will appear. You do not need to modify anything, just hit "Export" at the bottom. Choose a name for your file (ex. tutscene) and save it in a folder of your choice.

6. J3D exporter settings

This are the files that the exporting script should save in your directory. Basically these are textures files in PNG format and 2 json files - one has the geometry definitions, the other one describes all the objects in the scene, their positions, types, materials etc.

7. Exported files

TBC

8. The scene in WebGL!

Clone this wiki locally