Pixel perfection in Papervision3D

October 24th, 2009 posted by The Hippy

Precision Papervision 3D

I’ve been tearing my hair out for the last 24 hours trying to work out how the hell to get my precisely drawn design to scale correctly in Papervision. Anyone who’s tried this will know that it’s a frustrating blend of messing around with camera zoom, focus and field of view. But try as I might, I found it absolutely impossible to solve. I had come to the end of my patience and was ready to give up with PV3D and change the design completely…

…and then I came across this.

The thing that crossed my mind first when seeing this demo was “not only is it possible to reproduce a good pixel perfect 2D design in Papervision, but potentially it could be really great”.

After a bit of mooching around I came across the fantastic article that it was produced as a demo for. Rather depressingly, the article explains in very few words that all you need do is apply the following formula to the z axis of your 3D object:

3dobj.z = (camera.zoom * camera.focus) - Math.abs(camera.z)

I’d just like to take this opportunity to thank the author of the post for collating that information and producing such a simple yet thoroughly inspiring demo. You’ve saved me an enormous amount of time and taught me one clear lesson…when in doubt, stop getting frustrated and google it.

Post to Twitter Post to Facebook Post to StumbleUpon Post to Digg