Matching view to actual Stage pixels

Software: Away3D 4.x

Bozzified, Newbie
Posted: 06 January 2013 11:52 PM   Total Posts: 1

Hi.. just getting into and learning Away3D so it’s really hard to fully understand everything so excuse my ignorance.

Here’s my question:

I want to create some interesting page transition effects for an app. I am working with PlaneGeometry to write textures (screenshots of my UI within the app) and putting them on the plane.

The problem I have is matching the actual pixel size of the plane/texture to match the coordinate system and size of the stage.

Can someone give me a hint if there’s something I can do to make the plane/texture match exactly the stage size 1:1.

A hint what to look at would be good as well. For example, should I mess with fov setttings on the camera/lens or camera positioning along the axis.

I tried different setting with the camera and I can manually get close to actual pixel size of my texture to fully match stage pixels but I need a better way.

Not sure if I’m describing this badly.

Thanks.

   

_kihu, Jr. Member
Posted: 07 January 2013 08:57 AM   Total Posts: 43   [ # 1 ]

You calculate camera focus:

focus Math.tan((camera.lens as PerspectiveLens).fieldOfView*Math.PI/360); 

Than camera’s forward vector:

var forward:Vector3D Matrix3DUtils.getForward(camera.transform); 

finally you position the plane like this:

plane.camera.position.forward.* -view.height focus

Not sure if this is the thing you were looking for. You can enhance this to be able to manipulate camera’s and plane’s angles and space positions.

Credit goes to bardo:
http://away3d.com/forum/viewthread/2199/

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X