Für den Inhalt dieser Seite ist eine neuere Version von Adobe Flash Player erforderlich.

Adobe Flash Player herunterladen


3D Cube Demo

I have been working with papervision since a long time now but even with a simple cube the performance is not even a bit comparable to the native CS4 3D power of Flash itself. Textures doesn’t have do be cached and transformed as Bitmaps, Flash handles MovieClips in 3D like in 2D; vector graphics are still scalable.

This is how to create a simple Cube in CS4:

function createCube():Sprite {

	function createElement(_ausgabe:uint, __x:Number, __y:Number, __z:Number, __rotationX:Number, __rotationY:Number, __rotationZ:Number):void {
		var _container:Sprite = new Sprite;
		_container.x=__x;
		_container.y=__y;
		_container.z=__z;
		_container.rotationX=__rotationX;
		_container.rotationY=__rotationY;
		_container.rotationZ=__rotationZ;
	}

	var _container:Sprite=new Sprite  ;

	//FRONT:
	_cube.addChild(createElement(1, 0, 0, -100, 0, 0, 0));
	//BACK:
	_cube.addChild(createElement(3, 0, 0, 100, 0, 180, 0));
	// RIGHT:
	_cube.addChild(createElement(2, 100, 0, 0, 0, 90+180, 0));
	// LEFT
	_cube.addChild(createElement(4, -100, 0, 0, 0, 90, 0));
	// TOP:
	_cube.addChild(createElement(5, 0, -100, 0, 90+180, 0, 0));
	// BOTTOM:
	_cube.addChild(createElement(6, 0, 100, 0, 90, 0, 0));

	return _container;
}

1 l mate later:

Why not combining the ability to scale without quality-loss with actual Multi-Touch gestures?

Here is the result:

One comment

  1. dude, that’s awesome! :-)

Leave a comment

You must be logged in to post a comment.