How do I find the instantaneous Vector3 lookVector at a given point t where 0>=t>1? I want to make a panoramic by making a scene using the vectors perpendicular to it.
I believe you can do some limit calculus estimation to find the perpendicular vector at time t.
Just input t plus a small value to find the position ahead of time t +0.1 then you can get a vector from two points from point t to point t +0.1 seconds.
Edit: Or I believe a better way is to differentiate the formula to by t to get the perpendicular slope.
The above solution would probably work fine in most applications. Here’s a way that you can calculate it exactly, if that’s what you need:
What you’re looking for is called the tangent of the curve at a given point, and is equivalent to the derivative of the curve at the given point. Wikipedia has formulas for the 1st and 2nd derivative of a cubic beziér curves, which is the special case of beziér curves that the Roblox wiki talks about:
Assuming that you’re working off this function for computing the beziér curve:
function cubicBezier(t, p0, p1, p2, p3)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local l3 = lerp(p2, p3, t)
local a = lerp(l1, l2, t)
local b = lerp(l2, l3, t)
local cubic = lerp(a, b, t)
return cubic
end
You can compute the tangent of the beziér curve by adapting the above formula: