POV-Ray : Newsgroups : povray.newusers : Counting Intersections of a ray? Server Time
31 Oct 2024 18:57:02 EDT (-0400)
  Counting Intersections of a ray? (Message 1 to 2 of 2)  
From: Horst
Subject: Counting Intersections of a ray?
Date: 7 Oct 2014 07:45:01
Message: <web.5433d1b8a08cf9471762a41b0@news.povray.org>
Hi all!

I have got a problem and I hope that povray could be a solution. Perhaps you
have got a suggestion for me.

Having a bunch of polygons and a ray I would like to find out how often the ray
intersects a polygon. I guess I can find out how to set up a camera to get some
rays, but i have no idea how to count the intersections... Is it possible to
define a material, so that the resulting pixel colour reflects the number of
intersections?


Post a reply to this message

From: clipka
Subject: Re: Counting Intersections of a ray?
Date: 7 Oct 2014 08:36:20
Message: <5433de44$1@news.povray.org>
Am 07.10.2014 13:42, schrieb Horst:
> Hi all!
>
> I have got a problem and I hope that povray could be a solution. Perhaps you
> have got a suggestion for me.
>
> Having a bunch of polygons and a ray I would like to find out how often the ray
> intersects a polygon. I guess I can find out how to set up a camera to get some
> rays, but i have no idea how to count the intersections... Is it possible to
> define a material, so that the resulting pixel colour reflects the number of
> intersections?

You can use a semi-transparent surface, e.g. "colour rgbt <0,0,0,0.8>", 
and a contrasting background, e.g. "colour rgb <1,1,1>"; then, the 
resulting colour will depend on how often the ray enters or exits the 
object.

Use the "File_Gamma=1.0" ini-file setting to more easily evaluate the 
result; the pixel value will then follow an exponential law:

100%   = no intersection
  80%   = 1 intersection
  64%   = 2 intersections
  51.2% = 3 intersections

etc.


Post a reply to this message

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