Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible improvements related to animations #458

Open
Davide-sd opened this issue Jul 10, 2024 · 1 comment
Open

Possible improvements related to animations #458

Davide-sd opened this issue Jul 10, 2024 · 1 comment

Comments

@Davide-sd
Copy link
Contributor

  • K3D version: 2.16.1
  • Python version: 3.12.3
  • Operating System: Ubuntu 24.04

Description

First of all, thank you again for this wonderful package, I'm always impressed by its capabilities. :)

If I create a time series animation, the related controls are positioned into the Control tab (play/stop button, time, fps). Would it be possible:

  1. to create and move this control into a new section named Animation (only visible when time series are used)?
  2. to make this section visible programmatically? This would focus user attention on animation rather than every other available control.
  3. to create 2 new buttons, next frame and previous frame? This would be invaluable, for example, in visualizing locking mechanisms. The slider is good, but only if there are few time points.

image

What I Did

import k3d
import numpy as np

np.random.seed(2022)

x = np.random.randn(100,3).astype(np.float32)

plt_points = k3d.points(x,
                        color=0x528881,
                        point_size=0.2)

plot = k3d.plot()
plot += plt_points
plot.display()

plt_points.positions = {str(t):x - t/5*x/np.linalg.norm(x,axis=-1)[:,np.newaxis] for t in range(10)}
plot.start_auto_play()
@spanag
Copy link

spanag commented Mar 11, 2025

The js object thankfully exposes methods to start/stop from external js code, there is some added effort to sync the lil.gui controls as well.
This implementation might help: k3d_enhancements.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants