![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
Senior Member
Join Date: Jan 2003
Location: Switzerland
Posts: 1,333
|
Code:
By the way, as we don't normalize the normals on the summing part, bigger faces turn normals on their vertices more towards them.. this is accurate if you do it on paper (in 2d as best).. there are suggestions to divide them by the squared length before summing to smoothen more towards the round parts.. while looking nice, too, and being based on some good idea actually, it is just slower.. thats why i never use anything else but that.. be warned that, if you have different vertices with same position, you get a hard edge there..
___________________________________________
davepermen.net -Loving a Person is having the wish to see this Person happy, no matter what that means to yourself. -No matter what it means to myself.... |
|
|
|
|
#2 |
|
Member
Join Date: Jul 2003
Posts: 97
|
This is the method I use to took me some time to figoure it out (mostly because my teacher said it wouldn't work
).Just make sure that calc_triangle_normal returns a unit normal (is that the correct terminology?) i.e. a normal with length 1.0 |
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2003
Location: Switzerland
Posts: 1,333
|
as i said above, that is NOT needed. and gives mathematically more correct result (good if you animate the mesh..)..
well.. i just thought about it again.. i'm not sure now anymore.. i'll paper it out today, i have time..
___________________________________________
davepermen.net -Loving a Person is having the wish to see this Person happy, no matter what that means to yourself. -No matter what it means to myself.... |
|
|
|
|
#4 | |
|
Member
Join Date: Jul 2003
Posts: 97
|
Quote:
The other method most people use is to first calculate normalized plane normals then add these and divide by the number of normals, normalizing the plane normals before summation here yields the exact same result with less book-keeping so I would call it more accurate. But that's just my oppinion, could be wron... it's known to happen... ![]() |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jan 2003
Location: Switzerland
Posts: 1,333
|
as i said, i'll go over the normalizing per face again to see how it affects visual impression..
___________________________________________
davepermen.net -Loving a Person is having the wish to see this Person happy, no matter what that means to yourself. -No matter what it means to myself.... |
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2003
Posts: 868
|
You're right dave. One shoudn't!!! normalize triangle normals when calculating vertex ones. The results are really more correct that way.
|
|
|
|
|
#7 |
|
Member
Join Date: Sep 2004
Location: Copenhagen, Denmark
Posts: 99
|
Does calc_triangle_normal() return a unit vector?
If it does, I fail to see how bigger faces turn normals on their vertices more towards them. If not, then how is it implemented (probably (b-a)x(c-a) right)? |
|
|
|
|
#8 |
|
Senior Member
Join Date: Jan 2003
Location: Switzerland
Posts: 1,333
|
no normalization, nope. just b-a x c-a, yes. (or the other way around? no this way around, what ever way around
)
___________________________________________
davepermen.net -Loving a Person is having the wish to see this Person happy, no matter what that means to yourself. -No matter what it means to myself.... |
|
|
|
|
#9 |
|
Senior Member
Join Date: Jan 2003
Posts: 868
|
Actually when you calculating cross product the order does matter...
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Jan 2003
Location: Switzerland
Posts: 1,333
|
yeah, but in the end, we can just flip all the normals if they are to the wrong side. the rest doesn't mather, it doesn't change anything else of the calculation. thats what i ment.
___________________________________________
davepermen.net -Loving a Person is having the wish to see this Person happy, no matter what that means to yourself. -No matter what it means to myself.... |
|
|
|
|
#11 |
|
Member
Join Date: Sep 2004
Location: Copenhagen, Denmark
Posts: 99
|
So really the bending-towards-large-faces-feature is controlled by the two edges (randomly) selected for the normal calculation (b-a and c-a or whatever).
This could give some random results if for example a triangle face has two very long edges and one very short edge. |
|
|
|
|
#12 | |
|
Member
Join Date: Sep 2004
Location: Copenhagen, Denmark
Posts: 99
|
Quote:
Yeah ok, you're right of course! I've been unaware of that vector cross product property until now. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|