Skip to content

Animating a continous loop, or rather a set of points, point for point #866

Answered by marcomusy
HafeezHaidari asked this question in Q&A
Discussion options

You must be logged in to vote

vedo has a built in feature to draw trailing lines, (you can set n=1000 to get the full trajectory):

from vedo import *

def create_points(n):
    a = 10
    b = 28
    c = 8 / 3
    dt = 0.01
    p = np.array([0.01, 0, 0])
    pts = []
    for _ in range(n):
        x, y, z = p
        dx = (a * (y - x)) * dt
        dy = (x * (b - z)) * dt
        dz = (x * y - c * z) * dt
        p = p + [dx, dy, dz]
        pts.append(p)
    return np.array(pts)

pts = create_points(1000)
line = Line(pts).c("k5")
pt = Point(pts[0], c="red5", r=15)
pt.add_trail(c="red3", lw=4, n=200)
comment = Text2D(font="Calco")

plt = Plotter(axes=1, interactive=False)
plt.show(line, pt, comment, viewup="z", zoom=1.2)…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@HafeezHaidari
Comment options

@marcomusy
Comment options

Answer selected by marcomusy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants