Draft proposal, Cube in Flash

I have been brainstorming the best possible way to present my portfolio so that it is quick and straightforward for the user to see and use, as well as being able to insert audio footage of my ideas- ie explaining what the images are about.

I have decided to create a cube that the user can navigate round, with an image on each face. The cube will be turned by a joystick type button next to the cube and when the user clicks on a side, the image will appear large on the screen and the audio will play.

I have researched how to do this and it appears to be very difficult, so a great deal more research will be needed! Here are links to some useful sites ive found so far! :-  http://www.petitpub.com/labs/media/flash/3dcube/ ,    http://www.gotoandplay.it/_articles/2004/07/skew.php?PHPSESSID=a0860be74755ebcd7966ee467bb14c69,      www.adesblog.com,   www.flashsandy.org,  I have also bought ‘Flash Game Programming for Dummies’ to help me through!

Creating a 3D cube using flash will involve using flash, PHP and javascript.

Here is an example of the code involved according to the first site I quoted.

var images:Array;
var outText:String=””;
var done:Boolean=false
this.onEnterFrame = function(){
done = true;
for( var i=0; i < images.length; i++){
var loader = new MovieClipLoader();
images[i]=”http://static.flickr.com/&#8221; + images[i];
outText+= ‘\r’+images[i] ;
image=this.createEmptyMovieClip(“image”+i, getNextHighestDepth());
loader.loadClip(images[i], image);
image._x = 80*i + 4;
image._y = 3;

I have created a cube shape in flash and am researching how to achieve a distortional skew when I add my pictures to the sides of the moving cube.

First I will need to put each side of the cube into a seperate layer and turn them into movieClips. Then, to distort a movieClip I will need to make the picture by multiple stripes and control them respectively. This is going to be tricky!

The common to dynamically skew a movie clip is to make a tween to render the skew angle, however this wont work for images in a cube, my best bet is probably to put a movie clip in a stratched movieClip.

MovieClip itself does rotation and _parent does stretching, The _parent can also do rotation and the movieClip can also do stretch. So, with a combination of stretch and rotation I could make the square movieClip skew to the cube shape. 

A cube will work on 3 axis- x-up, y-across, and z- around.

Now, the tricky bit will be knowing how much _rotation and _xscale and _yscale we should apply to _parent and movieClip itself, however I must also take the z axis into consideration if the viewer will be able to control the movement of the cube.

Tocalculate the relationship of skew angle and _parent._yscale I will need to do some maths! The stretchig of _parent._yscale will increase the skew angle and shrink the _parent.yscale will shapen the skew angle.

As I do not want the cube to play as a movie, but the direction that it turns in to be controlled by the user, I will aso have to research how to ‘rotate around a 3d (x,y,z) axis’ manually.

I think this has great potential to be a very interesting (and challenging!) project- bring it on!


1 Comment »

  1. jt Said:


    Have you found a good solution, yet?


{ RSS feed for comments on this post} · { TrackBack URI }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: