POV-Ray : Newsgroups : povray.animations : Drawing lines... Server Time
25 Oct 2021 12:47:59 EDT (-0400)
  Drawing lines... (Message 1 to 4 of 4)  
From: kurtz le pirate
Subject: Drawing lines...
Date: 12 Oct 2019 11: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 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

From: jr
Subject: Re: Drawing lines...
Date: 12 Oct 2019 14: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

From: m@b
Subject: Re: Drawing lines...
Date: 4 Oct 2020 23:09:00
Message: <5f7a8e4c$1@news.povray.org>
On 12/10/2019 23:15, kurtz le pirate 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.
> 
> 

#declare A = <-2,1,-0.5>;
#declare B = < 3,3, 0.5>;
#declare C = B*clock + A*(1-clock) + <0,0,0.00001>; // Or declare a 
sub-clock

sphere{A,0.2 pigment{rgb<1,0,0>}}
sphere{B,0.2 pigment{rgb<0,0,1>}}

cylinder{A,C,0.1 pigment{rgb<0,1,0>}}


Post a reply to this message

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