Hi @empet,
I am reviving this thread because I am integrating your previous answer about rotations with the present one.
def rotate_z(x, y, z, theta):
w = x+1j*y
return np.real(np.exp(1j*theta)*w), np.imag(np.exp(1j*theta)*w), z
x_eye = -1.25
y_eye = 2
z_eye = 0.5
frames=[]
fig = go.Figure(data=[go.Surface(z=Z[0:200,0:100], x=X[0:200,0:100], y=Y[0:200,0:100], surfacecolor=d_matrix, connectgaps=True)])
layout = go.Layout(
title='Animation Test',
width=600,
height=600,
scene=dict(camera=dict(eye=dict(x=x_eye, y=y_eye, z=z_eye))),
updatemenus=[dict(buttons = [dict(args = [None, {"frame": {"duration": 1,
"redraw": False},
"fromcurrent": True,
"transition": {"duration": 100}}],
label = "Play",
method = "animate")],
type='buttons',
showactive=False,
y=1,
x=1.12,
xanchor='right',
yanchor='top')])
for t in np.arange(0, 6.26, 0.1):
xe, ye, ze = rotate_z(x_eye, y_eye, z_eye, -t)
frames.append(go.Frame(layout=dict(scene_camera_eye=dict(x=xe, y=ye, z=ze))))
fig.update(frames=frames)
fig.show()
plotly.offline.plot(fig, filename=r'\test.html')
My goal is a smoother and faster transition between different frames. You can see the final output in html format here.
Using the code you provided in this thread, I have noticed that the parameters βdurationβ for both frame and transition are not affecting the output