POV-Ray : Newsgroups : povray.general : mathematics for lines in 3D space Server Time
31 Oct 2024 12:15:55 EDT (-0400)
  mathematics for lines in 3D space (Message 1 to 8 of 8)  
From: Erick
Subject: mathematics for lines in 3D space
Date: 13 Mar 2000 16:32:48
Message: <38cd5e80@news.povray.org>
Hello,

I wondered if there is an easy way to make threedimensional curves using a
mathematical function, ideally precisely between two points . How could this
be done in POV-ray?

Previously, many people made spirals by combining a lot of spheres with
their coordinates following a spiral calculation. Isn't there a more
appropriate and direct way to do so? And, more interestingly,  following
completely different paths.

Maybe I expect too much of POV-ray.
Greetings, Erick


Post a reply to this message

From: Mike Weber
Subject: Re: mathematics for lines in 3D space
Date: 13 Mar 2000 16:57:44
Message: <38cd6458$1@news.povray.org>
I saw a spline macro.  Check the www.povray.org links.

But it you want a line between two points - it will only be straight one...

--
Mike

wk: mik### [at] pyxiscom  www.pyxis.com
hm: mwe### [at] sciticom  www.geocities.com/mikepweber
www.geocities.com/mikepweber

"Erick" <ejv### [at] wxsnl> wrote in message
news:38cd5e80@news.povray.org...
> Hello,
>
> I wondered if there is an easy way to make threedimensional curves using a
> mathematical function, ideally precisely between two points . How could
this
> be done in POV-ray?
>
> Previously, many people made spirals by combining a lot of spheres with
> their coordinates following a spiral calculation. Isn't there a more
> appropriate and direct way to do so? And, more interestingly,  following
> completely different paths.
>
> Maybe I expect too much of POV-ray.
> Greetings, Erick
>
>
>
>


Post a reply to this message

From: Chris Colefax
Subject: Re: mathematics for lines in 3D space
Date: 13 Mar 2000 18:31:24
Message: <38cd7a4c@news.povray.org>
Erick <ejv### [at] wxsnl> wrote:
> I wondered if there is an easy way to make threedimensional curves using a
> mathematical function, ideally precisely between two points . How could
this
> be done in POV-ray?
>
> Previously, many people made spirals by combining a lot of spheres with
> their coordinates following a spiral calculation. Isn't there a more
> appropriate and direct way to do so? And, more interestingly,  following
> completely different paths.

