-
Notifications
You must be signed in to change notification settings - Fork 124
Unity exporter tutorial
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.
- The package containing a sample scene that will be exported to J3D/WebGL (link coming soon)
- 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..."
Locate the tutorial UnityPackage file and choose it.
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:
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.
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:
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.
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.
TBC