Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2006-11-20 05:53:30

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

tesselating a mesh

while messing with my soft body physics, i wanted to adapt it to a 3d terrain enviroment in c++, the first problem is ofcourse, generating a geodesic dome to replace the circle that i used in Flash. After failing to find anything worth while, most methods simple envolved splitting triangles of an octahedron without keeping a unique list of vertices.

So i decided to build my own algorithm that takes a mesh defined by a set of vertices, and triangles using references to the list, and it tesselates it to a given degree, returning a new tesselated mesh, with a new set of UNIQUE vertices, and triangles.

the hardest part was ofcourse having it keep the vertices unique, i figured a way out on paper, and implemented it in flash.

basicly, before the algorithm is run, it runs through all triangles and creates a list of unique edges (defined by references to two points) and replaces the traingles of vertices, with triangles of edges

it then splits all edges in two, and for each triangle it orders the edges in order, flipping them if necessary to get an ordered list of vertices, it then creates 3 new edges per triangle, and replaces the triangle with another 4, it then repeats this however many times, and then it runs through all the triangles now defined by edges, and converts them back to vertices.

http://delta.110mb.com/fs.html

(note, dont go above 5x tesselation, itll run very slow, and maybe crash)


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#2 2006-11-22 16:26:49

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: tesselating a mesh

Luca, I must say I am very jealous, I have a lot of interest in the type of thing your doing, such as creating 3d engines and shadding programs, and so on. Coolest thing in the world! But I'm not quite skilled enough to keep up.

Just curious, what type of educational background do you have so i know what not to miss?


A logarithm is just a misspelled algorithm.

Offline

#3 2006-11-22 19:41:04

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: tesselating a mesh

im 15 and still in highschool tongue

i know everything that i know in terms of programming, 3d math, algorithmics and the lot from experimentation, practice, and the internet everynow and again. started learning actionscript in flash 3 years ago, learnt the language without any tutorials or anything, learnt it through experimentation and flashes actionscript documentation so i learnt what the functions and stuff were supposed to do, looking at the little samples it gives.

i started learning c++ about a year ago, but havnt daddled in it extensively yet like i have flash.

im also doing my a-level maths early (mostly due to a higher interest and gain of knowledge in maths through programming) , im in the last year of compulsory highschool in england, and i started doing my a-level maths towards the second half of last year, completing core1 and core2 in the summer, doing core3 and core4, and stats1 in janurary, and mechanics 1 with all of my GCSEs in the summer


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#4 2006-11-29 10:53:37

mikau
Member
Registered: 2005-08-22
Posts: 1,504

Re: tesselating a mesh

Impressive!

Man I need to get a book on 3d linear algebra...


A logarithm is just a misspelled algorithm.

Offline

Board footer

Powered by FluxBB