POV-Ray : Newsgroups : povray.animations : Drawing lines... : Re: Drawing lines... Server Time
19 Apr 2024 11:16:25 EDT (-0400)
  Re: Drawing lines...  
From: Bald Eagle
Date: 12 Oct 2019 12:05:01
Message: <web.5da1f8b4e87d1b894eec112d0@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello,
>
> I have a really stupid question.
>
> I want to draw a line (a cylinder in fact), between two points in a
> "gradual way". Let us take two points A and B separated by a distance
> DIST and trying to do :
>
> delta = 0
> while (delta < DIST)
>    draw cylinder from A to A+delta
>    increment delta
> end
>
> And the 'last' cylinder is draw from A to B.
>
>
> I'm lost between 'vnormalize', 'vtransform' and 'reorient' :(
> Probably very easy, but I'm ditching.
>
>
> --
> Kurtz le pirate
> Compagnie de la Banquise

You want something along the lines of:

1. calculate the distance D between the points.
2. normalize the vector P (P2 - P1)
3. #for (M, 0, D, StepSize)
cylinder {0, P*M, LineWidth translate P1}
#end


Post a reply to this message

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