|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
From the DOCs:
"The smooth triangles use a formula called Phong normal interpolation to
calculate the surface normal for any point on the triangle based on
normal vectors which you define for the three corners."
I'm curious as to what the "Phong normal interpolation" formula is.
Actually I guess my real question is:
In a smooth_triangle you have a 'surface normal' vector. What is
considered
the NORMAL normal for each vertex? I really have no idea how to use this
part.
I want to be able to average any given number of smooth_triangles who
have
a vertex at the same vector location, .ie (please excuse my ascii art)
____
\ /\ I want to average a,b and c's normals together
for
\ / \ a smooth transition but I'm not sure what would be
a \/c___\ the correct starting point.
b \ /
\ /
\/
--
...coffee?...yes please! extra sugar,extra cream...Thank you.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 09 Jun 1999 01:07:27 -0400, Phil Clute <pcl### [at] tiacnet>
wrote:
>I'm curious as to what the "Phong normal interpolation" formula is.
>
>Actually I guess my real question is:
>In a smooth_triangle you have a 'surface normal' vector. What is
>considered
>the NORMAL normal for each vertex? I really have no idea how to use this
>part.
>I want to be able to average any given number of smooth_triangles who
>have
>a vertex at the same vector location,
Gouraud shading of triangles, a cheap and common method, interpolates
the color intensity at a point in the triangle from those at the
corners. Phong shading, which is more work but looks better, just
linearly interpolates the surface normal between the corners which is
then used to calculate the shading at the point in the usual way.
This allows the appearance of the triangle to be more accurate. In
particular, highlights can appear in the interior of the triangle with
Phong shading. Note that this has nothing to do with Phong vs.
specular highlights. That is something else entirely.
As to the other question, do it this way:
B C
| /
| /
A____D
| \
| \
... E
vnormalize(vcross(b-a, c-a)+vcross(c-a,d-a)+vcross(d-a,e-a)...)
Make sure that you are consistent in the sense (clockwise or
counterclockwise) in which you go around the vertex.
Jerry Anning
clem "at" dhol "dot" com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 09 Jun 1999 09:18:26 GMT, Jerry Anning wrote:
>vnormalize(vcross(b-a, c-a)+vcross(c-a,d-a)+vcross(d-a,e-a)...)
>Make sure that you are consistent in the sense (clockwise or
>counterclockwise) in which you go around the vertex.
You sure about that? I think you might get some unintentional
weighting in your average, making the resultant vector lean a bit
towards the longer edges. I would have thought you'd have to
normalize all the cross products first, then normalize the result.
Of course, I haven't really thought about it, so I could be wrong.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 9 Jun 1999 09:09:38 -0400, par### [at] fwicom (Ron Parker) wrote:
>On Wed, 09 Jun 1999 09:18:26 GMT, Jerry Anning wrote:
>>vnormalize(vcross(b-a, c-a)+vcross(c-a,d-a)+vcross(d-a,e-a)...)
>>Make sure that you are consistent in the sense (clockwise or
>>counterclockwise) in which you go around the vertex.
>
>You sure about that? I think you might get some unintentional
>weighting in your average, making the resultant vector lean a bit
>towards the longer edges. I would have thought you'd have to
>normalize all the cross products first, then normalize the result.
>
>Of course, I haven't really thought about it, so I could be wrong.
Good catch, Ron. You should indeed change vcross(b-a, c-a) etc. to
vnormalize(vcross(b-a,c-a)) if you want a robust result. I tend to
forget about that because I usually do it to meshes where local edge
lengths are fairly constant.
Jerry Anning
clem "at" dhol "dot" com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thank you both
--
...coffee?...yes please! extra sugar,extra cream...Thank you.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|