FlashPlayer10: Converting 3D->2D

As has been discussed in a bunch of forums: when you change a DisplayObject into 3D mode, it becomes a bit blurry. So, for my “playing-card flipping” project, i thought that I’d do the 3D animation flipping part and then switch back to 2D mode when the card is flat again.

So far, the animation part is done. I’m using TweenMax for the tweening, [URL=“http://blog.soulwire.co.uk/flash/actionscript-3/two-sided-planes-in-flash-player-10/#more-273”]Soulwire’s awesome class for the card’s front/back. All that stuff is golden. My problem is this: when my card flips to the front, I want to switch back to 2D mode, so that the text/image is crisp. I’m trying multiple ways to accomplish this:

[LIST]
[*]1) Tried setting myCard.transform.matrix3D = null. When I do this, the card resets its position/scale/rotation. I don’t know how to keep those values intact while converting out of 3D. These seems like the “right” way to do it… if I ever discover how that is done. :sad2:

[*]2) I’ve tried swapping the 3D card with a 2D version. I got the XY coordinates of the 3D card and placed the 2D one there. Then, the problem is determining the scaling of the 3D card. How do you do that? I thought it was supposed to be: scale = focalLength/(focalLength + zDepth), but that produces incorrect results. SEE CODE:
[/LIST]

var pp:PerspectiveProjection;


public function NewMain(){
	//init PerspectiveProjection
	pp = new PerspectiveProjection();
	pp.fieldOfView=35;
	this.transform.perspectiveProjection = pp;
	
	//Add the 3D card
	var card3D = new crackerJackFront();  //CrackerJackFront a standard Sprite
	addChild(card3D);
	
	//Position the 3D Card
	var myStage:Stage = card3D.stage;
	card3D.x = stage.stageWidth/2;
	card3D.y = stage.stageHeight/2;
	card3D.z = 1000;
	
	//Add the 2D Card
	var regularCard = new crackerJackFront();
	addChild(regularCard);
	
	//Position the 2D card in the same place as the 3D card
	var vec:Vector3D = new Vector3D(0, 0, 0);
	var my2DCoordinates = card3D.local3DToGlobal(vec);  //This gives me the XY values of the 3D card
	regularCard.x = my2DCoordinates.x;
	regularCard.y = my2DCoordinates.y;
	
	//Scale to the same amount as the 3D card, given the formula: focalLength/(focalLength + zDepth)
	var scale2D:Number = pp.focalLength/(pp.focalLength + card3D.z);
	regularCard.scaleX = regularCard.scaleY = scale2D;
}

Any guidance would be greatly appreciated. I’m having a heck of a time figuring out this 3D stuff…