[yt-users] Volume rendering

Андрей Парамонов cmr.pent at gmail.com
Tue Dec 5 13:13:23 PST 2017


Hello Nathan!

I could come up with the following code:

import yt
import numpy as np

intens = np.ones((3, 3, 3)) + np.random.rand(3, 3, 3)
print(intens.shape)
ds = yt.load_uniform_grid({'Intensity': intens}, intens.shape,
                          bbox = np.array([[-5, +5], [-4, +4], [-3, +3]]))
print(ds)
sc = yt.create_scene(ds, ('Intensity'), lens_type = 'perspective')
sc.camera.resolution = [800, 600]
sc.camera.position = [-3, -6, +6]
sc.camera.focus = ds.domain_center
sc.annotate_domain(ds)
sc[0].set_log(False)
sc.render()
sc.save('vr_grids.png')

I get image as attached. It is closer to what I expect (esp. image aspect),
however I just cannot understand the following:

1) Why does the box appear tilted? How to avoid it?
2) I expect the box lying on the wide side, however one of the wide sides
seems to correspond to Z axis (vertical). Why is it so, and how to change
it?
3) How to zoom in, without introducing fish-eye effect?

Thank you very much for your support,
Andrey Paramonov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20171206/8da510c0/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vr_grids.png
Type: image/png
Size: 9454 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20171206/8da510c0/attachment-0002.png>


More information about the yt-users mailing list