Sera,
quello che cerco di ottenere è una rotazione dell'oggetto che simula il 3D.. ma quì non si muove
manco di un pixel thanks byee
codice:
this.createEmptyMovieClip("theScene", 1);
theScene._x = 150;
theScene._y = 150;

focalLength = 300;
//--------------------------
make3DPoint = function(x,y,z){
	var point = new Object();
	point.x = x;
	point.y = y;
	point.z = z;
	return point;
};
//------------------------------
make2DPoint = function(x,y, depth, scaleFactor){
	var point = new Object();
	point.x = x;
	point.y = y;
	point.depth = depth;
	point.scaleFactor = scaleFactor;
	return point;
};
//----------------------------
Transform3DPointsTo2DPoints = function(points, axisRotations){
	var TransformedPointsArray = [];
	var sx = Math.sin(axisRotations.x);
	var cx = Math.cos(axisRotatio
ns.x);
	var sy = Math.sin(axisRotations.y);
	var cy = Math.cos(axisRotations.y);
	var sz = Math.sin(axisRotations.z);
	var cz = Math.cos(axisRotations.z);
	var x,y,z, xy,xz, yx,yz, zx,zy, scaleFactor;

	var i = points.length;
	while (i--){
		x = points[i].x;
		y = points[i].y;
		z = points[i].z;

		// rotation around x
		xy = cx*y - sx*z;
		xz = sx*y + cx*z;
		// rotation around y
		yz = cy*xz - sy*x;
		yx = sy*xz + cy*x;
		// rotation around z
		zx = cz*yx - sz*xy;
		zy = sz*yx + cz*xy;
		
		scaleFactor = focalLength/(focalLength + yz);
		x = zx*scaleFactor;
		y = zy*scaleFactor;
		z = yz;

		TransformedPointsArray[i] = make2DPoint(x, y, -z, scaleFactor);
	}
	return TransformedPointsArray;
};
//-------------------------------------
pointsArray = [
	make3DPoint(-50,-50,-50),
	make3DPoint(50,-50,-50),
	make3DPoint(50,-50,50),
	make3DPoint(-50,-50,50),
	make3DPoint(-50,50,-50),
	make3DPoint(50,50,-50),
	make3DPoint(50,50,50),
	make3DPoint(-50,50,50)
];
//----------------------------
for (i=0; i < pointsArray.length; i++){
	attachedObj = theScene.attachMovie("redballoon", "redballoon"+i, i);
}
//------------------------------
cubeAxisRotations = make3DPoint(0,0,0);
//--------------------------------
rotateCube = function(){
	cubeAxisRotations.y -= this._xmouse/3000;
	cubeAxisRotations.x += this._ymouse/3000;
	var screenPoints = Transform3DPointsTo2DPoints(pointsArray, cubeAxisRotations);
	for (i=0; i < pointsArray.length; i++){
		currBalloon = this["balloon"+i];
		currBalloon._x = screenPoints[i].x;
		currBalloon._y = screenPoints[i].y;
		currBalloon._xscale = currBalloon._yscale = 100 * screenPoints[i].scaleRatio;
		currBalloon.swapDepths(screenPoints[i].depth);
	}
};
theScene.onEnterFrame = rotateCube;