How does papervision3d transform textures?
How, ultimately, does papervision3d (the popular 3D rendering package for Flash) draw the converted textures to the screen?
Is this internal use of any of the Flash playback devices i.e. by painting textures in DisplayObjects and transforming them or using 3D MovieClips? Or maybe filters? Or is it ultimately just reading the pixels from the textures and painting them on the output, just like on any software platform?
I ask because a straight answer would be the last, but after some testing it seems that getPixel
and setPixel
just not fast enough for such an approach, so it seems that there must be something more than the continuation of the secret.
Thanks for any information!
Edit is my summary of the answer . PassportVisitor does not perform perspective transformations as such. It only scales and skews transforms each triangle of the texture, and the illusion of perspective occurs if you use enough triangles. Affine transforms use a Flash renderer to avoid costly pixel manipulation.
a source to share
They are all rendered using the drawing API. (lineTo) With the drawing API you can set the bitmapFill ratehr than the color, which allows textures to be drawn. Internally, they transform each asset you pass as a texture into a BitmapData object to be used for rendering. Then forever the subdivision (triangle) that your 3D object has, they prefrom transformations on it to get the correct perspective.
This approach is still very intense, but faster than every pixel. It is very similar to other 3D rendered softwear, using smae techniques and theories just created specifically for ActionScript.
a source to share