jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
936 stars 185 forks source link

cannot use cubemap in pythreejs #288

Open kingease opened 4 years ago

kingease commented 4 years ago

when assign scene.background a CubeTexture, there is an error occured:

TraitError: The 'background' trait of a Scene instance must be a valid HTML color, but a value of CubeTexture ...

and in pythreejs, cannot use the cubemap as the way in three.js. because the CubeTextureLoader in pythreejs has no methods like load etc. and I cannot find any reference about this part.

anyone can help? thanks

vidartf commented 4 years ago

The logic for this has not been fully implemented yet. I think one thing we could do would be to add some custom field to the CubeTexture definition (e.g. imageUris), that are only used in the JS constructor, similar to the ImageTexture custom class.

jiangzhongshi commented 4 years ago

What is the current status of this issue? Thank you. Are there any alternatives or workarounds? Thank you!

vidartf commented 4 years ago

As far as I know, no-one has looked at this yet. Please write here if you intended to help implement this :)

jiangzhongshi commented 4 years ago

Thanks for the reply. I would be happy to make it happen, unfortunately I am really not familiar with javascript.

If it helps anyone in the future, my workaround, at least for inspecting the smoothness through reflection lines, is to use a MeshMatcapMaterial together with DataTexture.

akaszynski commented 2 years ago

So... it's been two years but there's a working example included in https://github.com/jupyter-widgets/pythreejs/pull/376. Once that's merged we can close this one out.