This was my first attempt at using the AS3DMod Library so you can see where the previously posted example came from.
I’ve also added gouraud shading to make it a little more interesting.
Click image to open:
We’ve made sites using Papervision in the past, but I’ve had a bit of time to really get to know it a lot better. There has been so much functionality added lately it’s hard to keep up!
The following project started as a simple idea for a gallery to showcase work that we have done but eventually evolved into more of a personal indulgence. Click anywhere to flip the page over.
To get the two sided Plane effect I’ve simply used a Cube that is 1px deep. The thing that frustrated me the most was trying to get the MovieMaterial holding the content of the image Loader instance to render the correct size. Initially I was creating the MovieMaterial’s at the same time I was initialising the Loaders but as there was no content in the loaders yet, the MovieMaterial rendered at its default size.
To fix this I initially assign a place holder Sprite that is the correct size to the MovieMaterial objects. Then when the Loader finishes loading the asset I switch the MovieMaterial that contains the Sprite for a new MovieMaterial that contains the image data from the Loader. This also means that the MovieMaterial does not have to be animated (updated on each render loop) improving performance.
It took me a long time find the method to replace materials, but it should have been pretty obvious.
_cube.replaceMaterialByName( /* new material */ , /* material name */);
Click image to open: Click again to flip:
Also thanks to Zack Jordan for sharing his SWFLibrary class.