I haven’t blogged much recently because I haven’t made much progress. I came to a realization that would make the movement easier, but has alas, created another problem that although seems easily solvable hasn’t yielded any results as of yet. First I will try to do my best to explain the situation and the solution. The movement of a zero turn lawn mower when one handle is pushed is to rotate the tire on the same side by the opposite tire. Essentially, if the left arm is pushed forward, the left tire will move forward while the right tire is fixed in place. This will cause the mower to move in a circular motion. Now onto the realization. Try to picture that there is a radius of a circle from tire to tire with the center of the circle fixed on the right tire. The left tire is the point of movement around the circle. The direction of forward motion is the same as the tangent of the circle at the point the tire lies on. Choose another point on the circle and draw a radius from the center to that point. From here, take note of the angle between the tire axis line and the new radius through the chosen point. The angle of separation on these are the same as the angle formed by the intersection of the two tangents. (the second tangent being the one through the newly chosen point). I will post a screenshot titled “Angle Congruence” to demonstrate what this really means. Should the reader not believe this to be true, they can prove it themselves by extending the radius of the new point to intersect the tangent line of the first point. This can then be used to create a common angle between two triangles who also share a right angle. The remaining angle must therefore be the same. I may also include this drawing along with the angle congruence.
Whew, now lets talk about the problem. This has created a situation where I can know a starting point on the circle, the center, the radius, and the angle by which we are moving from the starting point. Essentially, I have created an isosceles triangle where I know two points on the triangle, the top angle (top defined to not be either of the base angles), and the length of the two congruent sides is the radius of the circle. I now should be able to find the coordinates of the other point, which I can using some trig from the axes, however I also need to consider that this lawn mower can be in any orientation within world space. That means that the two points may not align properly and thus I need a “for in general” solution. This means that I may need to look into un-transforming the lawnmower, finding the new point, and then apply that transformation to the new point. I unfortunately don’t have any intuition as to how that would be done as of yet. I am aware that I can apply linear transformations, but I don’t actually have a full understanding of how the matrix functions work within Unreal. My current implementations involve using FRotators, which is very useful for moving the object around, but I don’t know how to apply that transformation to a point. Alternative solutions could be to calculate the line that point lies on and find where it intersects the edge of the circle. The unfortunate problem is that I only have the center point for that line and don’t know the other point.
This problem is what is currently causing a large hang up in the process. If this doesn’t work, I do have my old back up approach which is rotating the object then moving it forward at a rational speed to simulate proper effects. With spring break coming up, I plan to put much more time into this project and maybe start working on other things. I am thinking about whether or not I want to do A.I first or if I want to implement a timer and start doing distance. I am leaning towards A.I because that is slightly more impressive and also I think it will be more “fun”.
The lawn will just have to get cut another week. By the time actually get to cutting the lawn, I will be cutting a jungle!