POV-Ray : Newsgroups : povray.advanced-users : VRand_On_Object? Server Time
25 Nov 2024 21:21:26 EST (-0500)
  VRand_On_Object? (Message 1 to 5 of 5)  
From: RAY
Subject: VRand_On_Object?
Date: 13 Feb 2002 18:16:05
Message: <3c6af3b5$1@news.povray.org>
I need a VRand_On_Object for an .inc project, but the best I've
come up with so far is random traces at the object from in the bounding box
(using
VRand_In_Box an the object) is there a better way?


__________________
 Yours truly,

                  RAY


Post a reply to this message

From: Christopher James Huff
Subject: Re: VRand_On_Object?
Date: 13 Feb 2002 19:27:57
Message: <chrishuff-5710E0.19274513022002@netplex.aussie.org>
In article <3c6af3b5$1@news.povray.org>, "RAY" <PCH### [at] yahoocom> 
wrote:

> I need a VRand_On_Object for an .inc project, but the best I've
> come up with so far is random traces at the object from in the bounding box
> (using VRand_In_Box an the object) is there a better way?

There really isn't any way to do it in POV-Script, you would have to 
implement separate macros for each object. Shooting random rays at the 
object should work for simple objects when you aren't too concerned 
about an even distribution, though.
Are you sure you need it for an arbitrary object? If you could narrow it 
down, it wouldn't be as big of a problem. For example, spheres, boxes, 
cylinders, cones, and triangles would be easy.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Slime
Subject: Re: VRand_On_Object?
Date: 14 Feb 2002 10:28:22
Message: <3c6bd796$1@news.povray.org>
If you can define the object with a function (like an isosurface), you could
use VRand_In_Box to sample random points in the object's bounding box until
you find a point where the function returns a value very close to zero
(closer to zero is closer to the surface, but if you accept numbers farther
from zero it will work faster).

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From: Leroy Whetstone
Subject: Re: VRand_On_Object?
Date: 15 Feb 2002 00:25:55
Message: <3C6CB731.7AE2BC11@joplin.com>
In what way better, faster,more points on the object (less misses), hits more
evenly distributed?
After I read your post I did a little test. I had five different ways to shoot
traces at an object.

Here's a quick list of the results:

in Box with ray shot toward the center ___ 100% hit  : placement Good
in Box with ray shot side ways _________  80% hits : placement Fair
on Cylinder with ray shot side ways______ 70% hits  : placement Fair
on Sphere with ray shot toward the center  100% hits : placement Good
on Sphere with ray shot side ways _______ 20% hits : placement Fair

The boxes: used (VRand_In_Box) for the random number.
The spheres used(Vrand_on_Sphere)for the random number.
I made the random number generator for the cylinder

Hope this helps. If not I had fun playing with it.

--
Have Fun!


Post a reply to this message

From: RAY
Subject: Re: VRand_On_Object?
Date: 15 Feb 2002 16:23:45
Message: <3c6d7c61$1@news.povray.org>
> In what way better, faster,more points on the object (less misses), hits
more
> evenly distributed?
preferably fast and evenly distrubuted
> After I read your post I did a little test. I had five different ways to
shoot
> traces at an object.

Is there a way without calling trace?
This works, anyway
> Here's a quick list of the results:
> in Box with ray shot toward the center ___ 100% hit  : placement Good
> in Box with ray shot side ways _________  80% hits : placement Fair
> on Cylinder with ray shot side ways______ 70% hits  : placement Fair
> on Sphere with ray shot toward the center  100% hits : placement Good
> on Sphere with ray shot side ways _______ 20% hits : placement Fair

I guess on a box is pretty acurate, but if you used a mesh, it could have a
alcove type thing, or a pit, where that wouldn't work, but then again that
isn't needed in my macro to randomly place hairs ( it's for a hair
simulation using sphere sweeps, I need the macro to find my first point)
Thanks

> The boxes: used (VRand_In_Box) for the random number.
> The spheres used(Vrand_on_Sphere)for the random number.
> I made the random number generator for the cylinder
Thanks a bunch, this really helped


Post a reply to this message

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