<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Wow, this is wonderful!   I was thinking to just rewrite it, which
    seemed easier than trying to understand the existing code, but
    you've done it so quickly - thank you!<br>
    <br>
    I haven't had a chance to try your new PerspectiveCamera yet but
    will do.   It looks like a perfectly sensible computer-graphics
    camera, with field-of-view equal to 2*atan(0.5*width[0]/width[2])
    and 2*atan(0.5*width[1]/width[2]).<br>
    <br>
    thanks again<br>
    <br>
        Stuart<br>
    <br>
    <div class="moz-cite-prefix">On 12/5/14 1:07 AM, Suoqing JI wrote:<br>
    </div>
    <blockquote
      cite="mid:7AA898E5-8524-43D8-A633-97A6E35EE018@physics.ucsb.edu"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Hi Stuart,
      <div class=""><br class="">
      </div>
      <div class="">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: <a
          moz-do-not-send="true"
          href="http://paste.yt-project.org/show/WPJ9EYMeYDyb4oPtgC0z/"
          class="">http://paste.yt-project.org/show/5243/</a></div>
      <div class=""><br class="">
      </div>
      <div class="">And here’re the test figures of moving camera
        through the volume:</div>
      <div class=""><br class="">
      </div>
      <div class=""><a moz-do-not-send="true"
          href="http://pbrd.co/1FWWiLE" class="">http://pbrd.co/1FWWiLE</a></div>
      <div class=""><a moz-do-not-send="true"
          href="http://pbrd.co/1FWWpH2" class="">http://pbrd.co/1FWWpH2</a></div>
      <div class=""><a moz-do-not-send="true"
          href="http://pbrd.co/1FWWGJT" class="">http://pbrd.co/1FWWGJT</a></div>
      <div class=""><br class="">
      </div>
      <div class="">Also, in the YT-3 dev version there’re
        SphericalCamera and StereoSphericalCamera, which will generate
        360 degree dome views.</div>
      <div class=""><br class="">
      </div>
      <div class="">PS. I’m not sure whether there’ll be someone who can
        fix PerspectiveCamera, or I’ll create a PR…</div>
      <div class=""><br class="">
      </div>
      <div class="">Best wishes,</div>
      <div class=""><br class="">
        <div class="">
          <div style="color: rgb(0, 0, 0); letter-spacing: normal;
            orphans: auto; text-align: start; text-indent: 0px;
            text-transform: none; white-space: normal; widows: auto;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;
            word-wrap: break-word; -webkit-nbsp-mode: space;
            -webkit-line-break: after-white-space;" class="">
            <div style="color: rgb(0, 0, 0); letter-spacing: normal;
              orphans: auto; text-align: start; text-indent: 0px;
              text-transform: none; white-space: normal; widows: auto;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;" class="">
              <div style="color: rgb(0, 0, 0); letter-spacing: normal;
                orphans: auto; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: auto;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                word-wrap: break-word; -webkit-nbsp-mode: space;
                -webkit-line-break: after-white-space;" class="">
                <div style="color: rgb(0, 0, 0); letter-spacing: normal;
                  orphans: auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; word-wrap: break-word; -webkit-nbsp-mode: space;
                  -webkit-line-break: after-white-space;" class="">
                  <div class="">--</div>
                  <div class="">Suoqing JI</div>
                  <div class="">Ph.D Student</div>
                  <div class="">Department of Physics</div>
                  <div class="">University of California, Santa Barbara</div>
                  <div class="">CA 93106, USA</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On Dec 4, 2014, at 1:08 PM, Nathan Goldbaum
              <<a moz-do-not-send="true"
                href="mailto:nathan12343@gmail.com" class="">nathan12343@gmail.com</a>>
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">Hi Stuart,<br class="">
              <br class="">
              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.
              <div class=""><br class="">
              </div>
              <div class="">FWIW, the PerspectiveCamera does have
                tests: </div>
              <div class=""><br class="">
              </div>
              <div class=""><a moz-do-not-send="true"
