Rotation Matrix seems to squash quadrilateral
Posted: Sat Aug 29, 2020 2:28 am
Hello fellow coders.
I have been rotating shapes fine using `love.graphics.rotate()`
I have been working on a program to explore efficient and humane ways to develop areas of land. I know that this is not as exciting as the video games you guys whip up. In the process, I came up with an algorithm to select a line. it works fine until I rotate the shape using the rotate function. So I decided to rotate the actual points of the shape.
So I used a rotation matrix. The first rotation matrix I used is
However, I switched it to
to accommodate the different coordinate system. Both matrixes exhibit the same squishing behavior.
I have attached a simple .love file with my simple matrix. I am using love 0.8.0 (Rubber Piggy) as that is the latest package from the official OpenBSD repositories. I am aware that a lot has changed since then, but the method is so basic, I expect the same results on your machine.
Thanks in advance for showing me what I am overlooking.
I have been rotating shapes fine using `love.graphics.rotate()`
I have been working on a program to explore efficient and humane ways to develop areas of land. I know that this is not as exciting as the video games you guys whip up. In the process, I came up with an algorithm to select a line. it works fine until I rotate the shape using the rotate function. So I decided to rotate the actual points of the shape.
So I used a rotation matrix. The first rotation matrix I used is
Code: Select all
cos(θ) -sin(θ)
sin(θ) cos(θ)
Code: Select all
cos(θ) sin(θ)
-sin(θ) cos(θ)
I have attached a simple .love file with my simple matrix. I am using love 0.8.0 (Rubber Piggy) as that is the latest package from the official OpenBSD repositories. I am aware that a lot has changed since then, but the method is so basic, I expect the same results on your machine.
Thanks in advance for showing me what I am overlooking.