0
$\begingroup$

In Lua pseudocode, I believe the wikipedia article here is saying that the formula is used in the following way:

-- assume a and b are unit vectors
local a = Vector3.new( ... );
local b = Vector3.new( ... );

function slerp( a, b, t )
    local omega = Math.acos( a:Dot( b ) );
    local sinOmega = Math.sin( omega );
    return ( Math.sin( ( 1 - t ) * omega ) / sinOmega ) * a + ( Math.sin( omega * t ) / sinOmega ) * b 
end

slerp( a, b, .5 ); -- returns a vector that represents a point on the sphere interpolated halfway between a and b.
$\endgroup$
2
  • $\begingroup$ You will get far more views if you mention a Slerp function that is actually defined. Unfortunately not everyone her is a computer programmer so you might have to post this on another SE as well $\endgroup$ Commented May 19, 2016 at 23:16
  • $\begingroup$ Try codereview.stackexchange.com $\endgroup$ Commented May 19, 2016 at 23:17

0

You must log in to answer this question.