DegrafPaper3d and alternate Degrafa Transforms (360|Flex April 2008 API Contest)
This is an implementation that brings Degrafa geometry into Papervision3d. I implemented a new Renderable in Papervision org.papervision3d.core.render.command.RenderDegrafa which transforms a set of Degrafa definitions into 3d render commands. These are located in the org.papervision3d.core.geom.renderables package.These are then rendered at runtime (as vectors, not using bitmaps at all) by the org.papervision3d.materials.special.DegrafaMaterial. I also implemented an early version of the Degrafa Transformations to support various modifications of the geometry at runtime.
The demo application for both is DegrafPaper3d and Degrafa Transformations Demo. A (slightly) more beautiful example is the Mii Call demo, which uses this technology to draw the features on the Mii's faces.
The code in DegrafPaper3dPrimitives.mxml should explain enough detail for creating 3d Degrafa primitives. Basically, you just use a degrafa:GeometryGroup3d instead of a degrafa:Surface or whatever you usually use. The GeometryGroup3d has a displayObject3D property which you then add to your Papervision3d Scene3D with code such as scene.addChild(b.displayObject3D).
I did my best to transform fills into 3d as well, although this is not possible to do completely accurately (same issue as transforming bitmaps into 3d, you need a non-linear perspective and also radial fills are the same in height and width). The primitives are single-sided by default, but this can be changed. I don't remember if I added an easily-accessible property for that, but it is pretty straightforward (if you know how to write Papervision renderables... ahem.)
This uses a version of Papervision 2.0 and a version of Degrafa pulled in March 2008. Both versions are certainly incompatible in ways with the current releases of both libraries.
The second tab at the top of the application ViewStack is for a Degrafa Transform Demo. Basically, I looked at the stub code that the Degrafa team was working on and completed it in my own fashion. They have since completed Degrafa Beta 3 which has the full implementation of Transforms. I haven't looked at the new release, but it appears to have similar capabilities.
The Story:
In April 2008, I entered the API contest for 360|Flex Atlanta. I got my entry in at the last minute and probably got very few votes. I had posted the demo on my website at the time (which was http://sspeare.com) but since I have moved and gotten my website going I haven't reposted it. I developed this over several weeks after my day job, so it isn't as polished as I would like, but it should still be functional.
I implemented this technology as part of my Mii Call entry into the Ribbit contest as well. The Mii Call app uses Ribbit to implement a phone book application. The application allows you to use an editor like the Mii Editor in the Nintendo Wii to create Miis for your contacts. You can also import contacts from Facebook into the application through their API. I have another post about the Mii Call 360 Flex Api entry on this blog. Here is a link to the Mii Call demo itself.
