Question

Here is part of my formula to draw a hex. What is the equation to figure out what angle the camera would be at? If hex_squish is 1 then the hexes are perfect hexes and the camera would be at 90 degrees. If hex_squish is 0 then the camera would be at 0 degrees. How do I figure out what angle the camera would be at if the hex_Squish is 0.7 or 0.6?

var hex_squish = 0.7
var hex_size = 60

for (var i = 0; i < 6; i++) {
    var angle = 2 * Math.PI / 6 * i

    var x = hex_size * Math.cos(angle)
    var y = hex_size * Math.sin(angle) * hex_squish
}
Was it helpful?

Solution

I guess you're looking for Mathf.Asin( hex_squish ), the inverse of Mathf.sin(x), which is 1 at 90 degrees and 0 at 0 degrees. ( You're describing a rotation ).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top