how to interpolate between two normal vectors
i have normal vectors defined at all the vertices of a cube. i need to find a normal vector at a point on an edge of the cube ie between two vertices which already have defined normal vectors. i have to ''interpolate'' between these two normal vectors to generate a normal vector at my point on the edge.
As shown below, i want to calculate the normal vector at P which can be anywhere on the edge of a cube. N1, N2... are the normal vectors defined at the cube''s vertices.
N1----P-----N2
| |
| |
| |
| |
N3----------N4
i have shown only one(relevant)face of the cube here.
someone please show me how to interpolate...
I may be way off here - but from what I remember from my high schol math you can only compute the normal to a surface not to a point...
but be that as it may - since you have the vectors what you are looking for is ( unless I missunderstod your question ) called the cross product.
/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
but be that as it may - since you have the vectors what you are looking for is ( unless I missunderstod your question ) called the cross product.
/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
/Please excuse my bad spelling - My native language is binary not english|Visit meTake my advice - I don''t use it...
Just use a standard interpolation:
N(t) = (1-t)N1 + tN2
Where t is the distance of your P point along the edge.
Then renormalize N(t).
That isn''t very accurate (and fails in several cases), but it works ok most of the time.
However, it is dubious why you''d want to do this, usually a cube doesn''t have smooth shaded corners
N(t) = (1-t)N1 + tN2
Where t is the distance of your P point along the edge.
Then renormalize N(t).
That isn''t very accurate (and fails in several cases), but it works ok most of the time.
However, it is dubious why you''d want to do this, usually a cube doesn''t have smooth shaded corners

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement