Issues Converting from Away3D 3.5 to 3.6

Posted: April 4, 2011 in Uncategorized

I’m writing this blog post mostly to get a couple of screenshots where they’re easily accessible by the Away3D community so they can help.

I’m converting my G-Wizard CNC CAD/CAM software, which is an Adobe AIR app running Away3D from version 3.5 to version 3.6.  3.6 is faster and is a precursor to 4.0, which is what I need to work with Flash Player 11 (Molehill), which will be a LOT faster.  There’s never enough speed where graphics are concerned!

Most of the conversion is pretty straightforward.  It largely involves switching a bunch of references from a discontinued Away3D type (Number3D) to a Flash type (Vector3D).  I don’t use many of the API’s because my graphics in this app are wireframe, so a more sophisticated user of Away3D may not have it so easy.

After I got the Vector3D conversion done, which seemed like a good idea just on general principles, I had 2 API issues to deal with.  It is frequently useful to be able to convert from screen 2D (mouse) coordinates to 3D coordinates and back again.  My goto for 2D to 3D had been a utility provided by Fabrice for use with the mouse.  It temporarily lost its ability to convert arbitrary coordinates and initially only wanted to use the mouse, but I talked Fabrice into bringing back the old functionality.  The other route, 3D to 2D, is what I use to do things like automatically zoom the objects so they fit the screen.  I had “borrowed” code from the camera internals, but that turned out to have been a silly idea as there was a perfectly good “screen” method that does the work in both versions.  So I updated my code and was much the better for it.

The latest problem I discovered is more vexing.  It seems that 3.6, for some unknown reason, can be fed all the same inputs for the model being viewed and the position of the camera and it will produce a different result than 3.5.

Here is the Trident under 3.5 showing what it should:

Away3D 3.5 Trident:  Old TridentThe axis Trident as it should appear…

And here is the Trident under 3.6:

3.6 axis Trident:  New Trident

Wot the ‘ell, Archie, wot the ‘ell?

Something’s gotten a bit bollixed up on that second Trident.  It wasn’t hard to set my code up so I can switch between 3.5 and 3.6 easily and with very few changes.  I just simply created a couple of utility routines:

– N2V:  Converts a Number3D to a Vector3D

– V2N:  Converts a Vector3D to a Number3D

Just by changing those two wrappers, I can determine whether I feed Away3D Number3D’s or Vector3D’s.  That’s handy, and it makes it dead simple to verify I’m doing exactly the same thing with both packages and getting a borked Trident back out of 3.6.  It also means I can continue working on other things in the product while I wait for some assistance from the Away3D gang.

I’ll report back what we find out when we get a solution.

Advertisements
Comments
  1. […] That’s a pretty huge savings for me and it gets better the larger the file loaded.  This particular file has somewhere between 25,000 and 30,000 Segments in it.  Rendering performance (i.e. framerate) is unaffected since we wind up with the same Mesh data structure we’ve always had.  Also, this is done in Away3D 3.5 since I’ve not yet been able to get 3.6 working right (see my earlier post today). […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s