Better autonormals

Share your ZGE-development tips and techniques here!

Moderator: Moderators

Post Reply
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Better autonormals

Post by kattle87 »

better autonormals... avoid it with hi-poly meshes. (More than 1000 vertexes) :P
Attachments
better autonormals.zgeproj
(2.29 KiB) Downloaded 516 times
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
VilleK
Site Admin
Posts: 2275
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Haha, that's a nice trick of copying all vertexes to an array for processing and then copying it back. Looks great. Maybe we should even exchange the built-in autonormal algorithm to yours?
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

First of all, I tryied this with the scripting features just to test if it worked. Now I think we should do something like avoid confronting EVERY vertex (which is O(n^2) and becomes complex for say 2-3000 vertexes) so I will look at the main code to see what we can get.

BTW: the idea of using an average of the normals in a vertex is quite "simple" and was proposed also by Kjell some time ago... I will look at the sources tomorrow or the day after. I promise :)
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
VilleK
Site Admin
Posts: 2275
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Ok, now I understand how it works. I also understand why you hit the ten-million instructions guard :) . Yes it's always a trade-off between speed and correctness. We certainly want to avoid O(n^2) complexity. If you come up with anything in the main code, let us know.
Post Reply