Simplify camera parameters in pv3d

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

4 comments on this post.

  1. nolen tabner:

    I just want to thank you for this tool. It has cut a significant amount of time from my development on a current pv3d project.

  2. Anna:

    I’m glad to hear it!

  3. Maciek:

    Good stuff : ). Thank’s Anna.

  4. Maciek:

    Oh, and If anybody will found an runtime error with pv3dObjectControl class – do not forget to set Your viewport’s ‘interactive’ parameter to true.

Leave a comment