-
Hi! I want to rotate or pan the scene when I update the 3D scene by following codes: ...
pts = pointcloud.Points(pt)
plt = show( pts, axes=5, interactive=False)
for i in range(1000):
pt = np.random.uniform(10, 100, size=(1000, 3))
pts.points(pt)
plt.render()
plt.interactive().close() But it not works, I can't rotate or pan the scene when 3D scene is updating. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is only possible with vtk<9.2.2 due to a bug in vtk. Try
then from vedo import *
settings.allow_interaction = True
pts = np.random.uniform(10, 100, size=(100000, 3))
vpts = Points(pts, c='white', r=1)
plt = Plotter(axes=5, interactive=False, bg='black')
plt.show(vpts)
pb = ProgressBar(0,500, c='g')
for i in range(500):
pts += np.random.randn(100000, 3)/20
vpts.points(pts)
cube_centers = np.random.uniform(10, 100, size=(10, 3))
boxes=[]
for cc in cube_centers:
box = Box(size=(30,20,10), c='green5')
ax, ay = np.random.uniform(0, 45, size=2)
box.rotate_x(ax).rotate_y(ay).pos(cc)
box.wireframe().lw(2).lighting("off")
boxes.append(box)
plt.remove("Box").add(boxes)
# plt.render() # no need! add already calls it
pb.print()
if plt.escaped: # becomes True if Esc is pressed
break
plt.interactive().close() on my machine I get 56 fps. |
Beta Was this translation helpful? Give feedback.
-
are you sure you removed the call to try also I don't see how can be made faster..
No, sorry! At the minute |
Beta Was this translation helpful? Give feedback.
This is only possible with vtk<9.2.2 due to a bug in vtk. Try
pip install vtk==9.0.3
then