POV-Ray : Newsgroups : povray.general : Megapov intersection points : Re: Megapov intersection points Server Time
23 Apr 2024 14:03:18 EDT (-0400)
  Re: Megapov intersection points  
From: muyu
Date: 10 Feb 2019 14:55:00
Message: <web.5c6080c4912c710e873735650@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "muyu" <lsy### [at] gmailcom> wrote:
> > I would like extract the coordinates (X, Y, Z) of all the intersection points in
> > the image.
>
> First of all, I probably asked a very similar question years ago - and
> essentially POV-Ray is a raytracer - a piece of software to create pictures.
> It's not a mathematical analysis program, though since the images are
> {primarily} created via code, you can perform whatever math is necessary to do
> what you need.
>
> Second, since 3 of the spheres are completely contained in the box, and one is
> halfway in, you have an infinite number of intersection points between the
> spheres and the box.
>
> "ALL of the points!"
>
> Third, since you're only using simple primitives, you can use algebra to
> calculate the set of points satisfying the equations of a sphere and the region
> enclosed by the box.
>
> Fourth, if you want a list of points for a general case, you're probably going
> to have to define how fine a granulation you want, and then probably use trace()
> to scan the region across the seam and interpolate where it switches from one
> object to the other.
>
>
> Perhaps you can post an image in the binary section showing what you want and
> explaining a bit more clearly and in greater detail.
> Then we might be able to suggest a viable solution.
>
> > // ----------------------------------------
> >          union {
> >   sphere {0,1}
> >   sphere {<-2,0,-2>,1}
> >   sphere {< 5,0, 5>,1}
> >   sphere {<10,0,10>,1}
> >   box {-10,10}}
>
>
> I used this to see what the arrangement of objects was:
>
> #version 3.8
>
> #include "colors.inc"
> #declare Camera_Location = <10, 0,-50>;
> #declare Camera_Lookat   = <10, 0, 0>;
>
> light_source {< 0, 0,  -100> color rgb<1,1,1>}
>
>
> camera {                  perspective
>   location Camera_Location
>   look_at    Camera_Lookat
>   direction z
> }
>
> // ----------------------------------------
> union {
>   sphere {0,1 pigment {Red}}
>   sphere {<-2,0,-2>,1 pigment {Yellow}}
>   sphere {< 5,0, 5>,1 pigment {Green}}
>   sphere {<10,0,10>,1 pigment {Blue}}
>   box {-10,10 pigment {rgbt <1, 1, 1, 0.9>}}
> }

Thanks. Probably I didn't explain myself clearly enough. I would like to get the
coordinates of the each pixel in the rendered image, corresponding to the
shortest interaction point (the average over certain resolution). The code I put
is just a rush example. Sorry for the confusing.

Sure the coordinate information is calculated in the tracing process. I found
the function in Megapov to export this information (as far as I understood).
However, I did not manage to use it sucessfully. Could you pleae show me how to
use it or else the macro trace() in Povray can do similar job? It would be great
if you can provide a demo code. Thanks again.


PS: I cannot always login this website successfully (from France). Probably the
manager could help to check that. Merci.

Best
Shouyang


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.