hi!
i simply can’t solve a problem, and can’t find anything good about it on google either…
i have a MovieClip, and it moves on stage with random x,y,z, and i want to attach another MC to it (kind of alt-cloud), but i don’t want to put it in 3D space, because it gets all blurry (ther’s a text in that MC), so i want to track 2D stage position of the MC that’s in 3D space… what i need is something like an offset calculated, dependant on the z position… what i come up with is calculating the scaleRatio and using it to do the offset, but it doesn’t do the trick (the offset is to large), the code below:
function calc2DCoords(pointIn3D:Object):Point{
var focalLength:int = 300;
var pointIn2D = new Point();
var scaleRatio = focalLength/(focalLength + pointIn3D.z);
pointIn2D.x = pointIn3D.x * scaleRatio;
pointIn2D.y = pointIn3D.y * scaleRatio;
return pointIn2D;
};
please help