If you use only spheres, then obviously many will be required to give a
smooth path along your desired function curve.  Other possibilities are to
use spheres connected by cylinders/cones (although you still need quite a
few for a smooth result) or torus segments (not necessarily very accurate),
smooth triangles (most flexible, but perhaps harder to program), bicubic
patches (an extension of the triangles), or blobs (which have the great
advantage of being CSG'able, perfectly smooth, and quick to raytrace).
Given a function, you should be able to create a while loop that will place
your objects along the path in the way you want.

For examples of how the different techniques can be used along spline paths,
you can preview my Spline Macro System at
http://www.geocities.com/ccolefax/spline


Post a reply to this message

From: Chris Huff
Subject: Re: mathematics for lines in 3D space
Date: 13 Mar 2000 18:38:32
Message: <chrishuff_99-BE7900.18402513032000@news.povray.org>
In article <38cd5e80@news.povray.org>, "Erick" <ejv### [at] wxsnl> 
wrote:

> I wondered if there is an easy way to make threedimensional curves 
> using a mathematical function, ideally precisely between two points . 
> How could this be done in POV-ray?

There is a set of spline macros by Chris Colfax, here:
http://www.geocities.com/ccolefax/spline/


There is also MegaPOV, an unofficial version of POV-Ray and unsupported 
by the POV-Team, which includes two different spline patches which will 
probably do what you want. MegaPOV is available here:
http://nathan.kopp.com/patched.htm


> Previously, many people made spirals by combining a lot of spheres with
> their coordinates following a spiral calculation. Isn't there a more
> appropriate and direct way to do so? And, more interestingly,  following
> completely different paths.

If you use MegaPOV, there is a sphere_sweep object which can be used to 
make "wire" like shapes instead of using hundreds or thousands of 
spheres.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Steve Martin
Subject: Re: mathematics for lines in 3D space
Date: 14 Mar 2000 08:43:04
Message: <38CE4234.64C7617A@usit.net>
Mike Weber wrote:

> > I wondered if there is an easy way to make threedimensional curves using a
> > mathematical function, ideally precisely between two points . How could
> this
> > be done in POV-ray?

> But it you want a line between two points - it will only be straight one...

<pedantic mode on>

Actually, a Bezier curve is between two points (its end points). It does
of course depend on two other points that influence the shape of the
curve, but these points are not *on* the curve; the end-points are the
only points you specify that actually lie *on* the curve.

<pedantic mode off>

I believe you probably are interested in a field of math referred to as
"cubic polynomials".


Post a reply to this message

From: Bill DeWitt
Subject: Re: mathematics for lines in 3D space
Date: 14 Mar 2000 08:58:11
Message: <38ce4573@news.povray.org>
I was just thinking that an isosurface should be able to be made so that it
draws a line between two points. y and z change as a function of x until it
meets the <x,y,z> you want. Then times 0.001 or what ever to make the line
thin.

    I'll test it later, another animation is running right now.

"Steve Martin" <sma### [at] usitnet> wrote in message
news:38CE4234.64C7617A@usit.net...
> Mike Weber wrote:
>
> > > I wondered if there is an easy way to make threedimensional curves
using a
> > > mathematical function, ideally precisely between two points . How
could
> > this
> > > be done in POV-ray?
>
> > But it you want a line between two points - it will only be straight
one...
>
> <pedantic mode on>
>
> Actually, a Bezier curve is between two points (its end points). It does
> of course depend on two other points that influence the shape of the
> curve, but these points are not *on* the curve; the end-points are the
> only points you specify that actually lie *on* the curve.
>
> <pedantic mode off>
>
> I believe you probably are interested in a field of math referred to as
> "cubic polynomials".


Post a reply to this message

From: Mike Williams
Subject: Re: mathematics for lines in 3D space
Date: 16 Mar 2000 13:46:10
Message: <hKu$tCAgdR04EwN$@econym.demon.co.uk>
Wasn't it Bill DeWitt who wrote:
>I was just thinking that an isosurface should be able to be made so that it
>draws a line between two points. y and z change as a function of x until it
>meets the <x,y,z> you want. Then times 0.001 or what ever to make the line
>thin.

Do you mean something like this?

#declare f = function {sin(x)}

isosurface {
   function {(y - f(x,0,0) )^2 + z^2 -1/1000}
   threshold 0
   accuracy 0.00001
   contained_by {sphere 0,2}
   method 1
}

This plots y=sin(x), but you can use any function of x in place of
sin(x).

A mathematician would write f(x) where I've written f(x,0,0), but that's
just because MEGApov considers that functions have three variables.

The thickness of the tube is controlled by the -1/1000 bit. 

It's also possible to add motion in the z direction by replacing z^2 by
(z - g(x,0,0) )^2.

-- 
Mike Williams * ##
Gentleman of Leisure


Post a reply to this message

From: Bill DeWitt
Subject: Re: mathematics for lines in 3D space
Date: 16 Mar 2000 15:20:57
Message: <38d14229@news.povray.org>
"Mike Williams" <mik### [at] nospamplease> wrote :
>
> Do you mean something like this?
>

    Yes, very much like that. And I must say that you beat me to it by about
30 years, but I was working on it. As a progress report, so far I had looked
over the math courses available by telepresence at our local community
college.

    My goal was to make it a macro that would take four data points and draw
a line between the middle two like a cubic_spline. Then you could call the
macro as you read off groups of four data points from a larger array.

    I anticipate that with the help of your function, it will take me about
15 years, you are welcome to beat me to it again... 8-)


Post a reply to this message

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