Uniform Perspective Projection in away 3d

Software: Away3D 4.x

grish, Newbie
Posted: 31 May 2013 09:57 PM   Total Posts: 3

Hi All,  Looking to have a simple card flip animation have the same perspective projection on the flip no matter where the card is horizontally or vertically.  In Flash this is explained and corrected here: http://www.flashandmath.com/flashcs4/pp/

Does anyone know how this can be achieved in away3D?

Thanks!

   

grish, Newbie
Posted: 03 June 2013 05:55 PM   Total Posts: 3   [ # 1 ]

Anyone?  Another way of asking this could be:

Is there a way to assign the perspective projection to objectB based on the perspective projection of an objectA that resides at 0,0 with the goal of objectB being able to have an animated rotationY look the same as objectA’s, but be positioned at a higher or lower y position?  I’d like to make an animated rotationY card flip that isn’t getting all wonky if the card isn’t placed near the origin.

Thanks!

   

Pierce, Jr. Member
Posted: 07 June 2013 06:34 PM   Total Posts: 40   [ # 2 ]

I think what you’re asking for is an orthographic projection, where there is no foreshortening or shrinking as objects regress into the distance. This is easily accessible by changing the LENS on your camera. Just look in the camera package and properties of the Camera class and you should be able to figure it out. If you run into difficulties, I can find some old code where I’ve implemented before, but as I remember it being fairly straight forward, it would be helpful practice if you attempted it on your own first. Good Luck!

   

grish, Newbie
Posted: 07 June 2013 06:57 PM   Total Posts: 3   [ # 3 ]

Yay! Thanks for the help.  I changed the lens and it seems to have improved things a lot.  This is one workable solution for sure, appreciated.

This lens though takes away the 3D look of the flip.  I wonder if there’s a way to have the perspective flip “look”, where the front edge of a flipping card appears to come at you as the back edge retreats.  This one looks like a straight compress and expand.  I wonder if it has to do with the default settings of the lens?

The perspective lens looks great if a card is 0,0 but is distorted the farther you move it on the x or y away from 0,0.  My app wont use any z other than 0.

The Flash and Math link above shows how the Perspective Projection in native Flash world can decouple an object from it’s parent and thus will not have this distortion.

Anyone have any ideas on how to accomplish this for a 3D looking flip that has the same look as 0,0 even if it’s at 0,700 or anyplace in between?

Thanks all for reading.

   

Pierce, Jr. Member
Posted: 07 June 2013 07:20 PM   Total Posts: 40   [ # 4 ]

I think it would be possible to negate just the X perspective and have foreshortening along the Y by changing the settings with a custom lens. This might still be unsatisfactory for multiple rows of cards, but that would be impossible to address orthographically. Something that would theoretically work very well in a perspective lens, if you’re willing to figure out the math, is to have the cards actually positioned as if they were resting against the inside of a concave surface equal in proportion to the lens, rather than lying in a flat arrangement. However, you may be able to approximate this fairly well by simply directing all the cards to lookAt the camera once when they are created, and then just rotate them 180 degrees for every flip. If you start getting it pretty close but still not perfect, then post an image of the result to help work out the last part of the solution.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X