Subscribe to RSS
get email updates
home | about | pixDif AIR app | video tutorials
polyGeek.com

place your ad here

Web Premium



Get Qwest High Speed Internet



Transforming components in 3D with Flash 10/Flex 3.2

December 2nd, 2008 . by polygeek

Do you want to know what a Flex <Panel> looks like when skewed on the z-axis – or any axis for that matter – using the new Flash 10 3D tools? Well, take a look. The top version is applying the transformations directly to a <Panel>. The bottom version is applying the transformations to a <Container> with the <Panel> centered inside it.

view source

In the version below the <Container> has clipContent=”false” because the center of the <Panel> is placed at the x=0, y=0 of the <Container>.

view source

A few things to note
You can see that the components, especially the text, look a little ragged. That’s because, as I understand it, you’re actually looking at a Bitmap representation of the component. So if you are doing any transformations in 3D and then bring your component back to to a 2D position you should set the component.transform.matrix3D = null. That way the component will no longer be rendered to a Bitmap. You can read more about that at Bit-101.com where Keith talks about the 3D capabilities of the new Flash 10 player. Be sure to read the comment by cnuuja – #11 -  who works for Adobe on the 3D features for the Flash 10 player.

There are some really good notes on the OpenSource.Adobe site about the new 3D features. I’m still working my way through understanding everything there.

scaleZ
I could have swore I saw the z-scale slider effecting the position/placement of the <Panel>. Maybe I was imaginging things ’cause it don’t seem to be doin’ much now.

Next Up
This is all cool and very easy to do. Next is getting the head around the Matrix3D class where are the cool toys are. Look for more examples soon.

I got the idea for these experiments from a post by Allen Rabinovich at Yahoo.com.

If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.

Post to Twitter Post to Delicious Post to Facebook Post to Reddit Post to StumbleUpon


similar posts

10 Responses to “Transforming components in 3D with Flash 10/Flex 3.2”


comment number 1 by: Lance

Thanks for this example! I've been trying to figure out how to get that center registration point working. Is this the only way to do it with Flex components? Or could you do some matrix transformation to make it work maybe?

I noticed in the FxRotate3D class they do some interesting magic to make the 3d registration point in the center but I can't replicate it. Again, thanks for the example, it helps a lot.

Best,

Lance

comment number 2 by: polyGeek

@Lance, I'll take a look at the FxRotate3D – that's a Gumbo thing, right? I haven't messed with Gumbo much because I have my hands full with other goodies. But soon, very soon. :-)


[...] objects in Flex using the FxRotate3D in Flex, provide source code online view. second one is Transforming components in 3D with Flash 10/Flex 3.2, also provide code. last one is tutorial for Getting Started with Adobe Flex and Away3D [...]


[...] 4 support two new 3D model, Matrix3D and FxRotate3D. but they need to be supported by flash player 10. [...]

comment number 5 by: Steve

Could you try to reproduce some odd scrollbar behavior that I'm seeing that may be a bug?

Your center rotate project makes a good test case.

Increase the Panel3D contents size so that the panel has scrollbars.

Add two more Panel3D objects to the project. Scroll bars on panels to the right will raise up the Panels to the left.

This is exactly what I did.

In Panel3D change the height of the image to 500 to get scrollbars in the panel.

In _3D_centerRotate.mxml, copy the Container tag and paste it twice.

fix the unique id's for "panel" and "panel3d"

offset the two new panels. Add -50 to the second panel x= value and -100 to the third panel x value.

Run the project and you should see 3 panels offset by 50. Scroll the right panel and you should see it raise up the panels to the left of it. Use the sliders to rotate and move the panels and you should see the panels stay offset by the scroll.

If you take the objects out of 3d space, then the scrollbar works normally. To test this I just deleted all the rotation, scale and z settings of the panels.

If this isn't a bug, then how do you put multiple objects with scrollbars in 3d space without the scroll bars effecting each other? Hopefully you will see the same issue that I'm seeing.

Thanks,

Steve

comment number 6 by: polyGeek

@Steve, any chance you could just send me the code? I'm sort of in the middle of moving and working on too many projects.

comment number 7 by: polyGeek

@Steve, I tested this out and OUCH! That is seriously messed up. I have no idea why the scrollbars in one Panel would affect those in another Panel.

I'll post this example and if Tink thinks it's a bug then I'll submit it to Adobe.

Note: in case you didn't know, Tink is pretty much an encyclopedia on all things Flash and will know right off the bat if it's a bug with the player or my code. :)

comment number 8 by: Dean

I might be missing something here, but I don't see the rotationX, rotationY, rotationZ in the panel option. And it won't compile adding those values.

I am using Flex Builder 3.0.2. and made sure I had the 3.3 SDK installed.

comment number 9 by: Dean

Ah, apparently it took a couple of restarts of the Flex Builder for them to show up.

comment number 10 by: Erik van der Neut

Thanks so much for this little demo. _SUPER_ helpful, and fun :-)

Erik

   Welcome back (Change)

Leave a Reply

comment feed RSS   subscribe to this comment thread

Recent Posts

   



polyGeek.com

© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
M2 Websites
Local Directory for Los Angeles, CA

Better Tag Cloud