almarklein / visvis

Visvis - the object oriented approach to visualization
Other
229 stars 26 forks source link

Rotate camera #127

Closed Anewre closed 1 year ago

Anewre commented 1 year ago

Dear Almar,

I am using visvis to visualize some objects, I have several objects that I display in subplots and I am using the same camera for all of these subplots. I am new to visvis and its capabilities, but is it possible to rotate the camera slowly (change the azimuth angle) while the visvis app is running? If so, how can I accomplish this?

With kind regards,

almarklein commented 1 year ago

Yes, you can set the camera's azimuth property. You could e.g. use a timer to do that.

BTW Visvis is not very actively maintained. If you're looking for a new 3D visualization tool I'd recommend taking a look at pygfx instead.

Anewre commented 1 year ago

Thank you, indeed using a timer I was able to implement the camera rotation. Additional thanks for referring me to pygfx, I will have a look at it.

fig=vv.figure(2) axes = vv.clf() c1=vv.subplot(131) c2=vv.subplot(132) c3=vv.subplot(133) c1.camera = c2.camera = c3.camera

Define timer func

def onTimer(event): c1.camera.azimuth+=1

Update!

axes.Draw()

Create time and enter main loop

timer = vv.Timer(axes, 100, False)