Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating camera position in osmesa? #165

Closed
chrishavlin opened this issue Dec 11, 2024 · 2 comments · Fixed by #166
Closed

updating camera position in osmesa? #165

chrishavlin opened this issue Dec 11, 2024 · 2 comments · Fixed by #166

Comments

@chrishavlin
Copy link
Contributor

chrishavlin commented Dec 11, 2024

Not sure if this a bug or user error but trying to set the rc.scene.camera.position with an osmesa rendering context does not work:

import yt
import yt_idv

ds = yt.load_sample("IsolatedGalaxy")
dd = ds.all_data()

rc = yt_idv.render_context("osmesa", width=1024, height=1024)
rc.add_scene(dd, "density", no_ghost=True)
rc.scene.camera.position =  [0.5, 0.5, 2]

image = rc.run()
yt.write_bitmap(image, "niiiiiice.png")

niiiiiice

This works as expected with the pyglet gui

@chrishavlin
Copy link
Contributor Author

also, just for fun, this is what i was seeing with a spherical dataset
spherical_insanity

@chrishavlin
Copy link
Contributor Author

looking at the trackball camera, I think I just need to add a traitlets.observe for the position attribute and update the related view matrix. I guess the gui probably updates the view on changes to those gui attributes? anyway, might have a fix shortly...

@chrishavlin chrishavlin linked a pull request Dec 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant