Month: April 2009

Flex / Flash 10 3D examples

Flex / Flash 10 3D examples

I’ve been doing a bit of R&D around the new 3D features in flash 10 for my work recently and seeing as there is very little info/tutorials out there on the subject I thought I’d add what I’ve found out.

Firstly I’ll just post some of the examples I’ve done and I’ll create a step by step guide next.

Example 1 is a simple VBox that rotates on its Z-axis (if you try to just rotate a container or similar in flex 3 it will rotate around the registration point, which isn’t exactly very useful in most circumstances). So you have to use the new Matrix3D class.
Should you come across this post before I create the tutorial, key points to note
You must translate the object in reference to its parent container
Take a copy of its 3D matrix before you do anything, then only apply transformations on that matrix.

Example 2, the obligatory spinning cube without textures.

Example 3, the obligatory spinning cube with textures. Again if you’re looking at this before I do a tutorial on the subject take note
You must add 24 vertexes (4 for each side) for the bitmap textures to map properly using the uvt data. This caught me out for ages as a cube really has 8 vertexes and I was reusing the same points when building the cube!

 

[ad]

Creating gradient lines and fills

Creating gradient lines and fills

Ever wanted to create a gradient fill or experiment with the various settings in the beginGradientFill method?

I was trying to recreate a simple black background which faded in the middle to a white shade then back to black again and I spent quite a while  trying various options, recompile, test, try more options etc.  This was taking way to long so I created a very quick explorer for the beginGradientFill method.

Hopefully you’ll find it as useful as I did for finding out exactly what values need to change to get a desired result.

Gradient Explorer image

Click to open fill explorer

[ad]