Tag: skewed

Just Tilt Your Head! (Flex 3.2 & 3D, Getting It Right!)

by admin on Feb.05, 2009, under 3D

So if you have tried to rotate things in the new Flex 3.2, you have noticed that thing are a bit askew by default.

Check this demo here…

You can either set your applications width and height to something static (PLEH!), or you can do something like this:

<?xml version="1.0" encoding="utf-8"?>
 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"
 
width="100%" height="100%"
 
xmlns:geom="flash.geom.*"
 
creationComplete="setVanishingPoint()"
 
resize="setVanishingPoint()"
 
>
<mx:Script>
 
<![CDATA[
 
private function setVanishingPoint():void
 
{
 
var mainTrans:Transform = new Transform( DisplayObject( this ) );
 
var mainPersp:PerspectiveProjection = new PerspectiveProjection();
 
mainPersp.projectionCenter = new Point( this.width/2, this.height/2 );
 
mainTrans.perspectiveProjection = mainPersp;
 
this.transform = mainTrans;
 
}
 
]]>
 
</mx:Script>
 
<mx:Button id="btn" label="Button" width="100" height="100"
 
horizontalCenter="0" verticalCenter="0"
 
rotationX="35"
 
/>
 
</mx:Application>
6 Comments :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...