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
942 stars 123 forks source link

Axis helper color convention misalignment #339

Closed district10 closed 2 years ago

district10 commented 2 years ago

Most 3d visualization uses XYZ-RGB correspondence in axis helper. Is the current X/Y/Z-Red/Blue/Green configuration intentional? How can I configure this?

image

to

image

reference:

tgandor commented 2 years ago

Right now it's hardcoded here: https://github.com/K3D-tools/K3D-jupyter/blob/1b034ddf068e6e89511077b67e539a5267bf6e1d/js/src/providers/threejs/initializers/Scene.js#L13

I don't know if there was a reason for using this color permutation. It's also not OpenCV convention (BGR). It's easy to change the axisHelper, but this will require updating ~30 MB of unittest references: https://github.com/K3D-tools/K3D-jupyter/tree/main/k3d/test/references

district10 commented 2 years ago

@tgandor No necessary to change current default color permutation. Yeah, there are different conventions like you said opencv BGR versus common RGB (like in CSS, or packed color 0xff0000).

Could we add a configuration to dat.gui, and/or scene constructor?

artur-trzesiok commented 2 years ago

Hi @district10

I would like to avoid making a GUI overcrowded. plot property/constructor sounds much better.

artur-trzesiok commented 2 years ago

Please download new version of k3d@2.13.0:

It should be there :)