PanoramIX HTML

HTML Scripting for the PanoramIX ActiveX
Control and Netscape Plug-in

  1. The PanoramIX object/embed Block
  2. PanoramIX Methods
  3. PanoramIX Events

The PanoramIX object/embed Block

The following block of html tags may be used to place a PanoramIX window in a web page. These tags and scripts handle platform-dependence (Wintel/MacOS) and browser dependence (Internet Explorer/Netscape/other)


<script language=javascript>
<!-- 
EndTag = unescape("%3e");
isMac = 0;
if (navigator.appVersion == '3.01 (Macintosh; I; 68K)') {
  isMac = 2;
  document.writeln('<img src="pixlogo.gif" alt="PanoramIX logo" height=HEIGHT'+EndTag);
  document.writeln('<p'+EndTag);
  document.writeln('Sorry, but PanoramIX is not available for 68k Macintosh systems. ');
  document.writeln('PanoramIX is available for Power Mac systems, as well as');
  document.writeln(' Windows 95 and Windows NT/x86 systems.');
  document.writeln('<br'+EndTag);
  }
else if (navigator.appVersion == '3.01 (Macintosh; I; PPC)') {
  isMac = 1;
  }
else {
  if (!(navigator.userAgent.indexOf('Mac') < 0)) {
    isMac = 1;
    }
  }
if (isMac == 1) {
  document.write('<OBJECT  ID="PanoramIX"');
  document.write('  classid="clsid:B4CFAA05-25E2-11d1-8943-0004AC7613B0"');
  document.write('  codebase="http://www.software.ibm.com/net.media/panoramix/download/PanoramIX-aPPC.hqx#Version=1,0,3,0"');
  document.write('  codetype="application/x-oleobject"');
  document.write('  standby="Installing the PanoramIX ActiveX control..."');
  document.write('  width=WIDTH height=HEIGHT'+EndTag);
  }
else {
  document.write('<OBJECT  ID="PanoramIX"');
  document.write('  classid="clsid:B4CFAA05-25E2-11d1-8943-0004AC7613B0"');
  document.write('  codebase="http://www.software.ibm.com/net.media/panoramix/download/Pix32.cab#Version=1,0,3,0"');
  document.write('  codetype="application/x-oleobject"')
  document.write('  standby="Installing the PanoramIX ActiveX control..."');
  document.write('  width=WIDTH height=HEIGHT'+EndTag);
  }
//-->
</script>

   <param name="Control" value="PANFILENAME.pan">

   <! Enable the following line to select sphere mode, otherwise delete it. >
   <!param name="panMode" value="sphere">

   <! Enable the following line to disable sprites, otherwise delete it. >
   <!param name="sprite" value="off">

   <! Enable the following line to set an initial azimuth, otherwise delete it. >
   <param name="InitAzim" value="fAZIM">

   <! Enable the following line to set an initial elevation, otherwise delete it. >
   <!param name="InitElev" value="fELEV">

   <! Enable the following line to set an initial field of view, otherwise delete it. >
   <!param name="InitFov" value="fFOV">

   <! Enable the following line to set an initial roll angle, otherwise delete it. >
   <!param name="InitRoll" value="fROLL">

   <! --- The following embed allows the PanoramIX Netscape plug-in to be   --- >
   <! --- used instead of the PanoramIX ActiveX control when not using MSIE --- >
   <! --- The pluginURL supports the smartUpdate feature of Netscape v4.02+ --- >
<script language=javascript>
<!-- 
   if (isMac == 0) {  // Wintel platform
      document.write(' <embed type="world/x-panoramix" src=PANFILENAME.pan width=WIDTH height=HEIGHT ');
      document.write('   name="PanoramIX"');
      document.write('   pluginURL="http://www.software.ibm.com/net.media/panoramix/download/Pix32.jar" ');
      document.write('   pluginsPage="http://www.software.ibm.com/net.media/panoramix/download/" '+EndTag);
      }
   if (isMac == 1) {  //  PPC MacOS platform
      document.write(' <embed type="world/x-panoramix" src=PANFILENAME.pan width=WIDTH height=HEIGHT ');
      document.write('   name="PanoramIX"');
      document.write('   pluginURL="http://www.software.ibm.com/net.media/panoramix/download/PanoramIX-nPPC.jar" ');
      document.write('   pluginsPage="http://www.software.ibm.com/net.media/panoramix/download/" '+EndTag);
      }
