Calculating tangent vectors and normal to the bezier curve.

2.1k Views Asked by At

I am preparing for the graphics midterm and one of the practice problems dealing with parametric surfaces is as follows: A bilinear patch x(u,v) is given by four control points $$p_0 = (2, 0, 1) \\ p_1 = (4, 2, 1) \\ p_2 = (2, 2, 0) \\ p_3 = (7, 4, 5)$$ and $$x(0, 0) = p_0, \\ x(1, 0) = p_1 \\ x(0, 1) = p_2 \\ x(1, 1) = p_3.$$ a.) Evaluate the patch at (u,v) = (0.2, 0.5) which I did using $$x(u, v) = learp(v, learp(u, p_0, p_1), learp(v, p_2, p_3)) $$ and got$$x(u, v) = (2.7, 1.4, 1)$$ where learp() stands for linear interpolation.$$$$ b.) Compute tangent vectors and the normal at this point. And this is the part that is giving me so much trouble. The problem that I am running into is that in order to do this I need the equation for the curves running across the patch but I am not sure how to get them. If I had them then I can apply partial derivatives at that point and take the cross product to get the normal. Is there a way to find these equations?

1

There are 1 best solutions below

3
On BEST ANSWER

First of all, the linear interpolation function is usually called "lerp", not "learp", so that's what I'll call it.

You have the patch equation, which you wrote in terms of the "lerp" function. Now just use the definition of lerp: $$ \text{lerp}(t, \mathbf{P}, \mathbf{Q}) = (1-t)\mathbf{P} + t\mathbf{Q} $$ This allows you to write out your patch equation in a more algebraic form; it becomes: $$ \mathbf{X}(u,v) = (1-v)\left[(1-u)\mathbf{P}_0 + u\mathbf{P}_1\right] + v\left[(1-u)\mathbf{P}_2 + u\mathbf{P}_3\right] $$ Multiplying out gives $$ \mathbf{X}(u,v) = (1-u)(1-v)\mathbf{P}_0 + u(1-v)\mathbf{P}_1 + (1-u)v\mathbf{P}_2 + uv\mathbf{P}_3 $$ Now just take partial derivatives with respect to $u$ and $v$ to get tangent vectors, and form the cross product to get the surface normal.