POV-Ray : Newsgroups : povray.animations : Drawing lines... Server Time: 22 Nov 2019 04:23:11 GMT
  Drawing lines... (Message 1 to 3 of 3)  
From: kurtz le pirate
Subject: Drawing lines...
Date: 12 Oct 2019 15:15:09
Message: <5da1edfd$1@news.povray.org>
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


Post a reply to this message

From: Bald Eagle
Subject: Re: Drawing lines...
Date: 12 Oct 2019 16: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

From: jr
Subject: Re: Drawing lines...
Date: 12 Oct 2019 18:25:01
Message: <web.5da219fbe87d1b89feeb22ff0@news.povray.org>
hi,

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.

couldn't do it myself (haven't the math) but think that the distribution file
"scenes/animations/vect1/vect1.pov" contains the info you're after.

regards, jr.


Post a reply to this message

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