New answers tagged html5
You don't need matrices at all. Just take the rotation angle in radians, get its cosine and sine, multiply them by the distance you want between the two objects and add the x and y values of the fixed object: rotatingObject.x = Math.cos(rotationAngle) * distance + fixedObject.x rotatingObject.y = Math.sin(rotationAngle) * distance + fixedObject.y
Edit: Nevermind the matrices, look at what user6245072's answer instead. It's more simple. I was thinking too hard :p That, would be matrices. There's a lot of websites that explains it for you. This is a matrix i took from an util class i made my self a while back: [Math.cos(ang), -Math.sin(ang), 0.0f, (-X * Math.cos(ang) + Y * Math.sin(ang) + X)] ...
Math.acos() solution I have something very close to what I am looking for but I beleive there is an even better way of doing this. I started by plotting a graph using Desmos. I was actually looking for a less steep curve at the beginning but I think this is close enough to what I'm looking for. In this representation the Y axis is the velocity and the X ...
From my own experience, I've found that using the sum of components (x + y + z) is a very good measure for sorting entities in an isometric scene. It doesn't perfectly represent the distance your image is away from the camera, but it does give an indication which image is further or closer to the camera, and that's what ultimately matters. Moreover, sums are ...
Top 50 recent answers are included