//-->
</script>

      <! The following noembed block inserts a PanoramIX logo for   -- >
      <! browsers which do not support ActiveX or Netscape plug-ins.-- >
      <noembed>
         <img src="pixlogo.gif" alt="PanoramIX logo">
         <p>
         Sorry, but PanoramIX is not available for your browser.
         PanoramIX is available for
         Microsoft Internet Explorer versions 3 and 4, and
         Netscape Navigator versions 3 and 4,
         on Windows 95, Windows NT/x86, and PowerMac systems.
         <br>
      </noembed>
   </embed>
</OBJECT>
  • The ID parameter in the object tag, and the name paremeter in the embed tag identify this instance of the PanoramIX object. If there is only one panorama in this page, we recommend that this be set to the string "PanoramIX" as shown above. If there is more than one panorama in the same page, then each must have a unique instance identifier. This can be handled by identifying the instances as "PanoramIX1", "PanoramIX2", and so forth.

  • The codebase parameter should give the url indicating a source of the files for the ActiveX control. The codebase for the Macintosh version of the object tag should specify the url of the hqx file for the MacOS version of this control. The codebase for for the other version of the object tag should specify the url of the cabinet file (Pix32.cab) for the Windows version of the PanoramIX ActiveX control.

    If the cab file is digitally signed, the ActiveX control should be installed, subject to the client's approval. If the client's security settings are set to "Low", then the client's approval is not required. In the case of Internet Explorer version 4+, the client's security settings must be set to "Medium" to allow any ActiveX controls to be installed.

    If the cab file does not have a digital signature, then the security settings for the browser must be set to medium [in IE3] (or low [in IE4 or IE3]). If there is no digital signature and the browser security setting is set to medium, the browser will issue a warning dialog and ask for permission to install the control. If the user responds with "yes", the control will be installed and the panorama should appear in the designated window.

    In addition to the url, the codebase can also include a version number in the form of #Version=a,b,c,d appended to the end of the url. The values of a, b, c, and d identify the lowest version of the control needed for the current web page. If the control is already installed, but the currently installed version is lower than that indicated by a, b, c, d, then a new version of the control will be installed, replacing the previously installed version.

  • The standby parameter specifies a message to be displayed while the ActiveX control is being downloaded and installed. Alternative messages could be "Please wait while the PanoramIX software is installed...", "Make sure your security level is set to medium to allow PanoramIX to be installed.", or "IBM provides the solutions for business on the internet."

  • The panMode, and sprite param lines should be deleted unless you want to enable sphere mode, or to disable sprites.

  • The InitAzim, InitElev, InitFov, and InitRoll param lines should be deleted unless you want to specify an initial azimuth, elevation, field of view, or roll angle. The symbols fAZIM, fELEV, fFOV, and fROLL represent the floating point numerical values to be assigned to these parameters. The roll angle applies only for sphere mode.

  • The embed block (from <embed> to </embed> is ignored by browsers which support activeX controls. If a browser does not recognize ActiveX controls, then it will ignore the <object>, <param>, and </object> tags. If a browser supports Netscape plug-ins, but not ActiveX controls, then the embed block allows the browser to invoke the PanoramIX plug-in for Netscape Navigator, if it is installed.

    The following optional parameters may be included within the embed tag:

            panMode=sphere
            InitAzim=AZIMDEGREES
            InitElev=ELEVDEGREES
            InitFov=FOVDEGREES
            InitRoll=ROLLDEGREES
            
    These parameters support the same functions descriped above for the corresponding parameters for the ActiveX control.

  • The noembed block (from <noembed> to </noembed> is ignored by browsers which support either ActiveX controls or Netscape plug-ins. If a browser does not support ActiveX controls and also does not support Netscape plug-ins, then anything in the noembed block is used as the html source for this part of the web page. This block can include anything you want to tell somone using a browser which does not support either ActiveX controls or Netscape plug-ins.

    In the example given above, a PanoramIX logo is presented. The image file pixlogo.gif must be available for this to work. If the browser is so poor that it cannot even display a gif image, then the alt text is shown as the final resort. As an alternative, one might put an anchor tag with a link to a place from which the user can obtain a copy of MS Internet Explorer or Netscape Navigator. This could be combined with appropriate text to explain what is happening.

    Beware! A client will reach this block only when using and old dumb browser. Such a browser may not be able to handle jpeg images, or any images at all. Keep this section very simple to avoid confusing a stupid browser.


PanoramIX Methods

PanoramIX methods can be invoked from a script by using the object identifier followed by a period and the name of the method. In the case of Internet Explorer, the object identifier is determined by the ID attribute of the <object> tag. For example, if the <object> tag specifies ID="PanoramIX", then the ABC method can be invoked as status="PanoramIX.ABC()". The parentheses are required even if there are no arguments.

In the following examples, the symbol "ObjectID" represents the value of the ID="ObjectID" atttribute of the <object> tag.

In the case of Netscape (ver 4+), the object identifer is specified by the name attribute of the <embed> tag. In addition, the object name must be preceded by "document,". For example, if the <embed> tag specifies name="PanoramIX", then the ABC method can be invoked as "document.PanoramIX.ABC()". The parentheses are required even if there are no arguments. In the following examples, the symbol "ObjectName" represents the value of the name="ObjectName" atttribute of the <embed> tag.

In the case of MS Internet Explorer, these methods may be invoked from scripts written in either javascript or vbscript. In the case of Netscape Navigator/Communicator, the scripts must be written in javascript. Netscape ignores all scripts written in vbscript.

The PanoramIX ActiveX control and the PanoramiX plug-in for Netscape Navigator/Communicator support the following methods.

  • ViewHome()

    This method forces the panorama view to the "home" position defined as azimuth=0, elevation=0, field of view=60 degrees, and roll=0. This method may be invoked as:

    PanStatus = document.ObjectName.ViewHome()

  • SetView(Azim, Elev, Fov, Roll)

    This method forces the panorama view to the specified set of four angles. The Roll angle has no effect unless the panorama is in sphere mode. This method may be invoked by:

    PanStatus = document.ObjectName.SetView(Azim, Elev, Fov, Roll)

  • Azim=GetView() (MSIE v3+ and ActiveX control. For Netscape, see GetAzimuth())

    This method obtains the azimuth, elevation, field of view, and roll angles for the current panorama view orientation. The azimuth angle is returned. The other angles obtained when this method was last invoked are returned by the following three methods.

    This method may be invoked as:

    Azim=ObjectID.GetView()

  • Azim=GetAzimuth() (Netscape version 4+ only. See GetView() for MSIE)

    This method obtains the current azimuth angle in degrees. This method may be invoked as:

    Azim=document.ObjectName.GetAzim()

  • Elev=GetElevation()

    For Internet Explorer version 3 or later, this method returns the elevation angle stored by the most recent preceding use of the GetView() method.> For Netscape (v4+), this method returns the current elevation angle. This method may be invoked as:

    Elev=document.ObjectName.GetElevation()

  • Fov=GetFov()

    For Internet Explorer (v3+), this method returns the field of view angle stored by the most recent preceding use of the GetView() method. For Netscape (v4+), this method returns the current field of view angle. This method may be invoked as:

    Fov=document.ObjectName.GetFieldOfView()

  • Roll=GetRoll()

    For Internet Explorer (v3+), this method returns the roll angle stored by the most recent preceding use of the GetView() method. For Netscape (v4+), this method returns the current roll angle. This method may be invoked as:

    RollAngle=document.ObjectName.GetRoll()

    The roll angle is non-zero only when the panorama when is in sphere mode.

  • LoadPanorama(Message, iMode)

    If the Message argument (a string) begins with "@SPRITE", this method modifies the properties of a designated sprite. Otherwise, this method causes the control or plugin to load the panorama identified by the control file specified in the Message argument. In this case, the iMode argument (an integer) specifies whether to present the new panorama in cylinder mode (iMode=0) or sphere mode (iMode=1).

    This method may be invoked as:

    PanStatus=document.ObjectID.LoadPanorama(Message, iMode)

    If the Message string begins with " @SPRITE", the message string is interpreted just like the @SPRITE link action string. The value of iMode may be used to select a specific pose of the designated sprite. The string " @SPRITE" must be followed by "ID=name", where name is any unique substring of the image file name for any currently defined sprite in the current panorama. This can be followed by any of the following optional fields:

    • Azim=angle, or dAzim=dangle,
    • Elev=angle, or dElev=dangle,
    • Size=factor, or dSize=dfactor,
    • Rate=fps, or dRate=dfps,
    • Dist=depth, or dDist=ddepth,
    • Time=value

    The first form of each parameter specifies an absolute angle in degrees, size factor, rate in frames per second, and so forth. The second form, with the prefix "d", is the incremental form indicating that the specified value is to be added to the current value of the corresponding parameter.

    The Dist value actually represents the inverse distance (1/distance) from the viewer, so depth=0 represents infinite distance from the viewer. To hide a sprite, set Dist to any negative value, such as -1.

    To freeze a sprite, set Rate=0.

    To select a particular pose of a sprite, set Rate=0, Time=-1, and specify the pose with the iMode parameter. Otherwise, ignore the Time parameter, and set the iMode to zero or -1.

These methods can be used with Internet Explorer versions 3+ and with Netscape Navigator/Communicator versions 4+.

The specification of "document." is optional for Internet Explorer, but seems to be required by Netscape Navigator/Communicator. Including this part of the method name allows the same javascript to be used with both Internet Explorer and Netscape Navigator/Communicator.

Several of these methods return a status value indicating success or failure, at least for Internet Explorer. The preceding examples assign this to a variable named "PanStatus". The name is arbitrary, but do not use "status" unless you want this to be reported in the status bar under the browser wndow.


PanoramIX Events

The PanoramIX ActiveX control can generate OnMessage and OnProgress events. The PanoramIX Netscape plug-in can also generate OnMessage events, but not OnProgress events. An html script can respond to these events by providing appropriate event handlers.

In the case of MSIE v3+, an event handler can be implemented in either vbscript or javascript. For vbscript, the event handler may be implemented as a vbscript SUB function with the name given by ObjectID underscore EventName. For example, if the ObjectID is "PanoramIX", then the event handler for the OnMessage event would be named "SUB PanoramIX_OnMessage".

For javascript, an event handler for MSIE version 3 or later must be implemented as a special block of javascript with attributes "for=ObjectID" and "event=EventName(arg)". For example, if the ObjectID is "PanoramIX", then the event handler for the OnMessage event would implemented with a block of javascript identified by the tag

<script language="javascript"
for="PanoramIX" event="OnMessage(msg)" >

Notice that Netscape Navigator/Communicator will not want see the body of the resulting block of javascript code.

In the case of Netscape Navigator/Communicator version 4 or later, the event handler must be implemented in javascript because Netscape does not support vbscript. The javascript event handler may be implemented as a function named for the corresponding event. For example, the event handler for the OnMessage event would be implemented by a javascript function named OnMessage. Unlike the corresponding event handler for MSIE, it is not necessary to put this in a separate block of javascript code, and there is no need or means to identify the particular object generating the event (???).

  • OnMessage(msg)

    These events occur whenever (a) the mouse is used to change the view direction or field of view, or (b) there is a pick (double click) on a hot spot in a panorama.

    In the case of a view direction change, the argument (msg) is given by "@VC".

    In the case of a hot spot double click, the argument (msg) is the link action string associated with the hot spot. These events include all links to other panoramas, playing wave files, and manipulating sprites.

    In the case of MSIE version 3 or later, a vbscript script can handle an OnMessage event by including a function identified as "SUB ObjectID_OnMessage(msg)". Alternatively, this event can be handled with a block of javascript with attributes "for=ObjectID" and event="OnMessage(msg)"

    In the case of Netscape Navigator/Communicator version 4 or later, an event handler for an OnMessage event can be implemented with a javascript function named "OnMessage(msg)".

    In each of these cases, the first statement in each event handler should be a filter to separate all messages which contain "@VC". If msg contains "@VC", the handler can then use the GetView(), GetElevation(), etc. methods to determine the view angles at the time of the event. Otherwise, i.e., msg does not contain "@VC", the handler can interpret the msg string in any manner supported by vbscript or javascript.

  • OnProgress(percent)

    These events occur when files are being downloaded from a server. This is not very useful, and this is not supported on Netscape Navigator/Communicator.

    In the case of MSIE version 3 or later, a vbscript script can handle an OnProgress event by including a function identified as "SUB ObjectID_OnProgress(percent)". Alternatively, this event can be handled with a block of javascript with attributes for="ObjectID" and event="OnProgress(percent)".


Last modified October 19, 1998; October 11, 2001; January 27, 2006.