Exporting textured objects from 3d MAX to PV3D 2.0 tutorial
June 3, 2008 — flaim[SEE WHAT YOU ARE GOING TO LEARN]
This tutorial explains how to make a 3d object with 3d Studio MAX , unwrap the uvw, export it to actionscript 3, import to your papervision 3d project , texture it and deploy as a flash movie
What you need to use this:
1. Papervision3d (latest classes included) - http://blog.papervision3d.org
2. Flash CS3 - http://www.adobe.com/flash
3. 3D Studio MAX (I’ve used the latest 2009 ver. Should work with previous ones too) - http://www.autodesk.com
4. AS3GeomClassExporter for 3DStudio MAX (included) by http://dreammania.net - extended by mr.doob.
5. Some basic modelling and texturing skills to make something. Some Max interface knowledge proofs useful here too.
You could use different software for this (Maya and so on..) but I didn’t test it so I’ll focus on MAX right now.
I’m not a real tutorial writer so I’ll make this as short as possible - explaining with screenshots where possible
Let’s get on with this:
Part I - MAX
1. You need to open max and install the script (AS3GeomClassExporter) - this screenshots shows where and how to do this:
2. Run the script like here (it executes and shows the panel when you select the script from the combobox):
3. Configure the script for PV3d 2.0 like I did it here:
4. Model anything you want. I’ve made a simple chamfer box here:
At this point you should remember a few important things:
- use as little polygons you can handle to improve the speed (low-poly is your friend here:)),
- you can connect (boolean, modify mesh, combine with loft or lathes and so on) everything you want. But you must keep the object as ONE mesh - closed one. If you want to combine many objects you have to do this in papervision - not in max - the exporter allows to export 1 object.
Here is a sample Boolean (with union) of the chamfer box and a loft made of text and a line (for loft depth):
AS you can see in properties this is a single object with a simple structure (low amount of faces and vertices).
5. Now a very important part! You need to place the PIVOT for the object correctly. The pivot is the point which papervision would read as 0,0,0 coordinates. So it is crucial for rotating/positioning and moving the object later. This is how you do this
6. Now it is time to prepare the UVW texture coordinates and map for the object. We’ll do this in parts:
a) You need to unwrap the Mesh using UVW Unwrap. Select the object and do EDIT/select modifier Unwrap UVW from the combo:
b) Now you need to select Face from the Unwrap modifier and select all the faces (CTRL+A) of the object - then press “EDIT..”
c) A new window will open up - the selected faces (red) will overlap each other - this is time to unwrap the mesh so select MAPPING from the main menu –> normal mapping. You can modify some parameters in the window that appears - but for this object it is just fine to CLICK OK:
d) Hurray! it is done. The mesh will unwrap like in the screen below. Of course you can modify the unwrap - play with the unwrap tool a little yourself ;). In this case the automated unwrap worked rather fine (the mesh was simple) and I don’t need to correct anything here. I have one overlap which I should correct but it’s not important for this tutorial.
e) Now it is time to render the map (you need something to paint on and texture in pv3d :)). I would suggest rendering two maps in the same resolution (don’t select them too big - a 1500×1500 map is just fine and fast for a complicated object in pv3d if you don’t use too many objects). One with the edges visible (this can be helpful when drawing in photoshop - you can apply the edges on a different layer and use as a helper :). The second one shaded - to use as a canvas for painting.
The renders aren’t to pretty but they should do:
You are done with Unwrapping at this point
Congratulations. Lets proceed to the next section.
7. Now the fun part. As you have the object created (it is a single closed mesh with uvw coordinates applied and ready to go!) you can now EXPORT THE AS3 CLASS with this object
Select the object with the select tool and press EXPORT CLASS in the scripts panel/as3geomexporter. Like that:
Thanks for your attention. When you finish this tutorial you should have:
- an AS3 class with the object you’ve created (it contains the mesh definition + the UVW map definition),
- a texture which you can paint on and use with the object,
- a max file which you can use again if you don’t like the results,
Part II - AS3 in FLASH
What you need next (I’m not going to explain it in details here because the code is well commented):
- the source code - you can see it working here. You can download it here.
So you are ready to go - now you can import your object and use it in papervision WITH MAPPING!
I hope this tutorial helps.
Feel free to comment! You are welcome as usual!
Have fun,
FLAIM





















