 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote:
: And hope that the ray hits the mesh? If it doesn't, shoot another ray? What
: if after shooting 100 rays you still haven't hit the mesh? :)
Fool me!
Of course it's easy to shoot a ray that will certainly hit at least one
triangle (and thus at least two triangles since it's a closed mesh)!
Just choose a triangle and make the ray go through its center.
This also solves the problem of isolated mesh parts. After fixing one part,
just check if there are non-fixed triangles and choose one of them and repeat
the same thing described above.
--
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
where is the utility? i looked in the newsgroups and looked for your
website but didn't find one.
Warp wrote:
>
> ryan constantine <rco### [at] yahoo com> wrote:
> : what are the benefits of smooth triangles?
>
> This should be obvious when you see a mesh rendered with regular triangles
> and then with smooth triangles.
> For examples, see:
> http://iki.fi/warp/PovUtils/smooth.html
>
> : do they have explicit
> : normals in the file?
>
> Yes.
>
> Although the mesh smoother calculates single normals for each vertex,
> it's perfectly possible that in a pov mesh there could be different normals
> for the same vertex, one for each triangle (actually there is, but they
> are often the same vector, but they could be different).
>
> --
> 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 30 Aug 2000 18:51:43 -0400, Warp wrote:
>Ron Parker <ron### [at] povray org> wrote:
>: For a closed mesh surface, fire a ray from outside the bounding box and check
>: the normal.
>
> And hope that the ray hits the mesh? If it doesn't, shoot another ray? What
>if after shooting 100 rays you still haven't hit the mesh? :)
No, fire it at a known triangle. Determine the normal by which triangle it hit
first, rather than the triangle you fired it at.
> I was thinking about how to make sure that the mesh really is closed. I think
>that it's enough to check that every triangle has three and only three
>adjacent triangles.
That's what I'd think.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 30 Aug 2000 19:05:10 -0400, Warp wrote:
> Oh, and there's another problem with the ray-shooting technique:
>
> Even if your ray hits the mesh, if the mesh consists of separate parts
>(all closed) you'll only be able to fix the part that the ray hit. The other
>parts will still have the problem.
That part is guaranteed to be the outside shell of that part of the mesh.
Take that part (all of its triangles) out of the list of triangles, then
fire another ray. The first surface it hits is either inside the fixed set
of surfaces or not. If it's inside, its normal should face away from the ray.
If it's outside, the normal should face toward the ray. Continue removing
these subsurfaces from the list of triangles until none are left. Now
they're all corrected.
I've done this algorithm in 2D. It does work.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
nevermind found it. i also found that my mesh is already in smooth
triangle form. now about texturing...
ryan constantine wrote:
>
> where is the utility? i looked in the newsgroups and looked for your
> website but didn't find one.
>
> Warp wrote:
> >
> > ryan constantine <rco### [at] yahoo com> wrote:
> > : what are the benefits of smooth triangles?
> >
> > This should be obvious when you see a mesh rendered with regular triangles
> > and then with smooth triangles.
> > For examples, see:
> > http://iki.fi/warp/PovUtils/smooth.html
> >
> > : do they have explicit
> > : normals in the file?
> >
> > Yes.
> >
> > Although the mesh smoother calculates single normals for each vertex,
> > it's perfectly possible that in a pov mesh there could be different normals
> > for the same vertex, one for each triangle (actually there is, but they
> > are often the same vector, but they could be different).
> >
> > --
> > 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |