[requested] Foam - how I did it...

Started by
13 comments, last by Bouga 19 years, 5 months ago
Hehe, didnt notice that - I allways tend to write it the way you pronounce it and I usually dont check my code for english grammar mistakes :) Well, thats just one of those things I'll have to fix before I send it in as an article...
"A screen buffer is worth a thousand char's" - me
Advertisement
I've had a hard time with spelling mistakes like that when doing MODing, i kept writing "Foward" instead of "Forward" and of course the variable or function was reported as non-existing :p

After a few (read 50) unnecessary compiler errors, i've learned my lesson ;)
Imperio59 - C++ Programmer

I dont understand the part about "relaxing" the vertices, could you maybe spell it out a bit clearer for me?

ie

what exactly is a neighbor? is it a neighboring vertex or neighboring tri/quad?

how would you simply find these neighbors? I would think that it would just be a simple case of the preceeding tri and following tri in your list - but what about other islands popping up and introducing gaps...

(same ap)

i think i understand how to do the basic smoothing, but i guess i am just unsure about how to find the neighbors...
Well, a vertex is considered a neighbour of another vertex if there is a triangle edge connecting them. In my app I have a vertex list and a triangle list. Each triangle has 3 vertex indexes, and if two triangles have vertexes at the same position they have the same vertex index. So to find the neighbours you just loop through all vertexes and do: loop through all triangles and do: if one of the triangle vertex indexes == current vertex index, then add the other two vertexes as neighbours to that vertex. As you can see I also keep seperate lists for over/under water neighbours for convinience when performing the "relaxation" (I call it that way becouse there is a modifier in 3DMax that has a similar effect and is called "Relax Mesh" or something like that).
"A screen buffer is worth a thousand char's" - me

This topic is closed to new replies.

Advertisement