POV-Ray : Newsgroups : povray.bugreports : slope problem : Re: slope problem Server Time
4 Dec 2022 21:17:16 EST (-0500)
  Re: slope problem  
From: clipka
Date: 31 Jan 2019 13:44:23
Message: <5c534207$1@news.povray.org>
Am 31.01.2019 um 19:21 schrieb jr:
> hi,
>> clipka <ano### [at] anonymousorg> wrote:
>>> Well, that's pretty much what I see them doing.
>> given that the "end" is a sphere, I would have expected the cylinders to
>> terminate in a curved shape, equidistant.  but I see a right angle.
> ouch, sorry, I see now.  need to arrange the other spheres spherically to get
> the equidistant ends.
>>> Of course since the distance changes as the angle changes, so do the
>>> gaps (because you computed each of them to be 5% of the total distance,
>>> from sphere center to start of cylinder).
> so how can one "fudge" it, ie make the cylinders end a predictable distance from
> each sphere?

Preusuming you have the "central" sphere at P1, and a "remote" sphere at 
P2, and you want a distance of D between sphere centers and the cylinder 
ends, then

     V = P2 - P1

is the vector describing direction _and_ distance of the cylinder you want;

     Vn = vnormalize(Vn)

is the unit-length directionof that vector; and

     Q1 = P1 + Vn*D
     Q2 = P2 - Vn*D

are the points you want the cylinder ends to be at.

Post a reply to this message

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