YES! You sir or ma'am are a genius and I love you to the power of 100. Works perfectly!
Should be easy find Z on a ramp with x and y (SOLVED)
Started by Mikekan13, Feb 20 2012 11:34 PM
22 replies to this topic
Ad:
#23 Members - Reputation: 110
Posted 02 March 2012 - 05:59 PM
As you seemed to be thinking, you can indeed change the ramp direction by switching around where A, B, C, and D are. Note that the vectors e1 and e2 that point along the sides of the tile are defined to point from D to A and D to C; e1 is the 'up the ramp' vector, so moving from D to A should move you up the ramp, and moving from D to C should move you along the base or the top of the ramp without changing your height.
All you need to do, then, is look at the ramp orientation, choose D and C to be at low corners of the ramp, and choose A to be at the high corner that shares an edge with D. An easy way to do that is to take the corners as I defined them and rotate the point labels through as many quarter-turns as you rotate the ramp itself. For the first new picture you posted, where you increase in height as you move down and to the left, the ramp is rotated by two quarter-turns counterclockwise; that would make the left point A, the bottom B, the right C, and the top D.
All you need to do, then, is look at the ramp orientation, choose D and C to be at low corners of the ramp, and choose A to be at the high corner that shares an edge with D. An easy way to do that is to take the corners as I defined them and rotate the point labels through as many quarter-turns as you rotate the ramp itself. For the first new picture you posted, where you increase in height as you move down and to the left, the ramp is rotated by two quarter-turns counterclockwise; that would make the left point A, the bottom B, the right C, and the top D.


















