Home > Uncategorized > Simplify camera parameters in pv3d

Simplify camera parameters in pv3d

September 4th, 2009 Leave a comment Go to comments

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

Tags: , ,
  1. November 5th, 2009 at 14:28 | #1

    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. November 15th, 2009 at 16:53 | #2

    I’m glad to hear it!

  3. Maciek
    December 21st, 2009 at 13:54 | #3

    Good stuff : ). Thank’s Anna.

  4. Maciek
    December 21st, 2009 at 13:57 | #4

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

  1. No trackbacks yet.

Switch to our mobile site