Setting camera position must be updated via home button
See original GitHub issueThis might just be a matter of documentation, but I can’t seem to get the camera to reset positions correctly. I’m dealing with a large mesh whose bounding box is approximately centered at the origin and that extends from roughly -100 to 100 in each dimension. Everything about the display seems fine until I try to set the camera position. My code looks something like this:
import ipyvolume as ipv
f = ipv.figure(width=600, height=600)
m = ipv.plot_trisurf(x, y, z, ...)
# setup view from bottom of the mesh
f.camera.up = (0, -1, 0)
f.camera.position = (0, 0, -150)
f.camera.fov = 0.65
f.camera.lookAt([0,0,0])
ipv.show()
When I execute this, the mesh appears correctly, but the camera appears to be very very close to the top of the mesh looking down; if I then push the home-button in the upper right corner of the display region, the camera moves to the correct position with the correct fov and orientation.
It seems likely that there is an update function that I’m failing to call. My first thought was that I needed something like f.exec_three_obj_method('reset')
(per this bug report in pythreejs), but that doesn’t appear to have changed anything.
Thanks in advance, and for maintaining this library!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
I hope it works, it’s a fix anyway, I hope it also fixes your issue.
Great, thanks so much!