locked
how to chage default view RRS feed

  • Question

  • Hi,

     

    Is there anyway to control the default view when a HDview is laoded? Ideally i would prefer if default was more zoomed out and in a different part of the image.

     

    Thanks

    Wednesday, June 20, 2007 9:11 PM

Answers

  • Yes there is.  You need to use the FOV, Pitch and Yaw properties on the control - they are documented here: http://research.microsoft.com/ivm/HDView/HowDone/HDXMLspec.htm

     

    If you are using the example web-page from the HD View Utilities download.  Then do the following:

     

    - Have the web page load your xml/image file

    - Adjust the view to what you would like and select 'save specific view'

    - Copy the generated URL to the clipboard

    - Edit the web page and paste in the FOV=F&Pitch=P&Yaw=Y portion of the URL.

     

    For example the script portion of the example file might now read:

     

     <script type="text/javascript">
          var args;
              if ( top.location.search == "" )  {  
                 args = 'FileName=HDView-Example.xml&BackgroundColor=0&FOV=30&Pitch=5&Yaw=10';
              }
             else {
                  args = top.location.search.substring(1);
              }

           hdv = new hdvHost("hdvControl", "hdvDiv", "100%", "90%", top.location.href, args); 
     </script>

    Wednesday, June 20, 2007 9:35 PM

All replies

  • Yes there is.  You need to use the FOV, Pitch and Yaw properties on the control - they are documented here: http://research.microsoft.com/ivm/HDView/HowDone/HDXMLspec.htm

     

    If you are using the example web-page from the HD View Utilities download.  Then do the following:

     

    - Have the web page load your xml/image file

    - Adjust the view to what you would like and select 'save specific view'

    - Copy the generated URL to the clipboard

    - Edit the web page and paste in the FOV=F&Pitch=P&Yaw=Y portion of the URL.

     

    For example the script portion of the example file might now read:

     

     <script type="text/javascript">
          var args;
              if ( top.location.search == "" )  {  
                 args = 'FileName=HDView-Example.xml&BackgroundColor=0&FOV=30&Pitch=5&Yaw=10';
              }
             else {
                  args = top.location.search.substring(1);
              }

           hdv = new hdvHost("hdvControl", "hdvDiv", "100%", "90%", top.location.href, args); 
     </script>

    Wednesday, June 20, 2007 9:35 PM
  • Hi, thank you for the response, this worked!

     

    Perhaps this should be added to FAQ as it is not documented anywhere I can see that these parameters can be added to the "args=" line.

     

     Edit: ok now i have reread the page i can see it is talked about, but perhaps a code example would make clear, and clarification this will allow the changing of default view.

     

    Thanks again

     

    Friday, June 22, 2007 12:06 AM