Setting the Stage vanishing point in as3

3 Comments 21 January 2010

I was playing around with Flash Player 10 3D capabilities yesterday and thought it was worth posting how to set the Stage vanishing point (as it’s not that well documented). The vanishing point is set to the top left corner of the stage by default. The below code set’s it to the center of the stage:

root.transform.perspectiveProjection.projectionCenter = new Point(stage.stageWidth * .5, stage.stageHeight * .5);

Posted in 3D, ActionScript

3 Responses to Setting the Stage vanishing point in as3

  1. 13 February 2010

    That’s a great bit of code that is very useful to create a more believable environment when you’re dealing with a lot of 3D elements. Thanks for posting that.

  2. 6 July 2010
    sq2

    glad i remembered who and where this was posted!

    +1 saved ass…

    cheers.

  3. 8 August 2010

    Great tip! Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>