Vector coordinates help

Lee_Hesketh
Lee_Hesketh Member, Developers Posts: 148 ✭✭✭
Hello all. My mortise and tenon script is still a WIP and I have ran into yet another problem. I am using the corner of a rectangle as the reference point for an skRectangle() function. Suppose the coordinates of the corner are (-50, 50)*mm in the x-z plane, and I want to put a point that is 10mm across and 5mm down, I have a problem. This is because if I just say (-50,50) + (10,-5) using this corner, the point ends up here:

However, if I use the other corner with coordinates (50,50)*mm, I can't just do (50,50) + (10,-5) because the point ends up here:

How could I set this up such that it doesn't matter which corner is selected without using lots of if statements?
Thanks
Lee Hesketh
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!

Best Answer

Answers