Stack Exchange network consists of 178 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I'm confused about the two functions, do they return the same thing?
length() takes in one vector and returns the magnitude of that.
distance() takes in two and returns the distance between those. Basically, distance(a, b) is the same as length(a - b)
length(a - b)
Distance is the length between two vectors.
Length is the magnitude of one vector.
Required, but never shown