|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chris Huff <chr### [at] maccom> wrote:
: Just an idea, but could it help to test multiple times with different
: vectors to avoid these errors? Just use the result that the majority of
: vectors produce.
There's one problem here.
Suppose that you shoot two rays instead of one, to be sure. Then one
ray says that you are outside, the other one says that you are inside.
What do you do?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
From: Nicolas Calimet
Subject: Re: csg error with megapov's solid mesh?
Date: 29 Aug 2000 12:17:31
Message: <39ABE49D.E1A2E206@free.fr>
|
|
|
| |
| |
|
|
> There's one problem here.
> Suppose that you shoot two rays instead of one, to be sure. Then one
> ray says that you are outside, the other one says that you are inside.
> What do you do?
Check at least three rays in the x/y/z directions ?
*** Nicolas Calimet
*** http://pov4grasp.free.fr
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <39abe095@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> There's one problem here.
> Suppose that you shoot two rays instead of one, to be sure. Then one
> ray says that you are outside, the other one says that you are inside.
> What do you do?
Easy: shoot a third one.
--
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
<><
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have done this kind of triangle mesh "fixing" myself (in my triangle
mesh smoother program).
The idea is quite simple:
1. Take the first triangle and mark it as 'handled'.
2. Search all the triangles which are adjacent to this one and are
not marked as 'handled'. An adjacent triangle is one that shares two
vertices with this one.
3. Check if the adjacent triangle is ordered correctly. That is, if the
shared vertices are listed in inverse order in the adjacent triangle than
in the current triangle, then it's ok. If they are listed in the same
order, then you have to swap the other triangle.
4. Now mark these adjacent triangles as 'handled' and for each one of them
make recursively steps 2, 3 and 4 until no more triangles are found.
5. After that, search for some unhandled triangle. If the mesh consisted of
one contiguous surface, you'll not find any, but you have to do this
because the mesh may consist of several separate parts. If you find
an unhandled triangle, make all steps 1, 2, 3, 4 and 5 for it.
This works pretty well, but it's very slow, specially with big meshes.
The slowest step is the second one (ie. the searching). There's probably some
way of speeding it up using some tree structure or hash table.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chris Huff <chr### [at] maccom> wrote:
: Easy: shoot a third one.
Could it be possible that two of them are wrong and one is right?-)
All right, all right, I know that it's more probable that two are right
and one wrong and the other way around is a very rare case.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 29 Aug 2000 12:24:28 -0400, Warp wrote:
> I have done this kind of triangle mesh "fixing" myself (in my triangle
>mesh smoother program).
> The idea is quite simple:
>
> 1. Take the first triangle and mark it as 'handled'.
>
> 2. Search all the triangles which are adjacent to this one and are
> not marked as 'handled'. An adjacent triangle is one that shares two
> vertices with this one.
>
> 3. Check if the adjacent triangle is ordered correctly. That is, if the
> shared vertices are listed in inverse order in the adjacent triangle than
> in the current triangle, then it's ok. If they are listed in the same
> order, then you have to swap the other triangle.
>
> 4. Now mark these adjacent triangles as 'handled' and for each one of them
> make recursively steps 2, 3 and 4 until no more triangles are found.
>
> 5. After that, search for some unhandled triangle. If the mesh consisted of
> one contiguous surface, you'll not find any, but you have to do this
> because the mesh may consist of several separate parts. If you find
> an unhandled triangle, make all steps 1, 2, 3, 4 and 5 for it.
>
>
> This works pretty well, but it's very slow, specially with big meshes.
>The slowest step is the second one (ie. the searching). There's probably some
>way of speeding it up using some tree structure or hash table.
You missed a step. After you finish all the surfaces, you have to make sure
they're correctly oriented. Even if it's just one surface, you have to
make sure you haven't inverted it.
The searching would be faster if each edge were a structure containing
pointers to the two triangles that share it. Building such a structure
would be O(n log n).
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
what kind of meshes does this work on? can it convert from regular to
mesh2?
Warp wrote:
>
> I have done this kind of triangle mesh "fixing" myself (in my triangle
> mesh smoother program).
> The idea is quite simple:
>
> 1. Take the first triangle and mark it as 'handled'.
>
> 2. Search all the triangles which are adjacent to this one and are
> not marked as 'handled'. An adjacent triangle is one that shares two
> vertices with this one.
>
> 3. Check if the adjacent triangle is ordered correctly. That is, if the
> shared vertices are listed in inverse order in the adjacent triangle than
> in the current triangle, then it's ok. If they are listed in the same
> order, then you have to swap the other triangle.
>
> 4. Now mark these adjacent triangles as 'handled' and for each one of them
> make recursively steps 2, 3 and 4 until no more triangles are found.
>
> 5. After that, search for some unhandled triangle. If the mesh consisted of
> one contiguous surface, you'll not find any, but you have to do this
> because the mesh may consist of several separate parts. If you find
> an unhandled triangle, make all steps 1, 2, 3, 4 and 5 for it.
>
> This works pretty well, but it's very slow, specially with big meshes.
> The slowest step is the second one (ie. the searching). There's probably some
> way of speeding it up using some tree structure or hash table.
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
From: Nathan Kopp
Subject: Re: csg error with megapov's solid mesh?
Date: 29 Aug 2000 18:52:22
Message: <39ac3ea6@news.povray.org>
|
|
|
| |
| |
|
|
"ryan constantine" <rco### [at] yahoocom> wrote...
> > >, or do i need to convert to mesh2? if so how? or can i use
> > > uv mapping? how?
> >
> > Yes.
>
> which? all?
Yes, you can use uv mapping. You do not have to convert to mesh2.
> i read it, but i'm a little foggy. as a regular mesh, there are no face
> entries right? unless i'm blind i only saw instructions for texturing
> mesh2 objects.
Are you looking in the MegaPov documentation or the official POV 3.1
documentation? I was referring to the 3.1 docs. From that documentation,
in the "Mesh Object" section, you'll read:
------ begin quote -------
Now let's begin. We will create a simple box with differently colored sides.
We create an empty file called meshdemo.pov and add the following lines.
camera {
location <20, 20, -50>
look_at <0, 5, 0>
}
light_source { <50, 50, -50> color rgb<1, 1, 1> }
#declare Red = texture {
pigment { color rgb<0.8, 0.2, 0.2> }
finish { ambient 0.2 diffuse 0.5 }
}
#declare Green = texture {
pigment { color rgb<0.2, 0.8, 0.2> }
finish { ambient 0.2 diffuse 0.5 }
}
#declare Blue = texture {
pigment { color rgb<0.2, 0.2, 0.8> }
finish { ambient 0.2 diffuse 0.5 }
}
We must declare all textures we want to use inside the mesh before the mesh
is created. Textures cannot be specified inside the mesh due to the poor
memory performance that would result.
Now we add the mesh object. Three sides of the box will use individual
textures while the other will use the global mesh texture.
mesh {
/* top side */
triangle { <-10, 10, -10>, <10, 10, -10>, <10, 10, 10>
texture { Red }
}
triangle { <-10, 10, -10>, <-10, 10, 10>, <10, 10, 10>
texture { Red }
}
/* bottom side */
triangle { <-10, -10, -10>, <10, -10, -10>, <10, -10, 10> }
triangle { <-10, -10, -10>, <-10, -10, 10>, <10, -10, 10> }
/* left side */
triangle { <-10, -10, -10>, <-10, -10, 10>, <-10, 10, 10> }
triangle { <-10, -10, -10>, <-10, 10, -10>, <-10, 10, 10> }
/* right side */
triangle { <10, -10, -10>, <10, -10, 10>, <10, 10, 10>
texture { Green }
}
triangle { <10, -10, -10>, <10, 10, -10>, <10, 10, 10>
texture { Green }
}
/* front side */
triangle { <-10, -10, -10>, <10, -10, -10>, <-10, 10, -10>
texture { Blue }
}
triangle { <-10, 10, -10>, <10, 10, -10>, <10, -10, -10>
texture { Blue }
}
/* back side */
triangle { <-10, -10, 10>, <10, -10, 10>, <-10, 10, 10> }
triangle { <-10, 10, 10>, <10, 10, 10>, <10, -10, 10> }
texture {
pigment { color rgb<0.9, 0.9, 0.9> }
finish { ambient 0.2 diffuse 0.7 }
}
}
--------- end quote --------
> is there a uv mapping tut' out there?
I don't think there currently is. Sorry.
-Nathan
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
thanks, i was thinking that uv mapping was megapov only so i was only
looking there. no i just have to figure out which tringle is which and
what i want to texture it with.
Nathan Kopp wrote:
>
> "ryan constantine" <rco### [at] yahoocom> wrote...
> > > >, or do i need to convert to mesh2? if so how? or can i use
> > > > uv mapping? how?
> > >
> > > Yes.
> >
> > which? all?
>
> Yes, you can use uv mapping. You do not have to convert to mesh2.
>
> > i read it, but i'm a little foggy. as a regular mesh, there are no face
> > entries right? unless i'm blind i only saw instructions for texturing
> > mesh2 objects.
>
> Are you looking in the MegaPov documentation or the official POV 3.1
> documentation? I was referring to the 3.1 docs. From that documentation,
> in the "Mesh Object" section, you'll read:
>
> ------ begin quote -------
> Now let's begin. We will create a simple box with differently colored sides.
> We create an empty file called meshdemo.pov and add the following lines.
>
> camera {
> location <20, 20, -50>
> look_at <0, 5, 0>
> }
> light_source { <50, 50, -50> color rgb<1, 1, 1> }
> #declare Red = texture {
> pigment { color rgb<0.8, 0.2, 0.2> }
> finish { ambient 0.2 diffuse 0.5 }
> }
> #declare Green = texture {
> pigment { color rgb<0.2, 0.8, 0.2> }
> finish { ambient 0.2 diffuse 0.5 }
> }
> #declare Blue = texture {
> pigment { color rgb<0.2, 0.2, 0.8> }
> finish { ambient 0.2 diffuse 0.5 }
> }
>
> We must declare all textures we want to use inside the mesh before the mesh
> is created. Textures cannot be specified inside the mesh due to the poor
> memory performance that would result.
>
> Now we add the mesh object. Three sides of the box will use individual
> textures while the other will use the global mesh texture.
>
> mesh {
> /* top side */
> triangle { <-10, 10, -10>, <10, 10, -10>, <10, 10, 10>
> texture { Red }
> }
> triangle { <-10, 10, -10>, <-10, 10, 10>, <10, 10, 10>
> texture { Red }
> }
> /* bottom side */
> triangle { <-10, -10, -10>, <10, -10, -10>, <10, -10, 10> }
> triangle { <-10, -10, -10>, <-10, -10, 10>, <10, -10, 10> }
> /* left side */
> triangle { <-10, -10, -10>, <-10, -10, 10>, <-10, 10, 10> }
> triangle { <-10, -10, -10>, <-10, 10, -10>, <-10, 10, 10> }
> /* right side */
> triangle { <10, -10, -10>, <10, -10, 10>, <10, 10, 10>
> texture { Green }
> }
> triangle { <10, -10, -10>, <10, 10, -10>, <10, 10, 10>
> texture { Green }
> }
> /* front side */
> triangle { <-10, -10, -10>, <10, -10, -10>, <-10, 10, -10>
> texture { Blue }
> }
> triangle { <-10, 10, -10>, <10, 10, -10>, <10, -10, -10>
> texture { Blue }
> }
> /* back side */
> triangle { <-10, -10, 10>, <10, -10, 10>, <-10, 10, 10> }
> triangle { <-10, 10, 10>, <10, 10, 10>, <10, -10, 10> }
> texture {
> pigment { color rgb<0.9, 0.9, 0.9> }
> finish { ambient 0.2 diffuse 0.7 }
> }
> }
> --------- end quote --------
>
> > is there a uv mapping tut' out there?
>
> I don't think there currently is. Sorry.
>
> -Nathan
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ryan constantine wrote:
>
> thanks, i was thinking that uv mapping was megapov only so i was only
> looking there. no i just have to figure out which tringle is which and
> what i want to texture it with.
>
uv mapping is megapov only. For a tutorial on uv mapping, you can look
here: http://www.mediaport.net/Artichaud/Tran/sources/tutuve.htm
--
* Doctor Jekyll had something * mailto:ber### [at] inamecom
* to Hyde... * http://www.enst.fr/~jberger
*******************************
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|