[yt-users] does anyone use volume_rendering's PerspectiveCamera?
Stuart Levy
salevy at illinois.edu
Thu Dec 4 12:16:50 PST 2014
I know it's being rewritten, thanks to Sam and Cameron and others, but
I'm hoping to use some sort of perspective camera for volume
rendering. (What I'll eventually want is the dome camera which I know
also exists, but wanted to start with a simpler plane-projection
perspective camera.)
What I get: plausible images from the default orthographic Camera, but
reliably blank images from PerspectiveCamera.
If I extract the sampler rays from PerspectiveCamera and plot them, they
always seem to point in the hemisphere away from the given center
point. If I change the sign of Z width, the viewpoint is put on the
opposite side of the data region, and the rays still point away from it.
Also they're extremely short, like .001 or so of the distance from the
viewpoint to the center point - much too short to intersect anything if
the viewpoint is outside of the data volume.
If I hack the sampler vectors in PerspectiveCamera to (a) reverse their
direction and (b) make them many times longer, I do see something.
I don't know whether I'm passing nonsense parameters to
PerspectiveCamera, or whether its current code is really not right...?
A sample program, which contains its own replacement for
Camera.snapshot() that allows for tweaking PerspectiveCamera rays, is in:
http://paste.yt-project.org/show/5240/
More information about the yt-users
mailing list