POV-Ray : Newsgroups : povray.general : Working with vectors : Re: Working with vectors Server Time
4 Aug 2024 06:14:31 EDT (-0400)
  Re: Working with vectors  
From: Peter McCombs
Date: 7 Jul 2003 11:45:41
Message: <slrnbgj5d5.6nn.pmccombs@xmission.xmission.com>
In article <3f0876f5$1@news.povray.org>, Ray Gardener wrote:
>> How can I find a point on a vector with POV-Ray?
>
>What kind of point are you looking for?
>Something that intersects an object (use trace()),
>or just a point some distance along a ray
>(use #declare vecResult = vec.normalize() * the_distance + position;)?


What I am trying to do is wrap a spline around another spline, which has doubled
 back on itself. I'm taking a segment of the spline, and normalizing it to find
the "direction" that the spline is going (#declare direction = 
vnormalize(segmentEnd - segmentStart);). Then I get a vector that is 
perpendicular to that direction (#declare p = vperp_to_vector(direction);).

I want to get a point on that perpendicular vector, and gradually rotate it 
around a point point on my spline until I wrap around it completely.

In my scene, this is going to help me make a siezing on a rope that I have 
modeled.

So what I think I need is any point along that perpendicular vector, which I 
think I can get using your example:

#declare vecResult = vec.normalize() * the_distance + position;

Where "vec" is my perpendicular vector that I want to find the point on, and 
"the_distance" is an arbitrary distance along that vector?  What does "position"
 represent on the vector? 

I'm not an expert at 3d math at all, so I hope I am on the right track with 
this idea.

Thanks,

-Peter


Post a reply to this message

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