POV-Ray : Newsgroups : povray.general : Math help request Server Time
4 Aug 2024 00:26:26 EDT (-0400)
  Math help request (Message 1 to 5 of 5)  
From: Tim McMurdo
Subject: Math help request
Date: 6 Oct 2003 16:40:01
Message: <web.3f81d2fafacc7b78297c858d0@news.povray.org>
I have a series of vectors called point1 through point50. Connecting all of
the points forms a spline in 3D space. How do I find a third point laying
on the spline that is a given distance along the spline from Point1?

Thanks,

Tim


Post a reply to this message

From: Tim McMurdo
Subject: Re: Math help request
Date: 6 Oct 2003 17:15:01
Message: <web.3f81db1638fddf76297c858d0@news.povray.org>
I think further explanation might be necessary. I will have several of these
splines, each used to define points along the surface of a sail. I will
connect the points with triangles to form a mesh. I will also use the
points to place objects on the surface of the sail. Hope this helps you
understand what I am trying to do.

Thanks,

Tim


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Math help request
Date: 6 Oct 2003 19:54:56
Message: <3f8200d0@news.povray.org>
It depends on what kind of spline you're using. If you're just doing
straight connections from point 1 to 2, 2 to 3, 3 to 4, etc, then it's
simply interpolating along the points. If, for example, you'd want a value
from 0 to 1 calculate a position between point 1 and point 50 on that
spline, you'd have to multiply the value by 49, use the fraction behind the
integer part as the index for the first point, and the fraction part as
interpolation value for the next point. Linear-Interpolation is rather
simple:
point1 - (point1-point2)*Float
where float ranges between 0 and 1 (that'll be the fraction part, the points
1 and 2 are defined by integer part and integer part + 1). Take care though
that at 49, there's no point + 1!

For other splines, the method is similiar, but different, based upon the
spline-type you're using. In case you're interested in a little code, I've
got some BSpline-Macros on my website for download. Though they only provide
the Bicubic Bezier Splines and the linear interpolation mentioned above,
they may provide some insight into usage and scripting for this.

Regards,
Tim

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: tim.nikias (@) gmx.de


> I think further explanation might be necessary. I will have several of
these
> splines, each used to define points along the surface of a sail. I will
> connect the points with triangles to form a mesh. I will also use the
> points to place objects on the surface of the sail. Hope this helps you
> understand what I am trying to do.
>
> Thanks,
>
> Tim
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 24.09.2003


Post a reply to this message

From: ABX
Subject: Re: Math help request
Date: 7 Oct 2003 03:54:42
Message: <qtr4ovor1af8csjqsn0acc0j6dfsbmcnqb@4ax.com>
On Mon,  6 Oct 2003 16:39:22 EDT, "Tim McMurdo" <jod### [at] wohrrcom> wrote:
> How do I find a third point laying
> on the spline that is a given distance along the spline from Point1?

I have posted a macro some time ago to the povray.advanced-users and reposted
it a few times in povray.general which for given spline of any type created
linear spline which was aproximation of given one. That new spline had ability
to measurte t in meaning of distance along spline. Look for that.

ABX


Post a reply to this message

From: Tim McMurdo
Subject: Re: Math help request
Date: 7 Oct 2003 08:40:01
Message: <web.3f82b41238fddf76297c858d0@news.povray.org>
Thank you both for your responses. You have given me a couple directions to
look. I'll let you know how the project progresses.

Tim


Post a reply to this message

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