Calculating vertex normals

Started by
12 comments, last by Fabbo 12 years, 11 months ago
Hiyas, slightly off-center question here, no code involved!

I have an exam coming up for which I am woefully unprepared. And I just can't figure out how to get this done. Could anyone fill me in? As concisely as possible? Many thanks for any help

vnormal.PNG
Advertisement
You have to calculate the normals of the 4 triangles that use that vertex (so you can ignore vertex <-10,15,10> and <1,18,16>), then average those 4 normals.
interesting, if those large quads/triangles are part of that sphere then you should use the fact that its a sphere to your advantage. Are those numbers vertex positions? Can't quite work out if its possible to do with the information you've been given.

I guess your safer calculating the face vertices and smootinhg. Will these be weighted though?

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

If it's a sphere....then just normalise the vertex position - job done.

If it's a sphere....then just normalise the vertex position - job done.


If its centered at the origin yeah, but is it?

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.


You have to calculate the normals of the 4 triangles that use that vertex (so you can ignore vertex <-10,15,10> and <1,18,16>), then average those 4 normals.


okay so the equation I have for finding the triangle normals is

(we have three vertices v1, v2, v3)
u1 = (v2 - v1) / || (v2 -v1) || - where || A || is the magnitude of A
u2 = (v3 - v1) / || (v3 - v1) ||

normal = u2 x u1 / || u2 x u1|| - where x denotes cross product

so we get 4 triangle normals n1, n2, n3, n4

Our vertex normal vn is:

vn = ( 1/4 * (n1 + n2 + n3 + n4) ) / || ( 1/4 * (n1 + n2 + n3 + n4) ) ||

Is this correct? Seems like something of a pain in the ass.
If it's a sphere....then just normalise the vertex position - job done.[/quote]

If its centered at the origin yeah, but is it?[/quote]

That does not make a big difference. Let's say you know the origin. Then you get the right normal by normalizing (Vertexposition-Origin).
E=mc^2 + 2d6

If it's a sphere....then just normalise the vertex position - job done.


If its centered at the origin yeah, but is it?[/quote]

That does not make a big difference. Let's say you know the origin. Then you get the right normal by normalizing (Vertexposition-Origin).
[/quote]
There is nothing in the assignment that directly indicates where the origin is.

[quote name='thefries' timestamp='1305416000' post='4810881']
You have to calculate the normals of the 4 triangles that use that vertex (so you can ignore vertex <-10,15,10> and <1,18,16>), then average those 4 normals.


okay so the equation I have for finding the triangle normals is

(we have three vertices v1, v2, v3)
u1 = (v2 - v1) / || (v2 -v1) || - where || A || is the magnitude of A
u2 = (v3 - v1) / || (v3 - v1) ||

normal = u2 x u1 / || u2 x u1|| - where x denotes cross product

so we get 4 triangle normals n1, n2, n3, n4

Our vertex normal vn is:

vn = ( 1/4 * (n1 + n2 + n3 + n4) ) / || ( 1/4 * (n1 + n2 + n3 + n4) ) ||

Is this correct? Seems like something of a pain in the ass.
[/quote]


Can anyone verify the correctness of this?

I *think* you can do it a bit simpler....

u1 = (v2 - v1)
u2 = (v3 - v1)

normal = u2 x u1

Then just normalise "normal"....

normal /= || normal ||

I think that's correct...

This topic is closed to new replies.

Advertisement