Hi,
I’m trying to create a rotations of a drawings created by List of Vectors. The Drawing that I’m trying to make is an Elipse and I wanted for it to rotate like this /
to this |
.
For now I’m using this code
//r => radius
for(int i = 0; i < segments; i++)
{
var heading = (step * i) * OnlineMapsUtils.Deg2Rad;
var px = (r * Math.Cos(heading)) + tx1;
var py = (r / 2 * Math.Sin(heading)) + ty1;
var ang = angle * OnlineMapsUtils.Deg2Rad;
var cos = Math.Cos(ang);
var sin = Math.Sin(ang);
px = (px * cos) - (py * sin);
py = (px * sin) + (py * cos);
map.projection.TileToCoordinates(px, py, 20, out lng, out lat);
points.Add(new Vector2((float)lng, (float)lat));
}
This code uses an Asset called OnlineMaps in which you can just mind the map.projection
part as it is only a code to make the coordinates from the tileset into real life one
But, using this code, I don’t know why but the coordinates doesn’t rotate. It does however make the position out of bounds.