glotzerlab / plato

Efficient visualization of particle data supporting several rendering engines.
https://plato-draw.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

pythreejs not showing without manually-specified scene translation #37

Closed bdice closed 5 years ago

bdice commented 5 years ago

I am having trouble with getting blank scenes unless I manually specify the scene translation. I'm running commit c42e94310d742f0e60e8f874ff9aad548156e842 (current master, after v1.5.0).

To reproduce:

import plato
import plato.draw.pythreejs as draw

# This is empty
draw.Scene(
    draw.Spheres(positions=[[0, 0, 0]], radii=[0.5], colors=[[0.5, 0.5, 0.5, 1]])).show()

# This shows the sphere
draw.Scene(
    draw.Spheres(positions=[[0, 0, 0]], radii=[0.5], colors=[[0.5, 0.5, 0.5, 1]]),
    translation=[0, 0, 0]).show()
klarh commented 5 years ago

This is probably due to interactions with the default placement/settings of pythreejs objects and the coupling of the camera and scene translation/rotation. Can you see if the fix_pythreejs_translation branch fixes the more complex use case you had?

klarh commented 5 years ago

Presumed fixed in f81a7fe, let me know if that's not the case.

bdice commented 5 years ago

@klarh Sorry, I didn't reply! I tested it earlier, that fixed the issue. Thanks! 😄