We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all, what I would like to do is to generate a number of vertexes (4 for example) in random positions and then having a line starting from one vertex that "grows" intersecting the other vertex points. Do you think is possible? What is important is that I only want to have 1 continuous line..
thank you
P.
Answers
You will generate a random number n, the amount of vertices, and then n pairs of x and y. You will store those values in an array (2D maybe) and calculate the line equation for the first two vertices. This line will start from vertice #1 and elongate until it reaches vertice #2. Then calculate the line equation for vertice #2 & #3 and repeat until vertice #n
yes, like Alex said; for elongate look at
lerp()
the array is of type
PVector
and quite surely 1Dthis
is not necessary with lerp imho
I did not know about lerp... Nice