Away3d dice with normal map

[Edit – Link not working here]

[Edit – I’ve added another post to take this further, where the map is working correctly – Jan 09]

Over Christmas, I’ve had some time to try and set up a demo for away3d using the Normals mapping that has been added recently. This is the dice demo that I ended up with. Not perfect lighting yet; if the top face stays in position and you rotate the cube on its axis, I thought that the face should remain lit the same, but it darkens as you rotate. I shall work on the code or my normals map a bit more. Arrow keys will turn the die; click and drag to hover around. Not bad for only 12 triangles though.


I had created a map a while back, but have been having trouble getting my model out of 3dsMax. I had a cube from Swift3d which worked perfectly, although it didn’t have the correct uv mapping for the textures. I have Max version 2009 and was trying to use the Collada export as standard. This didn’t seem to want to export in a form that away3d was looking for. I couldn’t see a trianglate option on the interface and I’d read that away3d only dealt in triangles. After using the ‘check for updates’ option, I found there was a new version of the exporter from the Autodesk site. This interface now has the triangulate option,

That didn’t seem to fix my problem, so I went of to the feeling software site to use their plugin. Unfortunately, this plugin is compiled for an earlier version. I did try and install it into the plugins folder and modified the registry to let it find the right location, just to give it a chance, but iin the end t threw up an error and wouldn’t load. After a bit of searching around, I found someone that had found a compiled version, see this thread or the zip file on irdonohue’s site. This gave me a good install and their plugin no showed up on the Export As… menu. feeling-colllada

This worked fine and gave an xml file with triangles, as expected. I exported my cube of twelve triangles and had another go with away3d. It still didn’t work but I came across an earlier post talking about scale of models. Once I had rescaled my object to be much smaller, it appeared in the display and was textured correctly. Did I have to do all that fiddling about? I thought that I needed a node called ‘triangles’ in the xml, but maybe not. The xml produced by the max exporter gave triangles but in a ‘polygon’ node. It’s all about having confidence in the workflow tools, so I’ll probably stick with what I know works.

If you’re interested in the xml, (which I look at with the great little free utility XML Marker from symbolclick), these are some of the formats,

Swift3D has a format containing triangles,

Max standard FBX output gives triangles, but still calls them polygons and outputs each individually,

Feeling Software give similar to Swift but with three values for each point, for point, normal and uv,

added this later… Swift is worth a look at if you’re using simple model shapes and want a cheap way of doing animations. It has a similar timeline to Flash and is easy to use by the non-programmer. I’ve used it for simple animations and straightforward spinning around of an object. It also outputs a full Papervision set of classes, which could be used in away3d with some adaption.

Another link to look at are the series of tutorials from tartiflop. They have some interesting ideas and code to go with them. Really useful, go and have a look.

Hope someone might find this useful.

[Edit – I’ve added another post to take this further, where the map is working correctly – Jan 09]


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s