href="https://bitbucket.org/yt_analysis/yt/src/5cd6764df8f3fbb981eefa5f19ee9f98b0ed61f6/yt/visualization/volume_rendering/tests/test_vr_cameras.py?at=yt#cl-91"
                  class="">https://bitbucket.org/yt_analysis/yt/src/5cd6764df8f3fbb981eefa5f19ee9f98b0ed61f6/yt/visualization/volume_rendering/tests/test_vr_cameras.py?at=yt#cl-91</a></div>
              <div class=""><br class="">
              </div>
              <div class="">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.</div>
              <div class=""><br class="">
              </div>
              <div class="">-Nathan</div>
              <br class="">
              <div class="gmail_quote">On Thu Dec 04 2014 at 1:01:51 PM
                Michael Zingale <<a moz-do-not-send="true"
                  href="mailto:michael.zingale@stonybrook.edu" class="">michael.zingale@stonybrook.edu</a>>
                wrote:<br class="">
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div dir="ltr" class="">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.
                    <div class=""><br class="">
                    </div>
                    <div class="">Mike</div>
                  </div>
                  <div class="gmail_extra"><br class="">
                    <div class="gmail_quote">On Thu, Dec 4, 2014 at 2:55
                      PM, Stuart Levy <span dir="ltr" class=""><<a
                          moz-do-not-send="true"
                          href="mailto:salevy@illinois.edu"
                          target="_blank" class="">salevy@illinois.edu</a>></span>
                      wrote:<br class="">
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">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.)<br
                          class="">
                        <br class="">
                        What I get: plausible images from the default
                        orthographic Camera, but reliably blank images
                        from PerspectiveCamera.<br class="">
                        <br class="">
                        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.<br class="">
                        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.<br
                          class="">
                        <br class="">
                        If I hack the sampler vectors in
                        PerspectiveCamera to (a) reverse their direction
                        and (b) make them many times longer, I do see
                        something.<br class="">
                        <br class="">
                        I don't know whether I'm passing nonsense
                        parameters to PerspectiveCamera, or whether its
                        current code is really not right...?<br class="">
                        <br class="">
                        A sample program, which contains its own
                        replacement for Camera.snapshot() that allows
                        for tweaking PerspectiveCamera rays, is in:<br
                          class="">
                        <br class="">
                        <a moz-do-not-send="true"
                          href="http://paste.yt-project.org/show/5240/"
                          target="_blank" class="">http://paste.yt-project.org/show/5240/</a><br
                          class="">
                        <br class="">
                        <br class="">
                        <br class="">
                        _______________________________________________<br
                          class="">
                        yt-users mailing list<br class="">
                        <a moz-do-not-send="true"
                          href="mailto:yt-users@lists.spacepope.org"
                          target="_blank" class="">yt-users@lists.spacepope.org</a><br
                          class="">
                        <a moz-do-not-send="true"
                          href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                          target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br
                          class="">
                      </blockquote>
                    </div>
                    <br class="">
                    <br class="" clear="all">
                    <div class=""><br class="">
                    </div>
                  </div>
                  <div class="gmail_extra">-- <br class="">
                    <div class="">
                      <div class="">Michael Zingale</div>
                      <div class="">Associate Professor</div>
                      <div class=""><br class="">
                      </div>
                      <div class="">Dept. of Physics &
                        Astronomy • Stony Brook University • Stony
                        Brook, NY 11794-3800</div>
                      <div class=""><i class="">phone</i>:  631-632-8225</div>
                      <div class=""><i class="">e-mail</i>: <a
                          moz-do-not-send="true"
                          href="mailto:Michael.Zingale@stonybrook.edu"
                          target="_blank" class="">Michael.Zingale@stonybrook.edu</a></div>
                      <div class=""><i class="">web</i>: <a
                          moz-do-not-send="true"
                          href="http://www.astro.sunysb.edu/mzingale"
                          target="_blank" class="">http://www.astro.sunysb.edu/mzingale</a></div>
                    </div>
                  </div>
                  _______________________________________________<br
                    class="">
                  yt-users mailing list<br class="">
                  <a moz-do-not-send="true"
                    href="mailto:yt-users@lists.spacepope.org"
                    target="_blank" class="">yt-users@lists.spacepope.org</a><br
                    class="">
                  <a moz-do-not-send="true"
                    href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                    target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br
                    class="">
                </blockquote>
              </div>
              _______________________________________________<br
                class="">
              yt-users mailing list<br class="">
              <a moz-do-not-send="true"
                href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br
                class="">
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br
                class="">
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>