author: Krasimir Tsonev

Hi there, I'm . Senior front-end engineer with over 13 years of experience. I write, speak and occasionally code stuff. Follow me on Twitter, GitHub, Facebook or LinkedIn

Pixel perfect in Papervision3d

Did you ever wonder how to create a pixel perfect animation in Papervision3d? I designed my portfolio site in Photoshop, but when I tried to integrate the 3D effects I spent a lot of time in changing the zoom and focus length to match the exact dimensions. And even then they were not perfect.

I found an easy solution here. Just change the z property of your 3d objects like that:

yourobject.z = (camera.zoom  * camera.focus) - Math.abs(camera.z);

If you enjoy this post, share it on Twitter, Facebook or LinkedIn. Or maybe comment below: