[yt-users] does anyone use volume_rendering's PerspectiveCamera?

Nathan Goldbaum nathan12343 at gmail.com
Fri Dec 5 11:42:36 PST 2014


On Fri Dec 05 2014 at 9:04:36 AM Suoqing JI <suoqing at physics.ucsb.edu>
wrote:

> Hi Stuart,
>
> I’ve just read over the source code of PerspectiveCamera, but do not quite
> understand it… So I wrote anther version of PerspectiveCamera class and
> pasted it here: http://paste.yt-project.org/show/5243/
> <http://paste.yt-project.org/show/WPJ9EYMeYDyb4oPtgC0z/>
>
> And here’re the test figures of moving camera through the volume:
>
> http://pbrd.co/1FWWiLE
> http://pbrd.co/1FWWpH2
> http://pbrd.co/1FWWGJT
>
> Also, in the YT-3 dev version there’re SphericalCamera and
> StereoSphericalCamera, which will generate 360 degree dome views.
>
> PS. I’m not sure whether there’ll be someone who can fix
> PerspectiveCamera, or I’ll create a PR…
>

I think this would be a great contribution.  Cameron or Sam, are you ok
with this updated camera going in while the VR rewrite proceeds?


>
> Best wishes,
>
> --
> Suoqing JI
> Ph.D Student
> Department of Physics
> University of California, Santa Barbara
> CA 93106, USA
>
> On Dec 4, 2014, at 1:08 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>
> Hi Stuart,
>
> Looking at the PerspectiveCamera source with "hg blame", it looks like it
> has seen only superficial changes since January 2013.  I bet what you're
> seeing is due to something else changing in the volume rendering interface
> underneath it.
>
> FWIW, the PerspectiveCamera does have tests:
>
>
> https://bitbucket.org/yt_analysis/yt/src/5cd6764df8f3fbb981eefa5f19ee9f98b0ed61f6/yt/visualization/volume_rendering/tests/test_vr_cameras.py?at=yt#cl-91
>
> But the tests only check to make sure the camera works without crashing,
> and does not verify that the answer is correct.  It's entirely possible
> something has broken in the last two years.
>
> -Nathan
>
> On Thu Dec 04 2014 at 1:01:51 PM Michael Zingale <
> michael.zingale at stonybrook.edu> wrote:
>
>> Hi Stuart, I've had a similar experience and haven't looked back at it in
>> about 6 mos.  I was planning on waiting until the new renderer is in, and
>> then I was going to try again.
>>
>> Mike
>>
>> On Thu, Dec 4, 2014 at 2:55 PM, Stuart Levy <salevy at illinois.edu> wrote:
>>
>>> 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/
>>>
>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>
>>
>>
>> --
>> Michael Zingale
>> Associate Professor
>>
>> Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
>> 11794-3800
>> *phone*:  631-632-8225
>> *e-mail*: Michael.Zingale at stonybrook.edu
>> *web*: http://www.astro.sunysb.edu/mzingale
>>  _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141205/b59fdd85/attachment-0001.html>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list