Thread: R: Re: [Dev-C++] polygon soup
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <mi...@al...> - 2004-07-01 10:10:21
|
Hi Per,
I am 'that' Michele that makes some strange questions, unsubscribed for
a while...
happy to meet again your attention.
The polygons are triangles stored in a structure like this:
struct element{
float vertex[3][3];
float normal[3][3];
element *newElement;
}
in a 'record'.
element *one,*start=NULL;
//If a new triangle comes
one=new element;
one->vertex[0][0]=...
...
one->element=start;
start=one;
There aren't holes in the geometry (for now), but I would like to smooth it.
thanks.
Da: pw...@ia...
Data: Jul 1, 2004 11:43:20 AM
A: mi...@al...
Cc: dev...@li...
Ogg: Re: [Dev-C++] polygon soup
Might you give us a bit more information about the polygons - are they a
ordered in a two-dimensional matrix? May they overlap in z order? Are
there holes in the geometry?
|
|
From: Andres R. <lo...@ho...> - 2004-07-01 10:42:07
|
Hi!
>
> struct element{
> float vertex[3][3];
> float normal[3][3];
> element *newElement;
> }
>
> in a 'record'.
>
> element *one,*start=NULL;
>
> //If a new triangle comes
> one=new element;
>
> one->vertex[0][0]=...
> ...
> one->element=start;
> start=one;
This is the case of what I call 'One Way Linked List'.
For example:
http://www.faqs.org/docs/thinkjava/chap14.htm
this is a Java, but you might get the idea
http://www.fortunecity.com/skyscraper/false/780/linklist.html
C++ linked list tutorial
http://richardbowles.tripod.com/cpp/linklist/linklist.htm
and another one
> There aren't holes in the geometry (for now), but I would like to smooth it.
Geometry itself does not affect that linked list, because every
element is one entity (independent of others).
Rendering it depends on the engine you use.
HTH, A.
|
|
From: Per W. <pw...@ia...> - 2004-07-01 10:57:26
|
In this case you store the triangles in a long list. However, you don't
mention if there are any geometric properties of the loaded trianges. Are
they completely random (in x, in y, in z, in size, in normal directions
etc), or is there some important geometric properties to make use of
when processing them?
What do you expect to get out of your work? A two-dimensional "blanket" of
z-values or are you trying to create the 3-dimensional (convex or
non-conves) of the triangles?
If the triangles are completely random and with not too large size
differences, an easy solution is to just perform ray-tracing - or actually
ray casting - without any perspective transform for the rays, i.e. all
rays parallel. A simple BSP tree - or maybe an octree - would allow quick
intersection tests by reducing number of triangles to test.
Scanline conversion might also be used to process the triangles. However
both scanline conversion and ray-tracing will generate a blanket of fixed
spacing - of course possible to postprocess later.
It is also possible to use space subdivision - such as BSP trees to
directly emit polygonals representing the blanket. If the original "soup"
of triangles have random z coordinates (or maybe "r" coordinates if this
is a problem in polar space) this will require a number of vertical
(radial) polygons to handle steps in the z (r) dimension.
/Per W
On Thu, 1 Jul 2004 mi...@al... wrote:
> Hi Per,
> I am 'that' Michele that makes some strange questions, unsubscribed for
> a while...
> happy to meet again your attention.
>
> The polygons are triangles stored in a structure like this:
>
>
>
> struct element{
> float vertex[3][3];
> float normal[3][3];
> element *newElement;
> }
>
> in a 'record'.
>
> element *one,*start=NULL;
>
> //If a new triangle comes
> one=new element;
>
> one->vertex[0][0]=...
> ...
> one->element=start;
> start=one;
>
> There aren't holes in the geometry (for now), but I would like to smooth it.
> thanks.
>
>
>
>
> Da: pw...@ia...
> Data: Jul 1, 2004 11:43:20 AM
> A: mi...@al...
> Cc: dev...@li...
> Ogg: Re: [Dev-C++] polygon soup
>
> Might you give us a bit more information about the polygons - are they a
> ordered in a two-dimensional matrix? May they overlap in z order? Are
> there holes in the geometry?
>
>
>
>
|
|
From: Per W. <pw...@ia...> - 2004-07-01 11:10:00
|
Ah, I missed the info about no holes and request for smoothing.
Do you just want to hide the facettes of the flat triangles, or were you
interested in either replacing the triangles with fewer primitives, or
with primitives of higher orders - such as nurbs or bezier patches?
Anyway, a linked list is not a very good way of storing a triangle
geometry without holes in it. It is very, very expensive to locate
triangles sharing vertices or edges. You might look around for winged edge
structures, i.e. where you store edges and for each triangle keep
track of it's tree edges, and for each edge keep a pointer to
the two triangles sharing the edge. Then it is trivial to walk from
triangle to triangle when evaluating bumpines etc. Also, you will then
only need to store coordinate and normal information once for each
vertice, instead of the list which store everything six times on
average. My storing a vertex only once, it is also simpler to perform
"easing" of the geometry by filtering the vertices to reduce
high-frequency noise from a sampling process.
/Per W
On Thu, 1 Jul 2004 mi...@al... wrote:
> Hi Per,
> I am 'that' Michele that makes some strange questions, unsubscribed for
> a while...
> happy to meet again your attention.
>
> The polygons are triangles stored in a structure like this:
>
>
>
> struct element{
> float vertex[3][3];
> float normal[3][3];
> element *newElement;
> }
>
> in a 'record'.
>
> element *one,*start=NULL;
>
> //If a new triangle comes
> one=new element;
>
> one->vertex[0][0]=...
> ...
> one->element=start;
> start=one;
>
> There aren't holes in the geometry (for now), but I would like to smooth it.
> thanks.
>
>
>
>
> Da: pw...@ia...
> Data: Jul 1, 2004 11:43:20 AM
> A: mi...@al...
> Cc: dev...@li...
> Ogg: Re: [Dev-C++] polygon soup
>
> Might you give us a bit more information about the polygons - are they a
> ordered in a two-dimensional matrix? May they overlap in z order? Are
> there holes in the geometry?
>
>
>
>
|