Away3D: Pixel Precision / Pixel Perfect display?

I’ve taken a look at Away3D again, because I had a problem in PV3D, which was so stupid I couldn’t believe that it could actually be a problem. However, as expected, Away3D isn’t exactly free of problems either: If you place 3D objects on a website it might be necessary to display them precisely 1:1, without distortion. That’s especially important if I want to place text or small bitmaps on the objects, as e.g seen on the temporary TCM splash page. In Papervision3D the setting is:

Object.z = Math.round((camera.zoom * camera.focus) -Math.abs(camera.z))
           + Object.depth/2; // take or add 0.5 if it's still blurred

In Away3D the major solution is to place the surface 900 pixels away from the camera, when using default camera. Why 900? I have no clue, but who cares, it won’t persist through changes of the camera anyway. Even worse, it’s not even giving proper results… I’ve spent quite a while testing it and there’s always artifacts and distortions:

I know the image isn’t friendly to the eyes, but it shows the problem quite clearly. The top right one is the original that I used as a material. Weirdly, the bottom left pixel corner is cut and one pixel line in the middle of the plane is duplicated horizontally and vertically as soon as you place it on an object (a cube, in this case). Adding segments or turning on precision doesn’t change anything. Adding / subtracting 0.5 from the coordinates shows parts of the cut corners, but the opposite sides get blurry. Adding smoothing to the material, as some suggested, isn’t a solution either. I suppose this isn’t a mere problem of not having tried enough, because there were others who had this problem before, with no solution. Maybe it only works for planes and not cubes? Well, at least up there’s the setting to get it almost correct.

I’ve quickly checked Hidden Heroes, which was made with Away3D, to see if those ingenious guys fromGGH have found a solution… but it seems that they’re also just switching between blurred and distorted 3D-Planes and normal 2D MovieClips.

Meh. I’ll keep looking.

Papervision3D vs. Away3D – Part 2: Well, maybe not.

Meh, I gave up on my idea of switching to Away 3D, mainly because it’s stupid. While it would certainly make sense considering how papervision is most likely dead, Away3D is probably not that much more productive and better.

Considering how hard it has already been to figure out things like 2D/3D projection, dynamic materials and the insanely god damn uber-annoying animated dae models – besides countless mathematical problems – it would be a ton of wasted effort. I suppose there are solutions for of those most problems, but finding them is probably even more of a royal pain than it was to find them for Papervision3D. I don’t really understand why, but in general there seems to be a bit less blogs and tutorials around and since Away3D uses an archaic mailing list, there’s tons of hardly usable duplicates of every thread. And reaching dead ends means that you have to ask the question yourself, possibly waiting for several days before you get an answer.

While it would certainly make sense on the long run, the idea of having to figure all of these things out AGAIN, before I can continue with even the most basic tasks, completely killed my mood for months. So I’ll better continue with what I have, keep up the speed and maybe consider changing engines once I’m done. Which would probably be best, because molehill is at the horizon and will most likely change everything anyway…

Away3D: First steps

After a day or so, Away3D turns out to be quite a bit harder to get into than Papervision3D, mainly due to the lack of proper documentation.

The support forums are more of a mailing-list, with a bad searching function and very hard to navigate. Google also only seldomly gives proper results for Away3D problems, one reason being that the mailing-list is mirrored several times by different services, which kinda spams the search results.

And often enough, even if you find tutorials, they’re hopelessly outdated. The strong part of Away3D, its frequent updates, is also one of its larger problems, as methods are replaced frequently with no one documenting their use properly (or at all). Whatever problems you’ve managed to solve when using Papervision3D, Away3D has new ones in store for you…

What’s comparable is the fact that they have a book, in this case “The Essential Guide to 3D in Flash” (quite snotty compared to PV3D’s “Papervision3D Essentials”, haha). I’ll look into it.

Away3D: Is Papervision3D dead?

Well, when I’ve gotten pretty far and ran across some random problem I’ve checked the Papervision3D forums, just to, again, stumble across some people asking whether PV3D is still being developed or not. Seemingly not. The last release is from 2009 and this blog post, where one of Papervision3D’s main developers leaves the crew doesn’t look promising at all. Furthermore, the development on PV3D’s Flash Player 10 / CS4-Branch as well as the development of the next version, PapervisionX, seems to have been on hold for about a year. That is especially easy to see at the PapervisionX GitHub, which was introduced for people to “watch the engine grow” and abandoned after the initial commit. Since then, nothing seems to have happened and while there’s no official statement, even the Papervision3D Forum Administrator doesn’t exactly believe that PV3D is sill alive.

Now that I’ve already spent some serious effort into learning PV3D, I’ve got to ask myself whether it still makes sense to continue or not. Continuing could be risky, because it’s always possible to come across a bug big enough that it turns out to be a final dead end, with no hopes of Papervision3D’s developers to ever repair it (because they disbanded long ago).

And even if I manage to get some project done, if PV3D isn’t developed any further, I’ve clearly bet on the wrong horse and acquired a skill that’s going to be completely useless. Oh my.

From a quick scan it seems that Away3D is the more actively developed engine right now. So I guess that, even though it’s quite a hassle to switch engines in the middle of a project, it only makes sense to spend a while looking into it… Meh. This is turning out to be a Duke Nukem Forever, but well, wonders do happen.

Update: Papervision may be dead, but Away3D isn’t exactly a good solution either. It’s neither more stable nor is it faster.

Reducing Collada/DAE Filesize

My .dae is currently 150KBs large – which isn’t much – but more complex models can probably easily get into the megabyte-range. And then it will definitely sum up and take time to load. An easy way to reduce Collada filesizes:

  1. Open the file and delete double spaces, tabs, line breaks.
  2. Delete Collada overhead not required for Papervision3D’s Collada parser (trial & error)
  3. Search & Replace long object names like Bip01_Arm_Torso_Spine-node-transform_Bip01_Spine-node_transform-input-array into b1ats_nt_b1sn_tia or something even smaller, as long as it’s unique (trial & error again)
  4. Insert the XML into a Flash-file and load the .swf instead of the .dae.

While the second and third part are optional and only recommendable once the model is final, the flash-part is really efficient, because (unlike .dae-files) swf-files use compression. All in all I got from 150kb to mere 10kb. Nice, nice.