Hello all. Messing around with some isometric stuff. I've found out how to convert an exact point on a 2d grid to an isometric grid with the following function:
code:
function convertToIso(pointSent:Point) {
var returnPoint:Point=new Point((pointSent.x- pointSent.y),(pointSent.x+pointSent.y )/2);
return (returnPoint);
}
Which works great. Now however I'd like to be able to draw a circle or oval on a 2d grid and match that up with the isometric. Here is as far as I've got...
Where grid1DrawArea is the 2d grid and grid2 is the isometric grid as seen in the image below.Code:var clickPoint:Point=new Point(grid1.mouseX,grid1.mouseY); var clickPoint2=convertToIso(clickPoint); grid1DrawArea.graphics.drawEllipse(clickPoint.x,clickPoint.y,30,30); grid2.graphics.drawEllipse(clickPoint2.x,clickPoint2.y,30,30);
Obviously this method does not work but can hopefully give you an idea of what I'm trying to accomplish. Another thing not helping is how the drawEllipse method works and a function to draw an ellipse starting from the center would help too.
Thanks for any help!