Re: Points/Vectors/Rectangles
Posted: Mon Mar 01, 2010 10:08 am
Just wanted to add that a 3d-vector can also be defined in cylinderic and spheric coordinates (I am not a native speaker, so forgive me if I am not using standard terms).
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
I had a little chat with qpHalcy0n, and I have decided to return to this topic.qpHalcy0n wrote:Lord no. The differences between points and vectors are HUGE.
As I've said, they're represented the same way. However the operations performed between then *ARE NOT* the same. It's important to abstract them because of what they mean, especially in terms of graphics.
Again, Points have location. No direction.
Vectors have direction, but no absolute location. (This has different meaning given context).
A vector MUST contain a dx and a dy otherwise there *IS* no definition for magnitude. It's a case where on the outside it looks the same, but on the inside they do wildly different things and represent completely different ideas.
Point - Point = Vector
Vector - Vector = Vector
Vector - Point = Point
Point + Point = Vector
Vector + Vector = Vector
Vector + Point = Point
Vectors can be normalized, projected as a LINE, they have different homogenization characteristics....the list goes on and on and on.
I think what's happening here is that you've merely scratched the very first atoms of the surface of the mathematics behind computer graphics :] Since you don't understand the implications yet you're going to try to make a hasty decision in terms of a design choice. Rest assured, there is a difference and you WILL see it later. It becomes HUGE later. If you mix them up you're in for some big fat headaches.