My friends and family are under attack in Ukraine. Donate to protect them directly or help international organizations.

Simplify camera parameters in pv3d

September 4th, 2009

I've been supplied a 2D sketch of what my 3D world (PaperVision3D) will look like. The hardest part was matching the perspective by carefully positioning the camera. Having no other way than trial and error and a total of 7 different parameters, I quickly went nuts. This is a time consuming task: changing the values, recompiling, testing.

I wrote a tiny utility that allows you to position/rotate/zoom the camera visually, saving hours and possibly days of tweaking.

How to code it

Easily. Pass the camera object to the constructor and add the whole thing to your display list:

var cameraControl:pv3dCameraControl = new pv3dCameraControl(_camera);
addChild(cameraControl);

How to use it

Click and drag the desired text field and your camera will move, updating text field's value. Once satisfied with the result, write down the numbers!

Also position objects

A second, similar utility I wrote allows to position objects in the viewport.

var objectControl:pv3dObjectControl = new pv3dObjectControl(viewport);
addChild(objectControl);

Click on an object in the viewport, then drag the desired text field.

Have fun.

pv3dCameraControl.as
pv3dObjectControl.as

Previous: When garbage collection does more than you want Next: ZendCon 2009 Review