Talk:Src/idlib/math/vectors.h (source file)

From modwiki

Jump to: navigation, search

Hrm, I'm not too good at explanations, but here's a description for the SLerp function that Vec3s have. SLerp (Spherical Linear Interpolation) interpolates vectors over a curve drawn between them. The curve fits on the surface of a unit sphere, thus, the function only takes two unit vectors. This is generally used in reference to rotations: you have two unit vectors that represent different orientations, and you want to go from the first one to the second one smoothly. You SLerp between them, and the output is a unit vector representing an orientation, the actual facing dependant on the t value. SLerp should always be the path of shortest rotation between two points, and thus, it acts rather oddly if you try to rotate exactly 180 degrees, such as if you try to go from < 1, 0, 0 > to < -1, 0, 0 >. If you want to avoid that, it's possible to split the rotation into two rotations of 90 degrees, where you arbitrarily determine which path to use.

Anyways, I didn't know where to put this info (vector tutorials or here), so hopefully someone can take it and condense it into a useful form. I'll be happy to answer any questions on it, since I suspect I'm not being too coherant.

--Tenko 04:35, 30 October 2005 (W. Europe Standard Time)

Personal tools
Main
id Tech 5