POV-Ray : Newsgroups : povray.general : Math help Server Time
6 Nov 2024 14:25:35 EST (-0500)
  Math help (Message 1 to 7 of 7)  
From: Timothy R  Cook
Subject: Math help
Date: 12 Aug 2002 14:05:12
Message: <3D57F8D6.3000604@scifi-fantasy.com>
#declare Seed=seed(10000);
#declare N=1;
#while(N<=600)
#declare Theta=rand(Seed)*360;
#declare Z=(N/600)+1.2;
#declare R=(rand(Seed)*0.25)+((Z-1.2)*(Z-1.2)*2);
#declare X=R*cos(Theta);
#declare Y=R*sin(Theta);
<X, Y, Z> 0.02
#declare N=N+1;
#end

Ok, with this I get the general external shape I
want, but the internal points aren't as mixed up
as I'd like...how do I compute a random point in
the shape such that all parts of the sphere_sweep
stay within the shape?  As it stands, if I change
Z to a random number I get the jumbled-up mess I
want, but it leaves parts of the sphere_sweep on
the outside of the shape.  Solution?
-- 
Tim Cook
http://empyrean.scifi-fantasy.com
mirror: http://personal.lig.bellsouth.net/lig/z/9/z993126

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Timothy R  Cook
Subject: Re: Math help
Date: 13 Aug 2002 00:11:54
Message: <3D588708.1030104@scifi-fantasy.com>
I am told that I need 3d integrals to figure out the
points to fill a given space with random lines with-
out going outside that space...looking on Google, I
see a few sites that seem relevant, but are beyond
my understanding.  Anyone care to give me a quick
rundown on what exactly is involved here?

-- 
Tim Cook
http://empyrean.scifi-fantasy.com
mirror: http://personal.lig.bellsouth.net/lig/z/9/z993126

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Sir Charles W  Shults III
Subject: Re: Math help
Date: 13 Aug 2002 08:16:25
Message: <3d58f899@news.povray.org>
Really.  Well, why not simply generate random number pairs in 3space?
Assume a box enclosing your given space and then generate a point within that
volume and a vector associated with the point.  This will give you a pretty
uniform scattering of said random lines.

Cheers!

Chip Shults
My robotics, space and CGI web page - http://home.cfl.rr.com/aichip


Post a reply to this message

From: ingo
Subject: Re: Math help
Date: 13 Aug 2002 10:35:33
Message: <Xns9269A9780A1DBseed7@povray.org>
in news:3D5### [at] scifi-fantasycom Timothy R. Cook wrote:

> I am told that I need 3d integrals to figure out the
> points to fill a given space with random lines with-
> out going outside that space...

VRand_In_Obj(Object, Stream) in rand.inc can be of help here.

Ingo


Post a reply to this message

From: ABX
Subject: Re: Math help
Date: 13 Aug 2002 10:40:58
Message: <bf6ilucifl7kv31dt4dc0t0gd65jig7bq8@4ax.com>
On 13 Aug 2002 10:35:33 -0400, ingo <ing### [at] homenl> wrote:
> > I am told that I need 3d integrals to figure out the
> > points to fill a given space with random lines with-
> > out going outside that space...
>
> VRand_In_Obj(Object, Stream) in rand.inc can be of help here.

It can help but can't solve.
As I understand he wants sphere_sweep in object, not only control points.

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: Math help
Date: 13 Aug 2002 10:51:17
Message: <chrishuff-D317FE.09393713082002@netplex.aussie.org>
In article <Xns### [at] povrayorg>, ingo <ing### [at] homenl> 
wrote:

> > I am told that I need 3d integrals to figure out the
> > points to fill a given space with random lines with-
> > out going outside that space...
> 
> VRand_In_Obj(Object, Stream) in rand.inc can be of help here.

For random points, it won't be very useful for random lines unless the 
shape is guaranteed to be convex. For example, if you have a torus, it 
is very easy to have a line with the end points inside but which goes 
outside the shape. You need to check the end points and a lot of points 
along the line using the inside() function, or (faster and more 
accurate) use the trace() function to trace a ray along the line from 
one end point and check for an intersection closer than the other end 
point.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Timothy R  Cook
Subject: Re: Math help
Date: 13 Aug 2002 12:56:59
Message: <3D593A59.7080008@scifi-fantasy.com>
ABX wrote:
> It can help but can't solve.
> As I understand he wants sphere_sweep in object, not only control points.

Exactamally.  I can fill the space with random spheres easy.
It's when you connect random ones that it doesn't work nice.

-- 
Tim Cook
http://empyrean.scifi-fantasy.com
mirror: http://personal.lig.bellsouth.net/lig/z/9/z993126

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

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