K3D-tools / K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
921 stars 123 forks source link

`camera_fov` argument of `k3d.plot` init function has no effect #316

Closed ghost closed 2 years ago

ghost commented 2 years ago
import k3d
plot = k3d.plot(camera_fov=10.0)
plot

Has no effect on the actual FOV used. As you can see in the screenshot, the fov is still set to the default (60.)

image

Changing the attribute after the plot is displayed does change the fov.

Tested with k3d==2.11.0

artur-trzesiok commented 2 years ago

@MironLeon

Thanks a lot. Very good bug hunting :). In constructing of k3d (https://github.com/K3D-tools/K3D-jupyter/blob/main/js/src/k3d.js#L306) I miss "camera_fov" parameter :(. But at the same moment I handle change of camera_fov (https://github.com/K3D-tools/K3D-jupyter/blob/main/js/src/k3d.js#L296) thats why it working when you changed it after plot was created.