Creating a regular mesh
Can anyone show me how to create a regular mesh to fit into a particular geometry?
Currently I have the geometry of the following structure in the 3d world:
As you can see above, the mesh is irregular and manipulation would be difficult. I would like to create a regular mesh to fit the above geometry so that it will be easier to manipulate.
It looks like that your mesh is "flat" enough such that it can be represented as a height map. If this is true, the conversion should not be too difficult.
Say, the x- and y-axis in 3D space corresponds to the window x- and y-axis of your screenshot (otherwise, rotate the 3D geometry accordingly).
1) Project all nodes p_n of the irregular mesh to the x-y-plane by simply leaving out the z-coordinate ("push the book flat"). You get 2D-points q_n.
2) Find the outer perimeter of the 2D-points q_n. That's the outer boundary of the book in your screenie.
3) Find a regular mesh with nodes g_n for the 2D region that is contained in the border found in 2). To do this, just put a rectangular grid on top of the border and correct the outmost nodes to coincide with the boundary.
4) Find the z-coordinate of the regular grid from 3) by projecting the 2D grid points g_n back to the book. This requires computing intersections of lines (g_n+t*(0,0,1)) and triangles (of the irregular mesh), but should be no problem. Note: If the book is really a heightmap, you'll always get exactly one intersection.
5) Ready!
hth
Lutz
Say, the x- and y-axis in 3D space corresponds to the window x- and y-axis of your screenshot (otherwise, rotate the 3D geometry accordingly).
1) Project all nodes p_n of the irregular mesh to the x-y-plane by simply leaving out the z-coordinate ("push the book flat"). You get 2D-points q_n.
2) Find the outer perimeter of the 2D-points q_n. That's the outer boundary of the book in your screenie.
3) Find a regular mesh with nodes g_n for the 2D region that is contained in the border found in 2). To do this, just put a rectangular grid on top of the border and correct the outmost nodes to coincide with the boundary.
4) Find the z-coordinate of the regular grid from 3) by projecting the 2D grid points g_n back to the book. This requires computing intersections of lines (g_n+t*(0,0,1)) and triangles (of the irregular mesh), but should be no problem. Note: If the book is really a heightmap, you'll always get exactly one intersection.
5) Ready!
hth
Lutz
Thanks for the reply. Is there any link which elaborate more on of your above method. I am pretty new to this so will need more details in order to implement it.
Btw, the structure is not really exactly flat. Here is a cross-sectional view of it.
Btw, the structure is not really exactly flat. Here is a cross-sectional view of it.
It looks like you're trying to make pages in a book. Could try for a cloth simulation; that way it would behave like actual paper.
Did you compute the triangulation on the fly? It looks great!
Cheers,
- llvllatrix
Did you compute the triangulation on the fly? It looks great!
Cheers,
- llvllatrix
I thought I remembered those pictures. You also started a thread three and a half months ago on a related, but not identical topic. I'll just post a link here since some of the things mentioned in the other thread may help people better understand what you're trying to do or what you've tried. Linky.
Enigma
Enigma
Wouln't it be easier to make a new mesh rather that trying to fix the old one.
if you want a procedural one you could try using a nurb mesh,it would work just fine for this.
if you want a procedural one you could try using a nurb mesh,it would work just fine for this.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
Quote: Original post by llvllatrix
It looks like you're trying to make pages in a book. Could try for a cloth simulation; that way it would behave like actual paper.
Did you compute the triangulation on the fly? It looks great!
Cheers,
- llvllatrix
No, it was not made on the fly. The information was obtained from the obj file generated by the 3D scanner. :)
Quote: Original post by Enigma
I thought I remembered those pictures. You also started a thread three and a half months ago on a related, but not identical topic. I'll just post a link here since some of the things mentioned in the other thread may help people better understand what you're trying to do or what you've tried. Linky.
Enigma
Thanks Enigma. Yes, I posted this pics sometime back. All this while, I have been working on this irregular mesh directly. Now I am considering turning this irregular mesh to a regular one before working it in hope of getting a more stable simulation.
[Edited by - Mystery on December 2, 2004 10:08:30 PM]
Quote: Original post by Mystery
Thanks for the reply. Is there any link which elaborate more on of your above method. I am pretty new to this so will need more details in order to implement it.
Btw, the structure is not really exactly flat. Here is a cross-sectional view of it.
If you rotate the sheet slightly to the right, you will be able to get a heightmap. Even without rotation, it might work. It doesn't need to be exactly flat, it is just required that there are no overhangs.
I don't have implementation notes on this (since I just thought it up), but the biggest part will be to find the outer perimeter and to move the regular-grid-nodes to that perimeter. But since you it's a preprocessing step (I guess), it doesn't need to be fast. Maybe you can even do that by hand if you only need to do it once.
Lutz
Quote: Original post by Mystery
Thanks Enigma. Yes, I posted this pics sometime back. All this while, I have been working on this irregular mesh directly. Now I am considering turning this irregular mesh to a regular one before working it in hope of getting a more stable simulation.
IS this something you have to do? i mean, use the 3dscanned version.
If i where you i would load that mesh into maya or lightwave and then while using that as a reference model, i would create a new mesh that is more regular than the first one.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement