<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://astronomy.swin.edu.au/s2plot/skins/common/feed.css"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://astronomy.swin.edu.au/s2plot/index.php?feed=atom&amp;title=Special%3ANewpages</id>
		<title>S2PLOT - New pages [en]</title>
		<link rel="self" type="application/atom+xml" href="https://astronomy.swin.edu.au/s2plot/index.php?feed=atom&amp;title=Special%3ANewpages"/>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Special:Newpages"/>
		<updated>2026-04-18T09:07:48Z</updated>
		<subtitle>From S2PLOT</subtitle>
		<generator>MediaWiki 1.6.10</generator>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2scaf</id>
		<title>Function:ss2scaf</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2scaf"/>
				<updated>2011-08-29T05:27:02Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2scaf==&lt;br /&gt;
&lt;br /&gt;
Set the camera position, up vector, view direction and camera rotate/focus point.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ss2scaf(XYZ position, XYZ up, XYZ vdir, XYZ focus, int worldcoords);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Set the camera position, up vector, view direction AND focus (rotate-about) point, all in one shot.  If worldcoords &amp;gt; 0 then caller has given world coordinates, otherwise viewport coordinates are used.  It is up to the caller to ensure a self-consistent camera position is given (orthogonal vectors).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sc | ss2sc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera position, up vector and view direction.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qc | ss2qc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sca | ss2sca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qca | ss2qca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2scs | ss2scs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qcs | ss2qcs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   XYZ pos;                                     /* Camera position */&lt;br /&gt;
   XYZ up;                                      /* Camera up vector */&lt;br /&gt;
   XYZ view;                                    /* Camera view vector */&lt;br /&gt;
   XYZ focus;&lt;br /&gt;
   int wc = 1;                                  /* Use world coordinates */&lt;br /&gt;
   int i, N = 20;                               /* Loop variables */&lt;br /&gt;
   float x, y, z;                               /* Temporary data */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      x = drand48()*2.0 - 1.0;                  /* Random positions */&lt;br /&gt;
      y = drand48()*2.0 - 1.0;&lt;br /&gt;
      z = drand48()*2.0 - 1.0;&lt;br /&gt;
      s2sci(15*drand48()+1);                    /* Random colour */&lt;br /&gt;
      s2pt1(x, y, z, 1);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   pos.x  = 0.0; pos.y  = 0.0; pos.z  = 8.0;&lt;br /&gt;
   up.x   = 0.0; up.y   = 1.0; up.z   = 0.0;&lt;br /&gt;
   view.x = 0.0; view.y = 0.0; view.z = -1.0;&lt;br /&gt;
   focus.x = 0.0; focus.y = 0.0; focus.z = 1.0;&lt;br /&gt;
   ns2thpoint(focus.x, focus.y, focus.z, 1,1,1, 8);&lt;br /&gt;
&lt;br /&gt;
   ss2scaf(pos, up, view, focus, wc);           /* Set new camera position */&lt;br /&gt;
   ss2sas(1);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2qpr</id>
		<title>Function:ss2qpr</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2qpr"/>
				<updated>2011-08-29T05:24:40Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2qpr==&lt;br /&gt;
Query point to rotate camera about.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ss2qpr(XYZ *position, int worldcoords);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Query the point to rotate about camera and geometry about.  Fortunately or unfortunately, this is not guaranteed to be the same as the focus point (what the camera is looking at); the meanings are mixed and need to be disentangled.  For now, we allow querying of this point independent of the focus point, as it is needed for some things like GPU-based volume rendering. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2scf | ss2scf]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera mid/focus point. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2scf | ss2scf]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Unset the camera mid/focus point - return to auto mid-point &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
/* Dynamic callback function */&lt;br /&gt;
{&lt;br /&gt;
   XYZ rot;&lt;br /&gt;
   int wc = 1;                          /* Use world coordinates */&lt;br /&gt;
   XYZ off = { 0.01, 0.01, 0.0 };       /* Small offset for text */&lt;br /&gt;
&lt;br /&gt;
   int set;&lt;br /&gt;
   char string[255];&lt;br /&gt;
   s2sch(0.05);                         /* Set the text height */&lt;br /&gt;
   if (*kc%2 == 0) {&lt;br /&gt;
      ss2qpr(&amp;amp;rot, wc);                 /* Query the rotation point */&lt;br /&gt;
      sprintf(string,&amp;quot;Rotation about (%.2f, %.2f, %.2f)&amp;quot;,rot.x,rot.y,rot.z);&lt;br /&gt;
      XYZ xyz = { 0.5, 0.5, 0.5 };&lt;br /&gt;
      ss2scf(xyz, wc);                  /* Set the camera focus */&lt;br /&gt;
   } else {&lt;br /&gt;
      ss2qcf(&amp;amp;set, &amp;amp;rot, wc);           /* Query the camera focus */&lt;br /&gt;
      sprintf(string,&amp;quot;Focus at (%.2f, %.2f, %.2f)&amp;quot;,rot.x,rot.y,rot.z);&lt;br /&gt;
   }&lt;br /&gt;
   ds2vtb(rot, off,string,1);           /* Write some dynamic billboard text */&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;lt;space&amp;gt; to toggle mode&amp;quot;);&lt;br /&gt;
                                        /* Display an instructional label */&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i;                               /* Loop variable */&lt;br /&gt;
   XYZ xyz;                             /* Coordinate for plotting points */&lt;br /&gt;
   COLOUR col;                          /* Colour of plotted points */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/S2MONO&amp;quot;,argc,argv);        /* Query the s2plot device to use */&lt;br /&gt;
   s2swin(-1.,1.,-1.,1.,-1.,1.);        /* Set the world coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw a coordinate box */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));           /* Seed the random number generator */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;1000;i++) {               /* Generate and plot random points */&lt;br /&gt;
      xyz.x = drand48()*2.0 - 1.0;      /*  with random colours */&lt;br /&gt;
      xyz.y = drand48()*2.0 - 1.0;&lt;br /&gt;
      xyz.z = drand48()*2.0 - 1.0;&lt;br /&gt;
      col.r = drand48();&lt;br /&gt;
      col.g = drand48();&lt;br /&gt;
      col.b = drand48();&lt;br /&gt;
      ns2vpoint(xyz, col);&lt;br /&gt;
   }&lt;br /&gt;
   ss2sas(1);                           /* Start the geometry auto-spinning */&lt;br /&gt;
   cs2scb(cb);                          /* Install a dynamic callback */&lt;br /&gt;
   s2show(1);                           /* Display the geometry */&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2sevas</id>
		<title>Function:ns2sevas</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2sevas"/>
				<updated>2011-08-29T05:22:12Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2sevas==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2sevas(float sx, float sy, float sz);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Provides support for explicitly setting alpha scaling values for a volume rendering object, overriding the default alpha scaling mode if axis values are &amp;gt; 0.0&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2svas | ns2svas]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set alpha scaling mode. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2qvas | ns2qvas]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query alpha scaling mode. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvr | ns2cvr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a volume rendering object. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvra| ns2cvra ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Render volume of objects. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Global variables */&lt;br /&gt;
int vid;                                /* ID for volume render object */&lt;br /&gt;
float tr[12];                           /* Transformation matrix */&lt;br /&gt;
float ***volume;                        /* The data cube */&lt;br /&gt;
int nx, ny, nz;                         /* Data grid dimensions */&lt;br /&gt;
&lt;br /&gt;
float ***initVolume(int nx, int ny, int nz)&lt;br /&gt;
/* Allocate memory and initialise a data cube */&lt;br /&gt;
{&lt;br /&gt;
   float ***volume;&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
&lt;br /&gt;
   volume = (float ***)malloc(nx * sizeof(float **));&lt;br /&gt;
   if (volume == NULL) {&lt;br /&gt;
      fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float **)));&lt;br /&gt;
      exit(-1);&lt;br /&gt;
   }&lt;br /&gt;
   for (i=0;i&amp;lt;nx;i++) {&lt;br /&gt;
      volume[i] = (float **)malloc(ny * sizeof(float *));&lt;br /&gt;
      if (volume[i] == NULL) {&lt;br /&gt;
         fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float *)));&lt;br /&gt;
         exit(-1);&lt;br /&gt;
      }&lt;br /&gt;
      for (j=0;j&amp;lt;ny;j++) {&lt;br /&gt;
         volume[i][j] = (float *)malloc(nz * sizeof(float));&lt;br /&gt;
         if (volume[i][j] == NULL) {&lt;br /&gt;
            fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float)));&lt;br /&gt;
            exit(-1);&lt;br /&gt;
         }&lt;br /&gt;
         for (k=0;k&amp;lt;nz;k++) {&lt;br /&gt;
            volume[i][j][k] = 0.0;              /* Initialise */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return volume;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
/* A dynamic callback */&lt;br /&gt;
{&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt;space&amp;gt; to toggle opactiy mode for volume rendering&amp;quot;);&lt;br /&gt;
   float sx, sy, sz;                    /* Opacity scale factors */&lt;br /&gt;
&lt;br /&gt;
   if (*kc % 2 == 1 ) {&lt;br /&gt;
      sx = (float)nz/(float)nx;&lt;br /&gt;
      sy = (float)nz/(float)ny;&lt;br /&gt;
      sz = 1.0;                         /* Shortest axis gets highest opacity scale */&lt;br /&gt;
      ns2sevas(sx,sy,sz);               /* Set the opacity scaling */&lt;br /&gt;
   } else {&lt;br /&gt;
      ns2sevas(1.,1.,1.);               /* Set the opacity scaling */&lt;br /&gt;
   }&lt;br /&gt;
   ds2dvr(vid, 1);                      /* Draw the volume render object */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
   float dmin, dmax, amin, amax;                /* Min/max values */&lt;br /&gt;
   char trans;                                  /* Transparency mode */&lt;br /&gt;
   float x1 = -1.0, x2 = +1.0;                  /* Data range along axes */&lt;br /&gt;
   float y1 = -1.0, y2 = +1.0;&lt;br /&gt;
   float z1 = -1.0, z2 = +1.0;&lt;br /&gt;
   int vi, vj, vk;                              /* Temporary variables */&lt;br /&gt;
   float dx, dy, dz;                            /* Temporary variables */&lt;br /&gt;
   COLOUR amb = {0.8, 0.8, 0.8};                /* Ambient light */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   nx = 40; ny = 40; nz = 10;                   /* Dimensions of data cube */&lt;br /&gt;
   volume = initVolume(nx, ny, nz);             /* Allocate memory */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;12;i++) {                         /* Set-up transfrom matrix */&lt;br /&gt;
      tr[i] = 0.0;&lt;br /&gt;
   }&lt;br /&gt;
   tr[ 0]  = x1;                                /* Mapping from data cube */&lt;br /&gt;
   tr[ 1]  = (x2-x1)/(float)(nx-1.0);           /* to physical coordinates */&lt;br /&gt;
   tr[ 4]  = y1;&lt;br /&gt;
   tr[ 6]  = (y2-y1)/(float)(ny-1.0);&lt;br /&gt;
   tr[ 8]  = z1;&lt;br /&gt;
   tr[11]  = (z2-z1)/(float)(nz-1.0);&lt;br /&gt;
&lt;br /&gt;
   dmin = 0.0;                  /* Mininum data value in volume to plot */&lt;br /&gt;
   dmax = 2.0;                  /* Maximum data value in volume to plot */&lt;br /&gt;
   amin = 0.0;                  /* Minimum alpha channel value */&lt;br /&gt;
   amax = 0.8;                  /* Maximum alpha channel value */&lt;br /&gt;
   trans = 't';                 /* Transparency type */&lt;br /&gt;
&lt;br /&gt;
   dx = tr[1]*0.5;              /* Offsets for window - voxels are pixel */&lt;br /&gt;
   dy = tr[6]*0.5;              /*  centred */&lt;br /&gt;
   dz = tr[11]*0.5;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/S2MONO&amp;quot;,argc,argv);                        /* Open the display */&lt;br /&gt;
   s2swin(x1-dx,x2+dx, y1-dy,y2+dy, z1-dz,z2+dz);       /* Set window coords */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);             /* Draw coord box */&lt;br /&gt;
&lt;br /&gt;
   long N = 5000;&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {                  /* Create N random (x,y,z) values */&lt;br /&gt;
      vi = (int)(drand48()*(nx));&lt;br /&gt;
      vj = (int)(drand48()*(ny));&lt;br /&gt;
      vk = (int)(drand48()*(nz));&lt;br /&gt;
&lt;br /&gt;
      volume[vi][vj][vk]+=1.0-drand48()*drand48();&lt;br /&gt;
                                        /* Give a value to volume */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2scir(1000,2000);                   /* Set colour range */&lt;br /&gt;
   s2icm(&amp;quot;mgreen&amp;quot;,1000,2000);           /* Install colour map */&lt;br /&gt;
   vid = ns2cvr(volume, nx, ny, nz, 0, nx-1, 0, ny-1, 0, nz-1,&lt;br /&gt;
                tr, trans, dmin, dmax, amin, amax);&lt;br /&gt;
                                        /* Create the volume render object */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                          /* Install a dynamic callback */&lt;br /&gt;
   ss2srm(SHADE_FLAT);                  /* Set shading type to FLAT */&lt;br /&gt;
   ss2sl(amb, 0, NULL, NULL, 0);        /* Ambient lighting only */&lt;br /&gt;
&lt;br /&gt;
   ss2sas(1);                           /* Start the cube spinning */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vf3nca</id>
		<title>Function:ns2vf3nca</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vf3nca"/>
				<updated>2011-08-29T03:43:42Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vf3nca==&lt;br /&gt;
&lt;br /&gt;
3-vertex facet with coloured vertices, normals and alpha per vertex given.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vf3nca(XYZ *P, XYZ *N, COLOUR *col, char trans, float *alf);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Complete control of 3-vertex facets is achieved with this function. Draws a 3-vertex facet with coloured vertices, with normals, and per vertex alpha transparency value for the facet. The vertices are given by the array P, normals are in the array N, and the RGB colours for vertices are in col. &lt;br /&gt;
Transparency parameter trans is one of 'o' (opaque), 't' (addition blend - never gets dimmer) or 's' (standard blend, can get dimmer),  and the alpha values in the range [0,1] are stored in array alf.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3 | ns2vf3 ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with single colour and automatic normals. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3n | ns2vf3n ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with single colour and normals given. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3c | ns2vf3c ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with coloured vertices and autmoatic normals. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3a | ns2vf3a ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with transparency &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:struct_COLOUR | struct_COLOUR ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Data structure for (r,g,b) colour indices. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:struct_XYZ | struct_XYZ ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Data structure for (x,y,z) coordinates. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   XYZ vertex[3];                               /* 3 vertices */&lt;br /&gt;
   XYZ normal[3];                               /* 3 vertices */&lt;br /&gt;
   float alpha[3];                              /* 3 vertices */&lt;br /&gt;
   COLOUR col[3];                               /* 3 vertices */&lt;br /&gt;
   char trans = 't';                            /* Transparency type */&lt;br /&gt;
   int i;&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;3;i++) {&lt;br /&gt;
      vertex[i].x = drand48()*2.0 - 1.0;        /* Random corners to facet */&lt;br /&gt;
      vertex[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
      vertex[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
      normal[i].x = drand48()*2.0 - 1.0;        /* Random normal for facet */&lt;br /&gt;
      normal[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
      normal[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
      col[i].r = drand48();                     /* Random colour for vertex */&lt;br /&gt;
      col[i].g = drand48();&lt;br /&gt;
      col[i].b = drand48();&lt;br /&gt;
   }&lt;br /&gt;
   alpha[0] = 0.0;                              /* Set alpha channels for each */&lt;br /&gt;
   alpha[1] = 0.5;                              /*   vertex */&lt;br /&gt;
   alpha[2] = 1.0;&lt;br /&gt;
   ns2vf3nca(vertex, normal, col, trans, alpha);&lt;br /&gt;
                        /* Draw polygon with defined normals, vertex colours */&lt;br /&gt;
                        /* and vertex transparencies */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vf3na</id>
		<title>Function:ns2vf3na</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vf3na"/>
				<updated>2011-08-29T03:35:34Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vf3na==&lt;br /&gt;
&lt;br /&gt;
Transparent 3-vertex facet with coloured vertices, normals and alpha given. &lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vf3na(XYZ *P, XYZ *N, COLOUR col, char trans, float alpha);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Function for drawing a 3-vertex facet with coloured vertices, with normals, and a single alpha transparency value for the facet. The vertices are given by the array P, normals are in the array N, and the RGB colours for vertices are in col. &lt;br /&gt;
Transparency parameter trans is one of 'o' (opaque), 't' (addition blend - never gets dimmer) or 's' (standard blend, can get dimmer),  and the alpha value is in the range [0,1].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3 | ns2vf3 ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with single colour and automatic normals. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3n | ns2vf3n ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with single colour and normals given. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3c | ns2vf3c ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with coloured vertices and autmoatic normals. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vf3a | ns2vf3a ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3-vertex facet with transparency &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:struct_COLOUR | struct_COLOUR ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Data structure for (r,g,b) colour indices. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:struct_XYZ | struct_XYZ ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Data structure for (x,y,z) coordinates. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   XYZ vertex[3];                               /* 3 vertices */&lt;br /&gt;
   XYZ normal[3];                               /* 3 vertices */&lt;br /&gt;
   COLOUR col;                                  /* Polygon colour */&lt;br /&gt;
   char trans = 't';                            /* Transparency type */&lt;br /&gt;
   float alpha = 0.7;                           /* Alpha channel value */&lt;br /&gt;
   int i;&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;3;i++) {&lt;br /&gt;
      vertex[i].x = drand48()*2.0 - 1.0;        /* Random corners to facet */&lt;br /&gt;
      vertex[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
      vertex[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
      normal[i].x = drand48()*2.0 - 1.0;        /* Random normal for facet */&lt;br /&gt;
      normal[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
      normal[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   col.r = drand48();                           /* Random colour for polygon*/&lt;br /&gt;
   col.g = drand48();&lt;br /&gt;
   col.b = drand48();&lt;br /&gt;
   ns2vf3na(vertex, normal, col, trans, alpha);&lt;br /&gt;
                        /* Draw polygon with specified vertices, normals, */&lt;br /&gt;
                        /*  colour and single alpha channel */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2funuva</id>
		<title>Function:s2funuva</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2funuva"/>
				<updated>2011-08-29T02:24:15Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==s2funuva==&lt;br /&gt;
&lt;br /&gt;
Plot a parametric function (generally a surface) defined by functions fx(u,v), fy(u,v) and fz(u,v) with transparency.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void s2funuva(float(*fx)(float*, float*), float(*fy)(float*, float*), float(*fz)(float*, float*), &lt;br /&gt;
float(*fcol)(float*,float*), char trans, float(*falpha)(float*, float*),&lt;br /&gt;
float umin, float umax, int uDIV, float vmin, float vmax, int vDIV);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Plot the parametric function (generally a surface) defined by { (fx(u,v), fy(u,v), fz(u,v) }, coloured by fcol(u,v) with fcol required to fall in the range [0,1].  fcol is then mapped to the current colormap index range (set with s2scir). Transparency is applied to the surface with falpha(u,v), defining the opacity in the range [0,1].   The range of u and v values are specified by umin,umax and vmin, vmax, and the number of divisions by uDIV and vDIV. &lt;br /&gt;
&lt;br /&gt;
For a constant opacity, implement falpha(u,v){return const_value;}.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2scir | s2scir ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the range of colour indices used for shading. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2funuv| s2funuv ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Plot a parametric function. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define LIMIT 0.7&lt;br /&gt;
#define pi 3.14159265359&lt;br /&gt;
&lt;br /&gt;
/* amplitude, number of twists, major radius, minor radius */&lt;br /&gt;
#define AMP 0.4         /* Amplitude */&lt;br /&gt;
#define NTW 1.5         /* Number of twists */&lt;br /&gt;
#define R1 2.0          /* Major radius */&lt;br /&gt;
#define R2 0.5          /* Minor radius */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* Parametric functions for surface */&lt;br /&gt;
inline float tkx(float *u, float *v) {&lt;br /&gt;
  return R2 * cos(*v) * cos(*u) + R1 * cos(*u) * (1. + AMP * cos(*u * NTW));&lt;br /&gt;
}&lt;br /&gt;
inline float tky(float *u, float *v) {&lt;br /&gt;
  return R2 * sin(*v) + AMP * sin(*u * NTW);&lt;br /&gt;
}&lt;br /&gt;
inline float tkz(float *u, float *v) {&lt;br /&gt;
  return R2 * cos(*v) * sin(*u) + R1 * sin(*u) * (1. + AMP * cos(*u * NTW));&lt;br /&gt;
}&lt;br /&gt;
inline float fcol(float *u, float *v) {&lt;br /&gt;
  return 0.5 + sin(0.5 * *u) * AMP * sin(*v);&lt;br /&gt;
}&lt;br /&gt;
inline float falpha(float *u, float *v) {&lt;br /&gt;
   if ((*v) &amp;lt; pi) return 0.0;&lt;br /&gt;
   else return 1.0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   float x1 = -LIMIT, x2 = LIMIT;               /* x world coord range */&lt;br /&gt;
   float y1 = -LIMIT, y2 = LIMIT;               /* y world coord range */&lt;br /&gt;
   float z1 = -LIMIT, z2 = LIMIT;               /* z world coord range */&lt;br /&gt;
   char trans = 't';                            /* Transparency type */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(x1, x2, y1, y2, z1, z2);              /* Set the window coordinates */&lt;br /&gt;
&lt;br /&gt;
   s2icm(&amp;quot;rainbow&amp;quot;, 100, 500);                  /* Install colour map */&lt;br /&gt;
   s2scir(100, 500);                            /* Set colour range */&lt;br /&gt;
&lt;br /&gt;
   s2funuva(tkx, tky, tkz, fcol, trans, falpha, 0., 4.*pi, 320, 0., 2.*pi, 90);&lt;br /&gt;
                                /* call the parametric surface function */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2qwc</id>
		<title>Function:s2qwc</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2qwc"/>
				<updated>2011-08-29T02:13:34Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==s2qwc==&lt;br /&gt;
Query the window clipping mode.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
int s2qwc(void);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Query whether clipping is being applied to geometry.  When enabled, clipping means points not within the world coordinate bounds as defined by the most recent call to s2swin, will not be drawn.  The initial implementation applies to points only, future work may apply the clipping to lines and facets as well. Enable/disable/toggle (1,0,-1) clipping.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2twc | s2twc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the window clipping mode.&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int N = 100;                                 /* Number of points */&lt;br /&gt;
   static int flag = -1;                        /* Flag for initialisation */&lt;br /&gt;
   static XYZ xyz[100];                         /* Array of point positions */&lt;br /&gt;
   static COLOUR col[100];                      /* Array of colours */&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
&lt;br /&gt;
   if (flag &amp;lt; 0) {                              /* First time through? */&lt;br /&gt;
      for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
         xyz[i].x = drand48()*2.0 - 1.0;        /* Random data positions */&lt;br /&gt;
         xyz[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
         xyz[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
         col[i].r = drand48();                  /* Random data colours */&lt;br /&gt;
         col[i].g = drand48();&lt;br /&gt;
         col[i].b = drand48();&lt;br /&gt;
      }&lt;br /&gt;
      flag = 1;                                 /* Set the flag */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2swin(-0.8,0.8,-0.8,0.8,-0.8,0.8);          /* Set new plotting window */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      ns2vthpoint(xyz[i], col[i], 3);           /* Draw the point */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   if (*kc % 2 == 1)                            /* Check for keyboard press */&lt;br /&gt;
      s2twc(1);                                 /* Turn on clipping */&lt;br /&gt;
   else&lt;br /&gt;
      s2twc(0);                                 /* Turn off clipping */&lt;br /&gt;
&lt;br /&gt;
   int wc = s2qwc();                            /* Query clipping state */&lt;br /&gt;
   char text[32];&lt;br /&gt;
   sprintf(text, &amp;quot;Clipping state: %d\n&amp;quot;,wc);    /* Prepare a text string */&lt;br /&gt;
   s2textxy(0.0,0.0,0.0, text);                 /* Display text string */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt;space&amp;gt; to toggle clipping state&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2twc</id>
		<title>Function:s2twc</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2twc"/>
				<updated>2011-08-29T02:12:06Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==s2twc==&lt;br /&gt;
Set the window clipping mode.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void s2twc(int enabledisable);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set whether clipping is being applied to geometry.  When enabled, clipping means points not within the world coordinate bounds as defined by the most recent call to s2swin, will not be drawn.  The initial implementation applies to points only, future work may apply the clipping to lines and facets as well. Enable/disable/toggle (1,0,-1) clipping.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2qwc | s2qwc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the window clipping mode.&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int N = 100;                                 /* Number of points */&lt;br /&gt;
   static int flag = -1;                        /* Flag for initialisation */&lt;br /&gt;
   static XYZ xyz[100];                         /* Array of point positions */&lt;br /&gt;
   static COLOUR col[100];                      /* Array of colours */&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
&lt;br /&gt;
   if (flag &amp;lt; 0) {                              /* First time through? */&lt;br /&gt;
      for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
         xyz[i].x = drand48()*2.0 - 1.0;        /* Random data positions */&lt;br /&gt;
         xyz[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
         xyz[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
         col[i].r = drand48();                  /* Random data colours */&lt;br /&gt;
         col[i].g = drand48();&lt;br /&gt;
         col[i].b = drand48();&lt;br /&gt;
      }&lt;br /&gt;
      flag = 1;                                 /* Set the flag */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2swin(-0.8,0.8,-0.8,0.8,-0.8,0.8);          /* Set new plotting window */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      ns2vthpoint(xyz[i], col[i], 3);           /* Draw the point */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   if (*kc % 2 == 1)                            /* Check for keyboard press */&lt;br /&gt;
      s2twc(1);                                 /* Turn on clipping */&lt;br /&gt;
   else&lt;br /&gt;
      s2twc(0);                                 /* Turn off clipping */&lt;br /&gt;
&lt;br /&gt;
   int wc = s2qwc();                            /* Query clipping state */&lt;br /&gt;
   char text[32];&lt;br /&gt;
   sprintf(text, &amp;quot;Clipping state: %d\n&amp;quot;,wc);    /* Prepare a text string */&lt;br /&gt;
   s2textxy(0.0,0.0,0.0, text);                 /* Display text string */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt;space&amp;gt; to toggle clipping state&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2ltt</id>
		<title>Function:ss2ltt</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2ltt"/>
				<updated>2009-01-27T03:26:32Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2ltt==&lt;br /&gt;
&lt;br /&gt;
Create a texture with LATEX commands.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
unsigned int ss2ltt(char *latexcmd, float *aspect);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Create a texture with LaTeX commands contained in the string latexcmd. The return value is the texture handle (as used by eg. ns2vf4xt etc). The x:y aspect ratio of the texture map is returned in aspect. &lt;br /&gt;
&lt;br /&gt;
This function assumes that LaTeX is installed on your system in the location indicated by the environment variable S2PLOT_LATEXBIN. &lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2lt | ss2lt ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Load a texture for future (generally repeated) use. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2ftt | ss2ftt ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Use a named freetype font to create a texture map.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   char *latexcmd = &amp;quot;$f(x) = \\Sigma^{\\infty}_{i=0} a_i \\sin(2\\pi x)$&amp;quot;;&lt;br /&gt;
   XYZ pos[4];					/* Vertices for texture */&lt;br /&gt;
   COLOUR col = { 1.0, 1.0, 1.0 };		/* Polygon colour */&lt;br /&gt;
   float aspect;				/* Aspect ratio */&lt;br /&gt;
   unsigned int id;					/* Texture id */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);			/* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);		/* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);	/* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   id = ss2ltt(latexcmd, &amp;amp;aspect);		/* Create latex texture */&lt;br /&gt;
	/* Must have S2PLOT_LATEXBIN environment variable correctly set */&lt;br /&gt;
&lt;br /&gt;
   aspect = 1.0/aspect;&lt;br /&gt;
&lt;br /&gt;
   pos[0].x = -1.0; pos[0].y = +aspect; pos[0].z = 0.0;&lt;br /&gt;
   pos[1].x = +1.0; pos[1].y = +aspect; pos[1].z = 0.0;&lt;br /&gt;
   pos[2].x = +1.0; pos[2].y = -aspect; pos[2].z = 0.0;&lt;br /&gt;
   pos[3].x = -1.0; pos[3].y = -aspect; pos[3].z = 0.0;&lt;br /&gt;
&lt;br /&gt;
   ns2vf4x(pos, col, id, 1.0, 'o');		/* Draw the texture */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);					/* Open the s2plot window */&lt;br /&gt;
   &lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2ftt</id>
		<title>Function:ss2ftt</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2ftt"/>
				<updated>2009-01-27T03:24:24Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2ftt==&lt;br /&gt;
Use a named freetype font to create a texture map.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
unsigned int ss2ftt(char *fontfilename, char *text, int fontsizepx, int border);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Load a named freetype font, where fontfilename includes the full pathname to the font, to generate a texture map from the input text.  Argument fontsizepx controls the font size, and an optional border can be drawn around the text using border &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
This function is only available if the [[S2PLOT:Environment_Variables | S2FREETYPE]] environment variable has been set to 'yes'.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2lt | ss2lt ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Load a texture for future (generally repeated) use. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2ltt | ss2ltt ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a texture with LATEX commands.. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int tid;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   XYZ xyz = {0.0, 0.3, 0.4};                           /* Location */&lt;br /&gt;
   float isize = 0.02;                                  /* Texture scale */&lt;br /&gt;
   XYZ str = { 0.0, 0.0, 0.0};                          /* No stretch */&lt;br /&gt;
   COLOUR col = { 1.0, 1.0, 0.0 };                      /* Yellow */&lt;br /&gt;
   float alpha = 0.9;                                   /* Alpha channel */&lt;br /&gt;
   char trans = 's';                                    /* Transparency */&lt;br /&gt;
&lt;br /&gt;
   ds2vbb(xyz, str, isize, col, tid, alpha, trans);     /* Draw the billboard */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the display */&lt;br /&gt;
   s2svp(-1.0,1.0, -1.0,1.0, -1.0,1.0);         /* Set the viewport coords */&lt;br /&gt;
   s2swin(-1.0,1.0, -1.0,1.0, -1.0,1.0);        /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw a bounding box */&lt;br /&gt;
&lt;br /&gt;
   char font[64];                               /* Allocate font name string */&lt;br /&gt;
&lt;br /&gt;
   sprintf(font,&amp;quot;/Library/Fonts/Arial Black&amp;quot;);  /* Path to font */&lt;br /&gt;
                        /* NOTE: This depends on your local system config */&lt;br /&gt;
&lt;br /&gt;
   tid = ss2ftt(font,&amp;quot;s2plot&amp;quot;,32,4);          /* Create the texture */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(&amp;amp;cb);                                 /* Install a callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:cs2srcb</id>
		<title>Function:cs2srcb</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:cs2srcb"/>
				<updated>2009-01-07T00:28:03Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==cs2srcb==&lt;br /&gt;
Register when remote control data is received. &lt;br /&gt;
==Prototype==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void cs2srcb(void *remcb);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Register function that is called when remote control data comes in.  This function can consume the event (by returning 1) to prevent further (built-in) handling by S2PLOT.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:cs2socb |cs2socb]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Register function that will draw direct OpenGL graphics when called.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2ldev |s2ldev]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;List the available S2PLOT devices on stdout.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2disp |s2disp]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw the scene, but return control when a timeout occurs or when shift-ENTER is pressed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2show | s2show ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw the scene and enter interactive mode if interactive is non-zero. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sample Code==&lt;br /&gt;
&lt;br /&gt;
Some additional steps are required to get the remote callback to function.  After you have compiled the sample code, you will need to follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. In the terminal/shell you are planning to run the executable in (cs2srcb), type&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv S2PLOT_REMOTEPORT 3333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that you can use another port number instead of 3333 if required.&lt;br /&gt;
&lt;br /&gt;
2. Run the code&lt;br /&gt;
&lt;br /&gt;
3. In another terminal/shell type the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
telnet localhost 3333&lt;br /&gt;
S2 setcolor 0.9,0.1,0.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. The polygon/billboard should now change colour.&lt;br /&gt;
&lt;br /&gt;
5. Quitting the executable (shift-Q) should close the terminal session.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int tid;&lt;br /&gt;
&lt;br /&gt;
float _bb_r, _bb_g, _bb_b;&lt;br /&gt;
&lt;br /&gt;
int remote_cb(char *data);&lt;br /&gt;
void cb(double *t, int *kc);&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int width = 16, height = 16;         /* Dimensions of texture */&lt;br /&gt;
   int i, j;                            /* Loop variables */&lt;br /&gt;
   int idx;                             /* Index into texture array */&lt;br /&gt;
   unsigned char *tex;                          /* Array of texture values */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the display */&lt;br /&gt;
   s2svp(-1.0,1.0, -1.0,1.0, -1.0,1.0);         /* Set the viewport coords */&lt;br /&gt;
   s2swin(-1.0,1.0, -1.0,1.0, -1.0,1.0);        /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw a bounding box */&lt;br /&gt;
&lt;br /&gt;
   tid = ss2ct(width, height);          /* Create a new texture */&lt;br /&gt;
   tex = ss2gt(tid, &amp;amp;width, &amp;amp;height);   /* Get the texture */&lt;br /&gt;
&lt;br /&gt;
   for (j=0;j&amp;lt;height;j++) {&lt;br /&gt;
      for (i=0;i&amp;lt;width;i++) {&lt;br /&gt;
         idx = (j*width + i) * 4;               /* Stored as (r,g,b,alpha) */&lt;br /&gt;
         tex[idx  ] = 255;                      /* solid red */&lt;br /&gt;
         tex[idx+1] = 255;                      /* Green */&lt;br /&gt;
         tex[idx+2] = 255;                      /* Blue */&lt;br /&gt;
         tex[idx+3] = 127 * drand48()+128;      /* Random transparency */&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   ss2pt(tid);                          /* Push texture for usage */&lt;br /&gt;
&lt;br /&gt;
   _bb_g = 0.7;&lt;br /&gt;
   _bb_b = 0.9;&lt;br /&gt;
&lt;br /&gt;
   cs2scb(&amp;amp;cb);                         /* Install a callback */&lt;br /&gt;
   cs2srcb(&amp;amp;remote_cb);                 /* Install remote callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   float x = 0.0, y = 0.3, z = 0.4;                     /* Location */&lt;br /&gt;
   float isize = 0.02;                                  /* Texture scale */&lt;br /&gt;
   float str_x = 0.0, str_y = 0.0, str_z = 0.0;         /* No stretch */&lt;br /&gt;
   float alpha = 0.9;                                   /* Alpha channel */&lt;br /&gt;
   char trans = 't';                                    /* Transparency */&lt;br /&gt;
&lt;br /&gt;
   ds2bb(x,y,z, str_x,str_y,str_z, isize, _bb_r, _bb_g, _bb_b, tid, alpha, trans);&lt;br /&gt;
                                        /* Draw the billboard */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int remote_cb(char *data) {&lt;br /&gt;
  // this remote callback will receive strings coming in on&lt;br /&gt;
  // the S2PLOT_REMOTEPORT port.&lt;br /&gt;
&lt;br /&gt;
  char *contype, *ctype, *cargs;&lt;br /&gt;
&lt;br /&gt;
  contype = strtok(data, &amp;quot; &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // for this demo, we will only parse commands preceded by &amp;quot;S2&amp;quot;&lt;br /&gt;
  if (!contype || strcmp(contype, &amp;quot;S2&amp;quot;)) {&lt;br /&gt;
    // return 0 to indicate we have not &amp;quot;consumed&amp;quot; this event&lt;br /&gt;
    fprintf(stderr, &amp;quot;remote_cb: no valid command prefix\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  ctype = strtok(NULL, &amp;quot; &amp;quot;);&lt;br /&gt;
  if (!ctype) {&lt;br /&gt;
    fprintf(stderr, &amp;quot;remote_cb: no command present\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  int consumed = 0;&lt;br /&gt;
&lt;br /&gt;
  // the only command we accept is &amp;quot;setcolor&amp;quot; to set the&lt;br /&gt;
  // billboard color&lt;br /&gt;
  if (!strcmp(ctype, &amp;quot;setcolor&amp;quot;)) {&lt;br /&gt;
    cargs = strtok(NULL, &amp;quot; &amp;quot;);&lt;br /&gt;
    if (!cargs) {&lt;br /&gt;
      fprintf(stderr, &amp;quot;remote_cb: no argument for setcolor present\n&amp;quot;);&lt;br /&gt;
      return 0;&lt;br /&gt;
    }&lt;br /&gt;
    float vr, vg, vb;&lt;br /&gt;
    sscanf(cargs, &amp;quot;%f,%f,%f&amp;quot;, &amp;amp;vr, &amp;amp;vg, &amp;amp;vb);&lt;br /&gt;
&lt;br /&gt;
    if ((vr &amp;gt;= 0.) &amp;amp;&amp;amp; (vr &amp;lt;= 1.) &amp;amp;&amp;amp;&lt;br /&gt;
        (vg &amp;gt;= 0.) &amp;amp;&amp;amp; (vg &amp;lt;= 1.) &amp;amp;&amp;amp;&lt;br /&gt;
        (vb &amp;gt;= 0.) &amp;amp;&amp;amp; (vb &amp;lt;= 1.)) {&lt;br /&gt;
      _bb_r = vr;&lt;br /&gt;
      _bb_g = vg;&lt;br /&gt;
      _bb_b = vb;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    consumed = 1;&lt;br /&gt;
  } else {&lt;br /&gt;
    fprintf(stderr, &amp;quot;remote_cb: unknown command %s\n&amp;quot;, ctype);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return consumed;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ds2bbset</id>
		<title>Function:ds2bbset</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ds2bbset"/>
				<updated>2009-01-06T22:28:59Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ds2bbset==&lt;br /&gt;
Draw a set of billboards.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ds2bbset(float *verts, float *cols, float size,&lt;br /&gt;
	      unsigned int texid, char trans, int n);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a set of billboards.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbp | ds2vbbp]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Billboard with aspect ratio - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbpr | ds2vbbpr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Billboard with aspect ratio, offset in screen coords, and rotation of texture - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2bb | ds2bb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard: a textured facet that always faces the camera. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbb | ds2vbb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard: a textured facet that always faces the camera - vector input &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbr | ds2vbbr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard texture with specified rotation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2tb | ds2tb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw text that always faces the camera &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vtb | ds2vtb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw text that always faces the camera - vector input &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ds2vbbpr</id>
		<title>Function:ds2vbbpr</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ds2vbbpr"/>
				<updated>2009-01-06T22:28:43Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ds2vbbpr==&lt;br /&gt;
Billboard with aspect ratio, offset in screen coords, and rotation of texture - vector input.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ds2vbbpr(XYZ iP, XYZ offset, float aspect, float isize,&lt;br /&gt;
	      float ipangle, COLOUR iC, unsigned int itexid, float alpha, char trans);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Billboard with aspect ratio, offset in screen coords, and rotation of the texture about the view direction.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbp | ds2vbbp]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Billboard with aspect ratio - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2bb | ds2bb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard: a textured facet that always faces the camera. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbb | ds2vbb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard: a textured facet that always faces the camera - vector input &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbr | ds2vbbr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard texture with specified rotation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2tb | ds2tb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw text that always faces the camera &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vtb | ds2vtb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw text that always faces the camera - vector input &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2ct | ss2ct ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a texture with specified width and height &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int tid;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   XYZ xyz = {0.0, 0.3, 0.4};           /* Location */&lt;br /&gt;
   float isize = 0.05;                  /* Texture scale */&lt;br /&gt;
   XYZ offset = { 0.2, 0.1, 0.0};       /* Texture offset to reference point */&lt;br /&gt;
   float aspect = 2.2;                  /* Aspect ratio */&lt;br /&gt;
   COLOUR col = { 1.0, 1.0, 0.0 };      /* Yellow */&lt;br /&gt;
   float alpha = 0.9;                   /* Alpha channel */&lt;br /&gt;
   char trans = 's';                    /* Transparency */&lt;br /&gt;
   float pangle = 45.0;&lt;br /&gt;
&lt;br /&gt;
   ds2vbbpr(xyz, offset, aspect, isize, pangle, col, tid, alpha, trans);&lt;br /&gt;
&lt;br /&gt;
                                /* Billboard with aspect ratio and offset */&lt;br /&gt;
   ns2vthpoint(xyz, col, 3);            /* Plot texture reference point */&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int width = 16, height = 16;         /* Dimensions of texture */&lt;br /&gt;
   int i, j;                            /* Loop variables */&lt;br /&gt;
   int idx;                             /* Index into texture array */&lt;br /&gt;
   unsigned char *tex;                          /* Array of texture values */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the display */&lt;br /&gt;
   s2svp(-1.0,1.0, -1.0,1.0, -1.0,1.0);         /* Set the viewport coords */&lt;br /&gt;
   s2swin(-1.0,1.0, -1.0,1.0, -1.0,1.0);        /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw a bounding box */&lt;br /&gt;
&lt;br /&gt;
   tid = ss2ct(width, height);          /* Create a new texture */&lt;br /&gt;
   tex = ss2gt(tid, &amp;amp;width, &amp;amp;height);   /* Get the texture */&lt;br /&gt;
&lt;br /&gt;
   for (j=0;j&amp;lt;height;j++) {&lt;br /&gt;
      for (i=0;i&amp;lt;width;i++) {&lt;br /&gt;
         idx = (j*width + i) * 4;               /* Stored as (r,g,b,alpha) */&lt;br /&gt;
         tex[idx  ] = 127*drand48()+128;        /* Randomish red */&lt;br /&gt;
         tex[idx+1] = 0;                        /* Green */&lt;br /&gt;
         tex[idx+2] = 0;                        /* Blue */&lt;br /&gt;
                                                /* Do nothing to alpha */&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   ss2pt(tid);                          /* Push texture for usage */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(&amp;amp;cb);                         /* Install a callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vscube</id>
		<title>Function:ns2vscube</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vscube"/>
				<updated>2009-01-06T22:28:25Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vscube==&lt;br /&gt;
Draw a solid cube - vector input.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vscube(XYZ P1, XYZ P2, COLOUR col, float alpha);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a solid cube with filled but transparent faces.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2scube | ns2scube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2wcube |s2wscube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thwcube | ns2thwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthwcube | ns2vthwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   char xopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char yopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char zopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);      /* Draw the coordinate box */&lt;br /&gt;
   s2lab(&amp;quot;X-axis&amp;quot;,&amp;quot;Y-axis&amp;quot;,&amp;quot;Z-axis&amp;quot;,&amp;quot;Plot&amp;quot;);    /* Write some labels */&lt;br /&gt;
&lt;br /&gt;
   XYZ xyz1 = { -0.8, -0.8, -0.8 };             /* Box coordinate */&lt;br /&gt;
   XYZ xyz2 = { +0.8, +0.8, +0.8 };             /* Box coordinate */&lt;br /&gt;
   COLOUR col = { 1.0, 0.3, 0.2 };              /* RGB colours */&lt;br /&gt;
&lt;br /&gt;
   float alpha = 0.4;                           /* Alpha channel transparency */&lt;br /&gt;
&lt;br /&gt;
   ns2vscube(xyz1, xyz2, col, alpha);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2qvas</id>
		<title>Function:ns2qvas</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2qvas"/>
				<updated>2009-01-06T22:28:11Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2qvas==&lt;br /&gt;
Query alpha scaling mode.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
int ns2qvas(void);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Query alpha scaling mode for volume rendering, and normal scaling mode for isosurfaces: 0 =&amp;gt; none, 1 =&amp;gt; scale by volume dimensions, 2 =&amp;gt; scale by viewport dimensions.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2svas | ns2svas]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set alpha scaling mode. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sevas | ns2sevas]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Explicitly set alpha scaling values. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvr | ns2cvr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a volume rendering object. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvra| ns2cvra ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Render volume of objects. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Global variables */&lt;br /&gt;
int vid;                                /* ID for volume render object */&lt;br /&gt;
float tr[12];                           /* Transformation matrix */&lt;br /&gt;
float ***volume;                        /* The data cube */&lt;br /&gt;
int nx, ny, nz;                         /* Data grid dimensions */&lt;br /&gt;
&lt;br /&gt;
float ***initVolume(int nx, int ny, int nz)&lt;br /&gt;
/* Allocate memory and initialise a data cube */&lt;br /&gt;
{&lt;br /&gt;
   float ***volume;&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
&lt;br /&gt;
   volume = (float ***)malloc(nx * sizeof(float **));&lt;br /&gt;
   if (volume == NULL) {&lt;br /&gt;
      fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float **)));&lt;br /&gt;
      exit(-1);&lt;br /&gt;
   }&lt;br /&gt;
   for (i=0;i&amp;lt;nx;i++) {&lt;br /&gt;
      volume[i] = (float **)malloc(ny * sizeof(float *));&lt;br /&gt;
      if (volume[i] == NULL) {&lt;br /&gt;
         fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float *)));&lt;br /&gt;
         exit(-1);&lt;br /&gt;
      }&lt;br /&gt;
      for (j=0;j&amp;lt;ny;j++) {&lt;br /&gt;
         volume[i][j] = (float *)malloc(nz * sizeof(float));&lt;br /&gt;
         if (volume[i][j] == NULL) {&lt;br /&gt;
            fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float)));&lt;br /&gt;
            exit(-1);&lt;br /&gt;
         }&lt;br /&gt;
         for (k=0;k&amp;lt;nz;k++) {&lt;br /&gt;
            volume[i][j][k] = 0.0;              /* Initialise */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return volume;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
/* A dynamic callback */&lt;br /&gt;
{&lt;br /&gt;
   ns2svas(*kc%3);                      /* Set the alpha scaling mode */&lt;br /&gt;
   int qvas = ns2qvas();                /* Query the alpha scaling mode */&lt;br /&gt;
   char string[255];&lt;br /&gt;
   sprintf(string,&amp;quot;Alpha scaling mode: %d.  Press &amp;lt;space&amp;gt; to toggle mode&amp;quot;,&lt;br /&gt;
                qvas);&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,string);&lt;br /&gt;
&lt;br /&gt;
   ds2dvr(vid, 1);                      /* Draw the volume render object */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
   float dmin, dmax, amin, amax;                /* Min/max values */&lt;br /&gt;
   char trans;                                  /* Transparency mode */&lt;br /&gt;
   float x1 = -1.0, x2 = +1.0;                  /* Data range along axes */&lt;br /&gt;
   float y1 = -1.0, y2 = +1.0;&lt;br /&gt;
   float z1 = -1.0, z2 = +1.0;&lt;br /&gt;
   int vi, vj, vk;                              /* Temporary variables */&lt;br /&gt;
   float dx, dy, dz;                            /* Temporary variables */&lt;br /&gt;
   COLOUR amb = {0.8, 0.8, 0.8};                /* Ambient light */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   nx = 40; ny = 40; nz = 10;                   /* Dimensions of data cube */&lt;br /&gt;
   volume = initVolume(nx, ny, nz);             /* Allocate memory */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;12;i++) {                         /* Set-up transfrom matrix */&lt;br /&gt;
      tr[i] = 0.0;&lt;br /&gt;
   }&lt;br /&gt;
   tr[ 0]  = x1;                                /* Mapping from data cube */&lt;br /&gt;
   tr[ 1]  = (x2-x1)/(float)(nx-1.0);           /* to physical coordinates */&lt;br /&gt;
   tr[ 4]  = y1;&lt;br /&gt;
   tr[ 6]  = (y2-y1)/(float)(ny-1.0);&lt;br /&gt;
   tr[ 8]  = z1;&lt;br /&gt;
   tr[11]  = (z2-z1)/(float)(nz-1.0);&lt;br /&gt;
&lt;br /&gt;
   dmin = 0.0;                  /* Mininum data value in volume to plot */&lt;br /&gt;
   dmax = 2.0;                  /* Maximum data value in volume to plot */&lt;br /&gt;
   amin = 0.0;                  /* Minimum alpha channel value */&lt;br /&gt;
   amax = 0.8;                  /* Maximum alpha channel value */&lt;br /&gt;
   trans = 't';                 /* Transparency type */&lt;br /&gt;
&lt;br /&gt;
   dx = tr[1]*0.5;              /* Offsets for window - voxels are pixel */&lt;br /&gt;
   dy = tr[6]*0.5;              /*  centred */&lt;br /&gt;
   dz = tr[11]*0.5;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/S2MONO&amp;quot;,argc,argv);                        /* Open the display */&lt;br /&gt;
   s2swin(x1-dx,x2+dx, y1-dy,y2+dy, z1-dz,z2+dz);       /* Set window coords */&lt;br /&gt;
   s2svp(-1,1,-1.5,1.5,-0.25,0.25);&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);             /* Draw coord box */&lt;br /&gt;
&lt;br /&gt;
   long N = 5000;&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {                  /* Create N random (x,y,z) values */&lt;br /&gt;
      vi = (int)(drand48()*(nx));&lt;br /&gt;
      vj = (int)(drand48()*(ny));&lt;br /&gt;
      vk = (int)(drand48()*(nz));&lt;br /&gt;
&lt;br /&gt;
      volume[vi][vj][vk]+=1.0-drand48()*drand48();&lt;br /&gt;
                                        /* Give a value to volume */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2scir(1000,2000);                   /* Set colour range */&lt;br /&gt;
   s2icm(&amp;quot;mgreen&amp;quot;,1000,2000);           /* Install colour map */&lt;br /&gt;
   vid = ns2cvr(volume, nx, ny, nz, 0, nx-1, 0, ny-1, 0, nz-1,&lt;br /&gt;
                tr, trans, dmin, dmax, amin, amax);&lt;br /&gt;
                                        /* Create the volume render object */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                          /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   ss2srm(SHADE_FLAT);                  /* Set shading type to FLAT */&lt;br /&gt;
   ss2sl(amb, 0, NULL, NULL, 0);        /* Ambient lighting only */&lt;br /&gt;
&lt;br /&gt;
   ss2sas(1);                           /* Start the cube spinning */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2svas</id>
		<title>Function:ns2svas</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2svas"/>
				<updated>2009-01-06T22:27:56Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2svas==&lt;br /&gt;
Set alpha scaling mode.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2svas(int mode);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set alpha scaling mode for volume rendering, and normal scaling mode for isosurfaces: 0 =&amp;gt; none, 1 =&amp;gt; scale by volume dimensions, 2 =&amp;gt; scale by viewport dimensions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvr | ns2cvr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a volume rendering object. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvra| ns2cvra ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Render volume of objects. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2qvas | ns2qvas]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query alpha scaling mode. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Global variables */&lt;br /&gt;
int vid;                                /* ID for volume render object */&lt;br /&gt;
float tr[12];                           /* Transformation matrix */&lt;br /&gt;
float ***volume;                        /* The data cube */&lt;br /&gt;
int nx, ny, nz;                         /* Data grid dimensions */&lt;br /&gt;
&lt;br /&gt;
float ***initVolume(int nx, int ny, int nz)&lt;br /&gt;
/* Allocate memory and initialise a data cube */&lt;br /&gt;
{&lt;br /&gt;
   float ***volume;&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
&lt;br /&gt;
   volume = (float ***)malloc(nx * sizeof(float **));&lt;br /&gt;
   if (volume == NULL) {&lt;br /&gt;
      fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float **)));&lt;br /&gt;
      exit(-1);&lt;br /&gt;
   }&lt;br /&gt;
   for (i=0;i&amp;lt;nx;i++) {&lt;br /&gt;
      volume[i] = (float **)malloc(ny * sizeof(float *));&lt;br /&gt;
      if (volume[i] == NULL) {&lt;br /&gt;
         fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float *)));&lt;br /&gt;
         exit(-1);&lt;br /&gt;
      }&lt;br /&gt;
      for (j=0;j&amp;lt;ny;j++) {&lt;br /&gt;
         volume[i][j] = (float *)malloc(nz * sizeof(float));&lt;br /&gt;
         if (volume[i][j] == NULL) {&lt;br /&gt;
            fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float)));&lt;br /&gt;
            exit(-1);&lt;br /&gt;
         }&lt;br /&gt;
         for (k=0;k&amp;lt;nz;k++) {&lt;br /&gt;
            volume[i][j][k] = 0.0;              /* Initialise */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return volume;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
/* A dynamic callback */&lt;br /&gt;
{&lt;br /&gt;
   ns2svas(*kc%3);                      /* Set the alpha scaling mode */&lt;br /&gt;
   int qvas = ns2qvas();                /* Query the alpha scaling mode */&lt;br /&gt;
   char string[255];&lt;br /&gt;
   sprintf(string,&amp;quot;Alpha scaling mode: %d.  Press &amp;lt;space&amp;gt; to toggle mode&amp;quot;,&lt;br /&gt;
                qvas);&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,string);&lt;br /&gt;
&lt;br /&gt;
   ds2dvr(vid, 1);                      /* Draw the volume render object */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
   float dmin, dmax, amin, amax;                /* Min/max values */&lt;br /&gt;
   char trans;                                  /* Transparency mode */&lt;br /&gt;
   float x1 = -1.0, x2 = +1.0;                  /* Data range along axes */&lt;br /&gt;
   float y1 = -1.0, y2 = +1.0;&lt;br /&gt;
   float z1 = -1.0, z2 = +1.0;&lt;br /&gt;
   int vi, vj, vk;                              /* Temporary variables */&lt;br /&gt;
   float dx, dy, dz;                            /* Temporary variables */&lt;br /&gt;
   COLOUR amb = {0.8, 0.8, 0.8};                /* Ambient light */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   nx = 40; ny = 40; nz = 10;                   /* Dimensions of data cube */&lt;br /&gt;
   volume = initVolume(nx, ny, nz);             /* Allocate memory */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;12;i++) {                         /* Set-up transfrom matrix */&lt;br /&gt;
      tr[i] = 0.0;&lt;br /&gt;
   }&lt;br /&gt;
   tr[ 0]  = x1;                                /* Mapping from data cube */&lt;br /&gt;
   tr[ 1]  = (x2-x1)/(float)(nx-1.0);           /* to physical coordinates */&lt;br /&gt;
   tr[ 4]  = y1;&lt;br /&gt;
   tr[ 6]  = (y2-y1)/(float)(ny-1.0);&lt;br /&gt;
   tr[ 8]  = z1;&lt;br /&gt;
   tr[11]  = (z2-z1)/(float)(nz-1.0);&lt;br /&gt;
&lt;br /&gt;
   dmin = 0.0;                  /* Mininum data value in volume to plot */&lt;br /&gt;
   dmax = 2.0;                  /* Maximum data value in volume to plot */&lt;br /&gt;
   amin = 0.0;                  /* Minimum alpha channel value */&lt;br /&gt;
   amax = 0.8;                  /* Maximum alpha channel value */&lt;br /&gt;
   trans = 't';                 /* Transparency type */&lt;br /&gt;
&lt;br /&gt;
   dx = tr[1]*0.5;              /* Offsets for window - voxels are pixel */&lt;br /&gt;
   dy = tr[6]*0.5;              /*  centred */&lt;br /&gt;
   dz = tr[11]*0.5;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/S2MONO&amp;quot;,argc,argv);                        /* Open the display */&lt;br /&gt;
   s2swin(x1-dx,x2+dx, y1-dy,y2+dy, z1-dz,z2+dz);       /* Set window coords */&lt;br /&gt;
   s2svp(-1,1,-1.5,1.5,-0.25,0.25);&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);             /* Draw coord box */&lt;br /&gt;
&lt;br /&gt;
   long N = 5000;&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {                  /* Create N random (x,y,z) values */&lt;br /&gt;
      vi = (int)(drand48()*(nx));&lt;br /&gt;
      vj = (int)(drand48()*(ny));&lt;br /&gt;
      vk = (int)(drand48()*(nz));&lt;br /&gt;
&lt;br /&gt;
      volume[vi][vj][vk]+=1.0-drand48()*drand48();&lt;br /&gt;
                                        /* Give a value to volume */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2scir(1000,2000);                   /* Set colour range */&lt;br /&gt;
   s2icm(&amp;quot;mgreen&amp;quot;,1000,2000);           /* Install colour map */&lt;br /&gt;
   vid = ns2cvr(volume, nx, ny, nz, 0, nx-1, 0, ny-1, 0, nz-1,&lt;br /&gt;
                tr, trans, dmin, dmax, amin, amax);&lt;br /&gt;
                                        /* Create the volume render object */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                          /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   ss2srm(SHADE_FLAT);                  /* Set shading type to FLAT */&lt;br /&gt;
   ss2sl(amb, 0, NULL, NULL, 0);        /* Ambient lighting only */&lt;br /&gt;
&lt;br /&gt;
   ss2sas(1);                           /* Start the cube spinning */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2cvra</id>
		<title>Function:ns2cvra</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2cvra"/>
				<updated>2009-01-06T22:27:41Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2cvra==&lt;br /&gt;
Volume rendering with alpha function specified.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
int ns2cvra(float ***grid,&lt;br /&gt;
	    int adim, int bdim, int cdim,&lt;br /&gt;
	    int a1, int a2, int b1, int b2, int c1, int c2,&lt;br /&gt;
	    float *tr, char trans,&lt;br /&gt;
	    float datamin, float datamax,&lt;br /&gt;
	    float(*ialphafn)(float*));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Volume rendering object, but with a function for alpha rather than a linear ramp.  The ialphafn is called with a float (ptr) argument being the data value (which can be outside the (datamin, datamax) range of course) and should return a value between 0 (transparent) and 1 (opaque).&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cvr | ns2cvr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create a volume rendering object. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2svas | ns2svas ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set alpha scaling mode. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2qvas | ns2qvas]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query alpha scaling mode. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Global variables */&lt;br /&gt;
int vid;                                /* ID for volume render object */&lt;br /&gt;
float tr[12];                           /* Transformation matrix */&lt;br /&gt;
float ***volume;                        /* The data cube */&lt;br /&gt;
int N = 5000;                           /* Number of data points */&lt;br /&gt;
float *x, *y, *z;                       /* Arrays for data values */&lt;br /&gt;
&lt;br /&gt;
float ***initVolume(int nx, int ny, int nz)&lt;br /&gt;
/* Allocate memory and initialise a data cube */&lt;br /&gt;
{&lt;br /&gt;
   float ***volume;&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
&lt;br /&gt;
   volume = (float ***)malloc(nx * sizeof(float **));&lt;br /&gt;
   if (volume == NULL) {&lt;br /&gt;
      fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float **)));&lt;br /&gt;
      exit(-1);&lt;br /&gt;
   }&lt;br /&gt;
   for (i=0;i&amp;lt;nx;i++) {&lt;br /&gt;
      volume[i] = (float **)malloc(ny * sizeof(float *));&lt;br /&gt;
      if (volume[i] == NULL) {&lt;br /&gt;
         fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float *)));&lt;br /&gt;
         exit(-1);&lt;br /&gt;
      }&lt;br /&gt;
      for (j=0;j&amp;lt;ny;j++) {&lt;br /&gt;
         volume[i][j] = (float *)malloc(nz * sizeof(float));&lt;br /&gt;
         if (volume[i][j] == NULL) {&lt;br /&gt;
            fprintf(stderr,&amp;quot;Failed to allocate %ld bytes\n&amp;quot;,(long)(nx*sizeof(float)));&lt;br /&gt;
            exit(-1);&lt;br /&gt;
         }&lt;br /&gt;
         for (k=0;k&amp;lt;nz;k++) {&lt;br /&gt;
            volume[i][j][k] = 0.0;              /* Initialise */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return volume;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
/* A dynamic callback */&lt;br /&gt;
{&lt;br /&gt;
   ds2dvr(vid, 1);                      /* Draw the volume render object */&lt;br /&gt;
   if ((*kc % 2) == 1)&lt;br /&gt;
      s2pt(N, x, y, z, 1);              /* Plot the points on &amp;lt;space&amp;gt; press */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float dmin, dmax;                       /* Global variables for data range */&lt;br /&gt;
&lt;br /&gt;
float transfer(float *dval)             /* Alpha transfer function */&lt;br /&gt;
{&lt;br /&gt;
   float davg = (dmax+dmin)/2.0;&lt;br /&gt;
   if (*dval &amp;lt; davg) return 0.0;&lt;br /&gt;
   else return 1.0;&lt;br /&gt;
}&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
   int nx = 32, ny = 32, nz = 32;               /* Dimensions of data cube */&lt;br /&gt;
   float amin, amax;            /* Min/max values */&lt;br /&gt;
   char trans;                                  /* Transparency mode */&lt;br /&gt;
   float x1 = -1.0, x2 = +1.0;                  /* Data range along axes */&lt;br /&gt;
   float y1 = -1.0, y2 = +1.0;&lt;br /&gt;
   float z1 = -1.0, z2 = +1.0;&lt;br /&gt;
   int vi, vj, vk;                              /* Temporary variables */&lt;br /&gt;
   float dx, dy, dz;                            /* Temporary variables */&lt;br /&gt;
   COLOUR amb = {0.8, 0.8, 0.8};                /* Ambient light */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   volume = initVolume(nx, ny, nz);             /* Allocate memory */&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;12;i++) {                         /* Set-up transfrom matrix */&lt;br /&gt;
      tr[i] = 0.0;&lt;br /&gt;
   }&lt;br /&gt;
   tr[ 0]  = x1;                                /* Mapping from data cube */&lt;br /&gt;
   tr[ 1]  = (x2-x1)/(float)(nx-1.0);           /* to physical coordinates */&lt;br /&gt;
   tr[ 4]  = y1;&lt;br /&gt;
   tr[ 6]  = (y2-y1)/(float)(ny-1.0);&lt;br /&gt;
   tr[ 8]  = z1;&lt;br /&gt;
   tr[11]  = (z2-z1)/(float)(nz-1.0);&lt;br /&gt;
&lt;br /&gt;
   dmin = 0.0;                  /* Mininum data value in volume to plot */&lt;br /&gt;
   dmax = 2.0;                  /* Maximum data value in volume to plot */&lt;br /&gt;
   amin = 0.0;                  /* Minimum alpha channel value */&lt;br /&gt;
   amax = 0.8;                  /* Maximum alpha channel value */&lt;br /&gt;
   trans = 't';                 /* Transparency type */&lt;br /&gt;
&lt;br /&gt;
   dx = tr[1]*0.5;              /* Offsets for window - voxels are pixel */&lt;br /&gt;
   dy = tr[6]*0.5;              /*  centred */&lt;br /&gt;
   dz = tr[11]*0.5;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/S2MONO&amp;quot;,argc,argv);                        /* Open the display */&lt;br /&gt;
   s2swin(x1-dx,x2+dx, y1-dy,y2+dy, z1-dz,z2+dz);       /* Set window coords */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);             /* Draw coord box */&lt;br /&gt;
&lt;br /&gt;
   x = (float *)calloc(N, sizeof(float));&lt;br /&gt;
   y = (float *)calloc(N, sizeof(float));&lt;br /&gt;
   z = (float *)calloc(N, sizeof(float));&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {                  /* Create N random (x,y,z) values */&lt;br /&gt;
      vi = (int)(drand48()*(nx));&lt;br /&gt;
      vj = (int)(drand48()*(ny));&lt;br /&gt;
      vk = (int)(drand48()*(nz));&lt;br /&gt;
      x[i] = vi *  tr[1] + tr[0];&lt;br /&gt;
      y[i] = vj *  tr[6] + tr[4];&lt;br /&gt;
      z[i] = vk * tr[11] + tr[8];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      volume[vi][vj][vk]+=1.0-drand48()*drand48();&lt;br /&gt;
                                        /* Give a value to volume */&lt;br /&gt;
   }&lt;br /&gt;
   s2scir(1000,2000);                   /* Set colour range */&lt;br /&gt;
   s2icm(&amp;quot;mgreen&amp;quot;,1000,2000);           /* Install colour map */&lt;br /&gt;
   vid = ns2cvra(volume, nx, ny, nz, 0, nx-1, 0, ny-1, 0, nz-1,&lt;br /&gt;
                tr, trans, dmin, dmax, transfer);&lt;br /&gt;
                                        /* Create the volume render object */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                          /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   fprintf(stderr,&amp;quot;Press &amp;lt;space&amp;gt; to toggle showing data points\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   ss2srm(SHADE_FLAT);                  /* Set shading type to FLAT */&lt;br /&gt;
   ss2sl(amb, 0, NULL, NULL, 0);        /* Ambient lighting only */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2qsq</id>
		<title>Function:ns2qsq</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2qsq"/>
				<updated>2009-01-06T22:27:24Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2qsq==&lt;br /&gt;
Query general surface quality.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
int ns2qsq(void);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Query general surface quality high (1) or low (0, default). The former calculates weighted normals for all vertices, while the latter calculates a single normal per facet of the surface.  The former should be used for export to VRML.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2ssq | ns2ssq]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the general surface quality. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cis | ns2cis]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create an isosurface object. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cisc | ns2cisc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create an isosurface object with a colour function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2dis | ns2dis ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an isosurface object &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sisl | ns2sisl ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Change the level of isosurface &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sisc | ns2sisc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the colour for an isosurface. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define CELLS 30&lt;br /&gt;
&lt;br /&gt;
int id1;                                /* Global variable: isosurface id */&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   char string[255];&lt;br /&gt;
   int isq = ns2qsq();                  /* Query the surface quality */&lt;br /&gt;
   sprintf(string,&amp;quot;Surface quality is: %d. Press &amp;lt;space&amp;gt; to toggle&amp;quot;,isq);&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,string);              /* Show a label on screen */&lt;br /&gt;
   ns2ssq(*kc%2);                       /* Set the surface quality */&lt;br /&gt;
   ns2dis(id1, 1);                      /* Display an isosurface */&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i, j, k;                         /* Loop variables */&lt;br /&gt;
   float x, y, z;                       /* Dummy variables for grid values */&lt;br /&gt;
   int nx, ny, nz;                      /* Number of cells in grid */&lt;br /&gt;
   float ***grid;                       /* Grid data */&lt;br /&gt;
   float tr[12];                        /* Transformation matrix */&lt;br /&gt;
   int resolution;                      /* Resolution of isosurface */&lt;br /&gt;
   float level;                         /* Isosurface level to plot */&lt;br /&gt;
   float alpha;                         /* Alpha channel */&lt;br /&gt;
   char trans;                          /* Drawing mode for isosurface */&lt;br /&gt;
&lt;br /&gt;
   nx = CELLS;                          /* Grid dimensions */&lt;br /&gt;
   ny = CELLS;&lt;br /&gt;
   nz = CELLS;&lt;br /&gt;
&lt;br /&gt;
  /* Create transpose matrix mapping data indices to world coords */&lt;br /&gt;
   tr[0] = tr[4] = tr[8] = 0.0;                           /* Offsets */&lt;br /&gt;
   tr[1] = tr[6] = tr[11] = 1.0;                          /* Increments */&lt;br /&gt;
   tr[2] = tr[3] = tr[5] = tr[7] = tr[9] = tr[10] = 0.;   /* Cross terms */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(0, nx-1, 0, ny-1, 0, nz-1);           /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   /* allocate and generate the data grid */&lt;br /&gt;
   grid = (float ***)malloc(nx * sizeof(float **));&lt;br /&gt;
   for (i = 0; i &amp;lt; nx; i++) {&lt;br /&gt;
      grid[i] = (float **)malloc(ny * sizeof(float *));&lt;br /&gt;
      x = (float)(i) / (float)(nx - 1);&lt;br /&gt;
      for (j = 0; j &amp;lt; ny; j++) {&lt;br /&gt;
         grid[i][j] = (float *)malloc(nz * sizeof(float));&lt;br /&gt;
         y = (float)(j) / (float)(ny - 1);&lt;br /&gt;
         for (k = 0; k &amp;lt; nz; k++) {&lt;br /&gt;
            z = (float)(k) / (float)(nz - 1);&lt;br /&gt;
            grid[i][j][k] = x*x*x + y*y - z*z*z*z;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   level      = 0.2;                    /* Set the isosurface level */&lt;br /&gt;
   resolution = 1;                      /* Set the isosurface resolution */&lt;br /&gt;
   alpha      = 0.9;                    /* Set the alpha channel */&lt;br /&gt;
   trans      = 'o';                    /* Opaque isosurface */&lt;br /&gt;
&lt;br /&gt;
/* Create the isosurface object */&lt;br /&gt;
&lt;br /&gt;
   id1 = ns2cis(grid, nx, ny, nz, 0, nx-1, 0, ny-1, 0, nz-1,&lt;br /&gt;
                   tr, level, resolution, trans, alpha, 1., 1., 0.);&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                          /* Install dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2ssq</id>
		<title>Function:ns2ssq</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2ssq"/>
				<updated>2009-01-06T22:27:01Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2ssq==&lt;br /&gt;
Set general surface quality.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2ssq(int hiq);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set general surface quality high (1) or low (0, default). The former calculates weighted normals for all vertices, while the latter calculates a single normal per facet of the surface.  The former should be used for export to VRML.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2qsq | ns2qsq]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the general surface quality. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cis | ns2cis]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create an isosurface object. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cisc | ns2cisc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Create an isosurface object with a colour function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2dis | ns2dis ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an isosurface object &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sisl | ns2sisl ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Change the level of isosurface &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sisc | ns2sisc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the colour for an isosurface. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define CELLS 30&lt;br /&gt;
&lt;br /&gt;
int id1;                                /* Global variable: isosurface id */&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   char string[255];&lt;br /&gt;
   int isq = ns2qsq();                  /* Query the surface quality */&lt;br /&gt;
   sprintf(string,&amp;quot;Surface quality is: %d. Press &amp;lt;space&amp;gt; to toggle&amp;quot;,isq);&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,string);              /* Show a label on screen */&lt;br /&gt;
   ns2ssq(*kc%2);                       /* Set the surface quality */&lt;br /&gt;
   ns2dis(id1, 1);                      /* Display an isosurface */&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int i, j, k;                         /* Loop variables */&lt;br /&gt;
   float x, y, z;                       /* Dummy variables for grid values */&lt;br /&gt;
   int nx, ny, nz;                      /* Number of cells in grid */&lt;br /&gt;
   float ***grid;                       /* Grid data */&lt;br /&gt;
   float tr[12];                        /* Transformation matrix */&lt;br /&gt;
   int resolution;                      /* Resolution of isosurface */&lt;br /&gt;
   float level;                         /* Isosurface level to plot */&lt;br /&gt;
   float alpha;                         /* Alpha channel */&lt;br /&gt;
   char trans;                          /* Drawing mode for isosurface */&lt;br /&gt;
&lt;br /&gt;
   nx = CELLS;                          /* Grid dimensions */&lt;br /&gt;
   ny = CELLS;&lt;br /&gt;
   nz = CELLS;&lt;br /&gt;
&lt;br /&gt;
  /* Create transpose matrix mapping data indices to world coords */&lt;br /&gt;
   tr[0] = tr[4] = tr[8] = 0.0;                           /* Offsets */&lt;br /&gt;
   tr[1] = tr[6] = tr[11] = 1.0;                          /* Increments */&lt;br /&gt;
   tr[2] = tr[3] = tr[5] = tr[7] = tr[9] = tr[10] = 0.;   /* Cross terms */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(0, nx-1, 0, ny-1, 0, nz-1);           /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   /* allocate and generate the data grid */&lt;br /&gt;
   grid = (float ***)malloc(nx * sizeof(float **));&lt;br /&gt;
   for (i = 0; i &amp;lt; nx; i++) {&lt;br /&gt;
      grid[i] = (float **)malloc(ny * sizeof(float *));&lt;br /&gt;
      x = (float)(i) / (float)(nx - 1);&lt;br /&gt;
      for (j = 0; j &amp;lt; ny; j++) {&lt;br /&gt;
         grid[i][j] = (float *)malloc(nz * sizeof(float));&lt;br /&gt;
         y = (float)(j) / (float)(ny - 1);&lt;br /&gt;
         for (k = 0; k &amp;lt; nz; k++) {&lt;br /&gt;
            z = (float)(k) / (float)(nz - 1);&lt;br /&gt;
            grid[i][j][k] = x*x*x + y*y - z*z*z*z;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   level      = 0.2;                    /* Set the isosurface level */&lt;br /&gt;
   resolution = 1;                      /* Set the isosurface resolution */&lt;br /&gt;
   alpha      = 0.9;                    /* Set the alpha channel */&lt;br /&gt;
   trans      = 'o';                    /* Opaque isosurface */&lt;br /&gt;
&lt;br /&gt;
/* Create the isosurface object */&lt;br /&gt;
&lt;br /&gt;
   id1 = ns2cis(grid, nx, ny, nz, 0, nx-1, 0, ny-1, 0, nz-1,&lt;br /&gt;
                   tr, level, resolution, trans, alpha, 1., 1., 0.);&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                          /* Install dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:zs2retainlists</id>
		<title>Function:zs2retainlists</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:zs2retainlists"/>
				<updated>2009-01-06T01:56:27Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==zs2retainlists==&lt;br /&gt;
Set retain lists.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void zs2retainlists(int retlists);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set retain lists on or off.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:zs2debug |zs2debug]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set debugging on or off.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:zs2bufswap |zs2bufswap]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set buffer swapping.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:zs2bufswap</id>
		<title>Function:zs2bufswap</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:zs2bufswap"/>
				<updated>2009-01-06T01:56:06Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==zs2bufswap==&lt;br /&gt;
Set buffer swapping. &lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void zs2bufswap(int bufswap);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set buffer swapping on or off.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:zs2debug |zs2debug]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set debugging on or off.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:zs2retainlists |zs2retainlists]] &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set retain lists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:zs2debug</id>
		<title>Function:zs2debug</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:zs2debug"/>
				<updated>2009-01-06T01:55:46Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==zs2debug==&lt;br /&gt;
Set debugging on or off.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void zs2debug(int debug);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set debugging on or off.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:zs2bufswap | zs2bufswap]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the buffer swapping.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:zs2retainlists | zs2retainlists]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set retain lists.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2g3dt</id>
		<title>Function:ss2g3dt</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2g3dt"/>
				<updated>2009-01-06T01:55:31Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2g3dt==&lt;br /&gt;
Fetch pointer to 3D texture.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
unsigned char *ss2g3dt(unsigned int itextureID, int *width, int *height, int *depth);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Fetch pointer to 3D texture.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2c3dt |ss2c3dt]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; Create an empty 3D texture.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2texpoly3d |ns2texpoly3d]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; Draw a 3d texture.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int texid;                             /* 3D Texture ID */&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int nverts = 4;                              /* Number of vertices in polygon */&lt;br /&gt;
   char trans = 't';                            /* 3d texture transparency */&lt;br /&gt;
   float alpha = 0.7;                           /* Alpha channel value */&lt;br /&gt;
&lt;br /&gt;
   XYZ iP[4];                                   /* Array of polygon vertices */&lt;br /&gt;
   XYZ iTC[4];                                  /* Array of texture coordinates */&lt;br /&gt;
   static float texidx = 0.0;                   /* Current z-texture coordinate */&lt;br /&gt;
&lt;br /&gt;
   iP[0].x = iP[3].x = -1.0;                    /* Define polygon vertices */&lt;br /&gt;
   iP[1].x = iP[2].x = +1.0;&lt;br /&gt;
   iP[0].y = iP[1].y = +1.0;&lt;br /&gt;
   iP[2].y = iP[3].y = -1.0;&lt;br /&gt;
   iP[0].z = iP[1].z = iP[2].z = iP[3].z = texidx*2.0 - 1.0;&lt;br /&gt;
&lt;br /&gt;
   iTC[0].x = iTC[3].x = 0;                     /* Define texture coordinates */&lt;br /&gt;
   iTC[1].x = iTC[2].x = 1;&lt;br /&gt;
   iTC[0].y = iTC[1].y = 1;&lt;br /&gt;
   iTC[2].y = iTC[3].y = 0;&lt;br /&gt;
   iTC[0].z = iTC[1].z = iTC[2].z = iTC[3].z = texidx;&lt;br /&gt;
&lt;br /&gt;
   COLOUR col = { 1,1,1 };                      /* Draw the polygon boundaries */&lt;br /&gt;
   ns2vline(iP[0],iP[1],col);&lt;br /&gt;
   ns2vline(iP[1],iP[2],col);&lt;br /&gt;
   ns2vline(iP[2],iP[3],col);&lt;br /&gt;
   ns2vline(iP[3],iP[0],col);&lt;br /&gt;
&lt;br /&gt;
   ns2texpoly3d(iP, iTC, nverts, texid, trans, alpha);  /* Draw 3D texture */&lt;br /&gt;
&lt;br /&gt;
   texidx += (1.0/320.0);                       /* Choose next z-texture coordinate */&lt;br /&gt;
   if (texidx &amp;gt; 1.0) texidx = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int Nx = 32, Ny = 32, Nz = 32;               /* Texture dimensions */&lt;br /&gt;
   int w,h,d;                                   /* Returned dimensions */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the s2plot display device */&lt;br /&gt;
   s2swin(-1,1,-1,1,-1,1);                      /* Set the world coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);&lt;br /&gt;
&lt;br /&gt;
   texid = ss2c3dt(Nx, Ny, Nz);                 /* Create a new 3d texture */&lt;br /&gt;
   unsigned char *bits = (unsigned char *)ss2g3dt(texid, &amp;amp;w, &amp;amp;h, &amp;amp;d);&lt;br /&gt;
                                                /* Get the texture data for modification */&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
   long idx;&lt;br /&gt;
   float x,y,z;&lt;br /&gt;
   for (i=0;i&amp;lt;Nx;i++) {&lt;br /&gt;
      x = -1.0 + i*(2.0/(float)(Nx-1));&lt;br /&gt;
      for (j=0;j&amp;lt;Ny;j++) {&lt;br /&gt;
         y = -1.0 + j*(2.0/(float)(Ny-1));&lt;br /&gt;
         for (k=0;k&amp;lt;Nz;k++) {&lt;br /&gt;
            z = -1.0 + k*(2.0/(float)(Nz-1));&lt;br /&gt;
            idx = ((i*Ny + j)*Nz + k)*4;&lt;br /&gt;
            if ((x*x + y*y + z*z) &amp;lt; 1.0) {      /* 3D solid red sphere */&lt;br /&gt;
               bits[idx + 1 ] = 255;&lt;br /&gt;
               ns2point(x,y,z,1,1,1);           /* Plot point in sphere */&lt;br /&gt;
            } else {&lt;br /&gt;
               bits[idx + 0 ] = 0;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            bits[idx + 1 ] = 0;                 /* Blue channel */&lt;br /&gt;
            bits[idx + 2 ] = 0;                 /* Green channel */&lt;br /&gt;
            bits[idx + 3 ] = 255;               /* Alpha channel */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   fprintf(stderr, &amp;quot;3d texture IS %d x %d x %d\n&amp;quot;, w, h, d);&lt;br /&gt;
   ss2pt(texid);                                /* Push back the texture */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Display the geometry */&lt;br /&gt;
&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2c3dt</id>
		<title>Function:ss2c3dt</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2c3dt"/>
				<updated>2009-01-06T01:55:13Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2c3dt==&lt;br /&gt;
Create an empty 3d texture.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
unsigned int ss2c3dt(int width, int height, int depth);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Create an empty 3D texture.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2g3dt |ss2g3dt]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; Fetch pointer to 3d texture.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2texpoly3d |ns2texpoly3d]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; Draw a 3d texture.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int texid;                             /* 3D Texture ID */&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int nverts = 4;                              /* Number of vertices in polygon */&lt;br /&gt;
   char trans = 't';                            /* 3d texture transparency */&lt;br /&gt;
   float alpha = 0.7;                           /* Alpha channel value */&lt;br /&gt;
&lt;br /&gt;
   XYZ iP[4];                                   /* Array of polygon vertices */&lt;br /&gt;
   XYZ iTC[4];                                  /* Array of texture coordinates */&lt;br /&gt;
   static float texidx = 0.0;                   /* Current z-texture coordinate */&lt;br /&gt;
&lt;br /&gt;
   iP[0].x = iP[3].x = -1.0;                    /* Define polygon vertices */&lt;br /&gt;
   iP[1].x = iP[2].x = +1.0;&lt;br /&gt;
   iP[0].y = iP[1].y = +1.0;&lt;br /&gt;
   iP[2].y = iP[3].y = -1.0;&lt;br /&gt;
   iP[0].z = iP[1].z = iP[2].z = iP[3].z = texidx*2.0 - 1.0;&lt;br /&gt;
&lt;br /&gt;
   iTC[0].x = iTC[3].x = 0;                     /* Define texture coordinates */&lt;br /&gt;
   iTC[1].x = iTC[2].x = 1;&lt;br /&gt;
   iTC[0].y = iTC[1].y = 1;&lt;br /&gt;
   iTC[2].y = iTC[3].y = 0;&lt;br /&gt;
   iTC[0].z = iTC[1].z = iTC[2].z = iTC[3].z = texidx;&lt;br /&gt;
&lt;br /&gt;
   COLOUR col = { 1,1,1 };                      /* Draw the polygon boundaries */&lt;br /&gt;
   ns2vline(iP[0],iP[1],col);&lt;br /&gt;
   ns2vline(iP[1],iP[2],col);&lt;br /&gt;
   ns2vline(iP[2],iP[3],col);&lt;br /&gt;
   ns2vline(iP[3],iP[0],col);&lt;br /&gt;
&lt;br /&gt;
   ns2texpoly3d(iP, iTC, nverts, texid, trans, alpha);  /* Draw 3D texture */&lt;br /&gt;
&lt;br /&gt;
   texidx += (1.0/320.0);                       /* Choose next z-texture coordinate */&lt;br /&gt;
   if (texidx &amp;gt; 1.0) texidx = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int Nx = 32, Ny = 32, Nz = 32;               /* Texture dimensions */&lt;br /&gt;
   int w,h,d;                                   /* Returned dimensions */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the s2plot display device */&lt;br /&gt;
   s2swin(-1,1,-1,1,-1,1);                      /* Set the world coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);&lt;br /&gt;
&lt;br /&gt;
   texid = ss2c3dt(Nx, Ny, Nz);                 /* Create a new 3d texture */&lt;br /&gt;
   unsigned char *bits = (unsigned char *)ss2g3dt(texid, &amp;amp;w, &amp;amp;h, &amp;amp;d);&lt;br /&gt;
                                                /* Get the texture data for modification */&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
   long idx;&lt;br /&gt;
   float x,y,z;&lt;br /&gt;
   for (i=0;i&amp;lt;Nx;i++) {&lt;br /&gt;
      x = -1.0 + i*(2.0/(float)(Nx-1));&lt;br /&gt;
      for (j=0;j&amp;lt;Ny;j++) {&lt;br /&gt;
         y = -1.0 + j*(2.0/(float)(Ny-1));&lt;br /&gt;
         for (k=0;k&amp;lt;Nz;k++) {&lt;br /&gt;
            z = -1.0 + k*(2.0/(float)(Nz-1));&lt;br /&gt;
            idx = ((i*Ny + j)*Nz + k)*4;&lt;br /&gt;
            if ((x*x + y*y + z*z) &amp;lt; 1.0) {      /* 3D solid red sphere */&lt;br /&gt;
               bits[idx + 1 ] = 255;&lt;br /&gt;
               ns2point(x,y,z,1,1,1);           /* Plot point in sphere */&lt;br /&gt;
            } else {&lt;br /&gt;
               bits[idx + 0 ] = 0;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            bits[idx + 1 ] = 0;                 /* Blue channel */&lt;br /&gt;
            bits[idx + 2 ] = 0;                 /* Green channel */&lt;br /&gt;
            bits[idx + 3 ] = 255;               /* Alpha channel */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   fprintf(stderr, &amp;quot;3d texture IS %d x %d x %d\n&amp;quot;, w, h, d);&lt;br /&gt;
   ss2pt(texid);                                /* Push back the texture */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Display the geometry */&lt;br /&gt;
&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2texpoly3d</id>
		<title>Function:ns2texpoly3d</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2texpoly3d"/>
				<updated>2009-01-06T01:54:54Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2texpoly3d==&lt;br /&gt;
Draw a 3-d textured polygon.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 void ns2texpoly3d(XYZ *iP, XYZ *iTC, float in, unsigned int texid, char itrans, float ialpha);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a 3-d textured polygon. The array iP holds the vertex coordinates, array iTC holds the texture coordinates, &lt;br /&gt;
parameter &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; is the number of vertices, itrans is one of 'o' (opaque), 't' (transparent) or 's' (standard) and&lt;br /&gt;
ialpha is the alpha channel value.&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2c3dt |ss2c3dt]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; Create an empty 3D texture.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2g3dt |ss2g3dt]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; Fetch the pointer to a 3d texture.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int texid;                             /* 3D Texture ID */&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int nverts = 4;                              /* Number of vertices in polygon */&lt;br /&gt;
   char trans = 't';                            /* 3d texture transparency */&lt;br /&gt;
   float alpha = 0.7;                           /* Alpha channel value */&lt;br /&gt;
&lt;br /&gt;
   XYZ iP[4];                                   /* Array of polygon vertices */&lt;br /&gt;
   XYZ iTC[4];                                  /* Array of texture coordinates */&lt;br /&gt;
   static float texidx = 0.0;                   /* Current z-texture coordinate */&lt;br /&gt;
&lt;br /&gt;
   iP[0].x = iP[3].x = -1.0;                    /* Define polygon vertices */&lt;br /&gt;
   iP[1].x = iP[2].x = +1.0;&lt;br /&gt;
   iP[0].y = iP[1].y = +1.0;&lt;br /&gt;
   iP[2].y = iP[3].y = -1.0;&lt;br /&gt;
   iP[0].z = iP[1].z = iP[2].z = iP[3].z = texidx*2.0 - 1.0;&lt;br /&gt;
&lt;br /&gt;
   iTC[0].x = iTC[3].x = 0.0;                   /* Define texture coordinates */&lt;br /&gt;
   iTC[1].x = iTC[2].x = 1.0;&lt;br /&gt;
   iTC[0].y = iTC[1].y = 1.0;&lt;br /&gt;
   iTC[2].y = iTC[3].y = 0.0;&lt;br /&gt;
   iTC[0].z = iTC[1].z = iTC[2].z = iTC[3].z = texidx;&lt;br /&gt;
&lt;br /&gt;
   COLOUR col = { 1,1,1 };                      /* Draw the polygon boundaries */&lt;br /&gt;
   ns2vline(iP[0],iP[1],col);&lt;br /&gt;
   ns2vline(iP[1],iP[2],col);&lt;br /&gt;
   ns2vline(iP[2],iP[3],col);&lt;br /&gt;
   ns2vline(iP[3],iP[0],col);&lt;br /&gt;
&lt;br /&gt;
   ns2texpoly3d(iP, iTC, nverts, texid, trans, alpha);  /* Draw 3D texture */&lt;br /&gt;
&lt;br /&gt;
   texidx += (1.0/320.0);                       /* Choose next z-texture coordinate */&lt;br /&gt;
   if (texidx &amp;gt; 1.0) texidx = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int Nx = 32, Ny = 32, Nz = 32;               /* Texture dimensions */&lt;br /&gt;
   int w,h,d;                                   /* Returned dimensions */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the s2plot display device */&lt;br /&gt;
   s2swin(-1,1,-1,1,-1,1);                      /* Set the world coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);&lt;br /&gt;
&lt;br /&gt;
   texid = ss2c3dt(Nx, Ny, Nz);                 /* Create a new 3d texture */&lt;br /&gt;
   unsigned char *bits = (unsigned char *)ss2g3dt(texid, &amp;amp;w, &amp;amp;h, &amp;amp;d);&lt;br /&gt;
                                                /* Get the texture data for modification */&lt;br /&gt;
   int i, j, k;&lt;br /&gt;
   long idx;&lt;br /&gt;
   float x,y,z;&lt;br /&gt;
   for (i=0;i&amp;lt;Nx;i++) {&lt;br /&gt;
      x = -1.0 + i*(2.0/(float)(Nx-1));&lt;br /&gt;
      for (j=0;j&amp;lt;Ny;j++) {&lt;br /&gt;
         y = -1.0 + j*(2.0/(float)(Ny-1));&lt;br /&gt;
         for (k=0;k&amp;lt;Nz;k++) {&lt;br /&gt;
            z = -1.0 + k*(2.0/(float)(Nz-1));&lt;br /&gt;
            idx = ((i*Ny + j)*Nz + k)*4;&lt;br /&gt;
            if ((x*x + y*y + z*z) &amp;lt; 1.0) {      /* 3D solid red sphere */&lt;br /&gt;
               bits[idx + 1 ] = 255;&lt;br /&gt;
               ns2point(x,y,z,1,1,1);           /* Plot point in sphere */&lt;br /&gt;
            } else {&lt;br /&gt;
               bits[idx + 0 ] = 0;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            bits[idx + 1 ] = 0;                 /* Blue channel */&lt;br /&gt;
            bits[idx + 2 ] = 0;                 /* Green channel */&lt;br /&gt;
            bits[idx + 3 ] = 255;               /* Alpha channel */&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   fprintf(stderr, &amp;quot;3d texture IS %d x %d x %d\n&amp;quot;, w, h, d);&lt;br /&gt;
   ss2pt(texid);                                /* Push back the texture */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Display the geometry */&lt;br /&gt;
&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2qcs</id>
		<title>Function:ss2qcs</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2qcs"/>
				<updated>2009-01-06T01:54:32Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2qcs==&lt;br /&gt;
Set/query the camera speed.&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
float ss2qcs(void);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set/query the camera speed (ie. increment amount for camera movements.  Values between 0.01 and 20.0 are reasonably sensible.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2scs | ss2scs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qca | ss2qca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sca | ss2sca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sc | ss2sc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qc | ss2qc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   static int lkc = 0;                          /* Count of key presses */&lt;br /&gt;
&lt;br /&gt;
   float qcs = ss2qcs();                        /* Query camera increment */&lt;br /&gt;
   char string[32];&lt;br /&gt;
&lt;br /&gt;
   sprintf(string,&amp;quot;%.2f&amp;quot;,qcs);&lt;br /&gt;
   s2textxy(0,0,0,string);                      /* Display text */&lt;br /&gt;
&lt;br /&gt;
   lkc = *kc;                                   /* Update count */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/s2mono&amp;quot;,argc, argv);               /* Open the display: mono */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt; and &amp;gt; to change camera movement increment, then +/- to test zooming\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install dynamic callback */&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2scs</id>
		<title>Function:ss2scs</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2scs"/>
				<updated>2009-01-06T01:54:12Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2scs==&lt;br /&gt;
Set the camera speed.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ss2scs(float spd);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set the camera speed (ie. increment amount for camera movements.  Values between 0.01 and 20.0 are reasonably sensible.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qcs | ss2qcs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qca | ss2qca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sca | ss2sca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sc | ss2sc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qc | ss2qc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   static int lkc = 0;                  /* Count of key presses */&lt;br /&gt;
   static float spd = 1.0;              /* Set the camera increment */&lt;br /&gt;
&lt;br /&gt;
   if (lkc != *kc) {                    /* Query whether &amp;lt;space&amp;gt; was pressed */&lt;br /&gt;
      spd += 2.0;                       /* Update the camera increment */&lt;br /&gt;
   }&lt;br /&gt;
   ss2scs(spd);                         /* Set the new camera increment */&lt;br /&gt;
&lt;br /&gt;
   char string[32];                     /* Write current increment to screen */&lt;br /&gt;
   sprintf(string,&amp;quot;%.2f&amp;quot;,spd);&lt;br /&gt;
   s2textxy(0,0,0,string);              /* Display text */&lt;br /&gt;
&lt;br /&gt;
   lkc = *kc;                           /* Update key press count */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/s2mono&amp;quot;,argc, argv);               /* Open the display: mono */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt;space&amp;gt; to change camera movement increment, then +/- to test zooming\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install dynamic callback */&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2qca</id>
		<title>Function:ss2qca</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2qca"/>
				<updated>2009-01-06T01:53:57Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2qca==&lt;br /&gt;
Query the camera aperture.&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
float ss2qca(void);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Query the camera aperture (in degrees).&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sca | ss2sca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2scs | ss2scs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qcs | ss2qcs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sc | ss2sc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qc | ss2qc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int N = 100;                                 /* Number of points */&lt;br /&gt;
   static int flag = -1;                        /* Flag for initialisation */&lt;br /&gt;
   static XYZ xyz[100];                         /* Array of point positions */&lt;br /&gt;
   static COLOUR col[100];                      /* Array of colours */&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
&lt;br /&gt;
   if (flag &amp;lt; 0) {                              /* First time through? */&lt;br /&gt;
      for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
         xyz[i].x = drand48()*2.0 - 1.0;        /* Random data positions */&lt;br /&gt;
         xyz[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
         xyz[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
         col[i].r = drand48();                  /* Random data colours */&lt;br /&gt;
         col[i].g = drand48();&lt;br /&gt;
         col[i].b = drand48();&lt;br /&gt;
      }&lt;br /&gt;
      flag = 1;                                 /* Set the flag */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      ns2vthpoint(xyz[i], col[i], 3);           /* Draw the point */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   static int lkc = 1;                          /* Last time &amp;lt;space&amp;gt; key pressed */&lt;br /&gt;
   if (lkc != *kc)                              /* Check for keyboard press */&lt;br /&gt;
      ss2sca(drand48()*70 + 20);                /* Set the camera aperture */&lt;br /&gt;
   lkc = *kc;                                   /* Update key press */&lt;br /&gt;
&lt;br /&gt;
   int wc = ss2qca();                           /* Query camera aperture */&lt;br /&gt;
   char text[64];&lt;br /&gt;
   sprintf(text, &amp;quot;Aperture %d degrees\n&amp;quot;,wc);   /* Prepare a text string */&lt;br /&gt;
   s2textxy(0.0,0.0,0.0, text);                 /* Display text string */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt;space&amp;gt; to change camera aperture&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2sca</id>
		<title>Function:ss2sca</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ss2sca"/>
				<updated>2009-01-06T01:53:41Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ss2sca==&lt;br /&gt;
Set the camera aperture.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ss2sca(float aperture);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set the camera aperture (in degrees).&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qca | ss2qca ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera aperture. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2scs | ss2scs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qcs | ss2qcs ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera speed. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2sc | ss2sc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ss2qc | ss2qc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Query the camera position, up vector and view direction. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   int N = 100;                                 /* Number of points */&lt;br /&gt;
   static int flag = -1;                        /* Flag for initialisation */&lt;br /&gt;
   static XYZ xyz[100];                         /* Array of point positions */&lt;br /&gt;
   static COLOUR col[100];                      /* Array of colours */&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
&lt;br /&gt;
   if (flag &amp;lt; 0) {                              /* First time through? */&lt;br /&gt;
      for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
         xyz[i].x = drand48()*2.0 - 1.0;        /* Random data positions */&lt;br /&gt;
         xyz[i].y = drand48()*2.0 - 1.0;&lt;br /&gt;
         xyz[i].z = drand48()*2.0 - 1.0;&lt;br /&gt;
         col[i].r = drand48();                  /* Random data colours */&lt;br /&gt;
         col[i].g = drand48();&lt;br /&gt;
         col[i].b = drand48();&lt;br /&gt;
      }&lt;br /&gt;
      flag = 1;                                 /* Set the flag */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      ns2vthpoint(xyz[i], col[i], 3);           /* Draw the point */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   static int lkc = 1;                          /* Last time &amp;lt;space&amp;gt; key pressed */&lt;br /&gt;
   if (lkc != *kc)                              /* Check for keyboard press */&lt;br /&gt;
      ss2sca(drand48()*70 + 20);                /* Set the camera aperture */&lt;br /&gt;
   lkc = *kc;                                   /* Update key press */&lt;br /&gt;
&lt;br /&gt;
   int wc = ss2qca();                           /* Query camera aperture */&lt;br /&gt;
   char text[64];&lt;br /&gt;
   sprintf(text, &amp;quot;Aperture %d degrees\n&amp;quot;,wc);   /* Prepare a text string */&lt;br /&gt;
   s2textxy(0.0,0.0,0.0, text);                 /* Display text string */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Press &amp;lt;space&amp;gt; to change camera aperture&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install a dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:xs2spp</id>
		<title>Function:xs2spp</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:xs2spp"/>
				<updated>2009-01-06T01:53:27Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==xs2spp==&lt;br /&gt;
Set panel frame properties.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void xs2spp(COLOUR active, COLOUR inactive, float width);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set panel frame properties.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:xs2ap | xs2ap]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Add a new panel&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:xs2mp | xs2mp]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Modify location of existing panel.&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:xs2cp | xs2cp]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Select a panel for subsequent geometry calls&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:xs2tp | xs2tp]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Toggle visibility of panel&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:xs2lpc | xs2lpc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Link panel cameras together&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Global variales used in callback */&lt;br /&gt;
int master_panel = 0;                   /* Default ID of main panel */&lt;br /&gt;
int slave_panel;                        /* ID of newly created panel */&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   static int lkc = 0;                  /* Keep count of keypress state */&lt;br /&gt;
   if (*kc == 1) {&lt;br /&gt;
      xs2lpc(master_panel, slave_panel);        /* Link panels together */&lt;br /&gt;
   } else if ((*kc &amp;gt; 1) &amp;amp;&amp;amp; (*kc != lkc)) {&lt;br /&gt;
      xs2tp(slave_panel);               /* Toggle panel visiblity */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   lkc = *kc;                           /* Update count of keypress state */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   s2opend(&amp;quot;/s2mono&amp;quot;, argc, argv);              /* Open in mono mode */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   xs2mp(master_panel, 0.0, 0.5, 0.5, 1.0);     /* Move to top left */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   slave_panel = xs2ap(0.5, 0.0, 1.0, 0.5);     /* Create panel in bottom right */&lt;br /&gt;
   xs2cp(slave_panel);                          /* Choose this panel */&lt;br /&gt;
   s2swin(-2.,2., -2.,2., -2.,2.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   xs2cp(master_panel);                         /* Go back to main panel */&lt;br /&gt;
   cs2scb(cb);                                  /* Install dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   COLOUR inactive = { 0.3, 0.2, 0.8 };         /* Inactive frame colour */&lt;br /&gt;
   COLOUR active   = { 0.1, 1.0, 0.1 };         /* Active frame colour */&lt;br /&gt;
   float width = 2.0;                           /* Frame border width */&lt;br /&gt;
   xs2spp(active, inactive, width);             /* Set panel properties */&lt;br /&gt;
&lt;br /&gt;
   fprintf(stderr,&amp;quot;Press &amp;lt;tab&amp;gt; to switch between panels\n&amp;quot;);&lt;br /&gt;
   fprintf(stderr,&amp;quot;Press &amp;lt;spacebar&amp;gt; to link cameras together - cannot be undone\n&amp;quot;);&lt;br /&gt;
   fprintf(stderr,&amp;quot;Futher presses of &amp;lt;spacebar&amp;gt; toggle panel visiblity\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:cs2sptxy</id>
		<title>Function:cs2sptxy</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:cs2sptxy"/>
				<updated>2009-01-06T01:53:10Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==cs2sptxy==&lt;br /&gt;
Set the text and position of a prompt.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void cs2sptxy(char *prompt, float xfrac, float yfrac);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set the text and position of the prompt.  xfrac and yfrac are fractions of the viewport from bottom left.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:cs2spcb | cs2spcb]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Set the user prompt callback.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Global variable */&lt;br /&gt;
float r = 0, g = 0, b = 0;                      /* Background colour */&lt;br /&gt;
&lt;br /&gt;
void pcb(char *string)&lt;br /&gt;
{&lt;br /&gt;
   int res;                                     /* How many numbers entered? */&lt;br /&gt;
   float rr, gg, bb;                            /* Local variables */&lt;br /&gt;
   res = sscanf(string,&amp;quot;%f %f %f&amp;quot;,&amp;amp;rr,&amp;amp;gg,&amp;amp;bb); /* Read from prompt string */&lt;br /&gt;
   if (res == 3) {&lt;br /&gt;
      r = rr;                                   /* Change background colour */&lt;br /&gt;
      g = gg;&lt;br /&gt;
      b = bb;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
/* Change where the prompt appears next time */&lt;br /&gt;
   float px = drand48()*0.6 + 0.2;&lt;br /&gt;
   float py = drand48()*0.6 + 0.2;&lt;br /&gt;
&lt;br /&gt;
   cs2sptxy(&amp;quot;R G B &amp;gt;&amp;quot;, px, py);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   ss2sbc(r, g, b);                             /* Set background colour */&lt;br /&gt;
   ss2sfc(1-r, 1-g, 1-b);                       /* Choose sensible foreground */&lt;br /&gt;
   s2scr(32, 1-r, 1-g, 1-b);                    /* Create a new colour index */&lt;br /&gt;
   s2sci(32);                                   /* Set colour to this index */&lt;br /&gt;
   s2textxy(-1,0,0,&amp;quot;Press ~ then enter R G B values e.g 1 1 1&amp;quot;);&lt;br /&gt;
                                                /* Write some text */&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   s2opend(&amp;quot;/s2mono&amp;quot;, argc, argv);             /* Open in mono mode */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(cb);                                  /* Install dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   char string[32];                             /* Allocate prompt string memory */&lt;br /&gt;
   cs2spcb(pcb, string);                        /* Install a prompt callback */&lt;br /&gt;
&lt;br /&gt;
   s2lab(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;Demonstrates positioning of the prompt&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ds2vbbp</id>
		<title>Function:ds2vbbp</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ds2vbbp"/>
				<updated>2009-01-06T01:52:48Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ds2vbbp==&lt;br /&gt;
Draw a &amp;quot;billboard&amp;quot; with aspect ratio - vector input.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ds2vbbp(XYZ iP, XYZ offset, float aspect,&lt;br /&gt;
	     float isize, COLOUR iC, unsigned int itexid, float alpha, char trans);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a &amp;quot;billboard&amp;quot; with aspect ratio: width:height instead of stretch, and offset in screen coords (x,y) [offset.z ignored].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbpr | ds2vbbpr]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Billboard with aspect ratio, offset in screen coords, and rotation of texture - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2bbset | ds2bbset ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a set of billboards. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2bb | ds2bb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard: a textured facet that always faces the camera. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbb | ds2vbb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard: a textured facet that always faces the camera - vector input &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vbbr | ds2vbbr ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a (dynamic) billboard texture with specified rotation.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2tb | ds2tb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw text that always faces the camera &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ds2vtb | ds2vtb ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw text that always faces the camera - vector input &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
unsigned int tid;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   XYZ xyz = {0.0, 0.3, 0.4};           /* Location */&lt;br /&gt;
   float isize = 0.05;                  /* Texture scale */&lt;br /&gt;
   XYZ offset = { 0.2, 0.1, 0.0};       /* Texture offset to reference point */&lt;br /&gt;
   float aspect = 2.2;                  /* Aspect ratio */&lt;br /&gt;
   COLOUR col = { 1.0, 1.0, 0.0 };      /* Yellow */&lt;br /&gt;
   float alpha = 0.9;                   /* Alpha channel */&lt;br /&gt;
   char trans = 's';                    /* Transparency */&lt;br /&gt;
&lt;br /&gt;
   ds2vbbp(xyz, offset, aspect, isize, col, tid, alpha, trans);&lt;br /&gt;
                                /* Billboard with aspect ratio and offset */&lt;br /&gt;
   ns2vthpoint(xyz, col, 3);            /* Plot texture reference point */&lt;br /&gt;
&lt;br /&gt;
   xyz.y = -0.3;                        /* Change the y value */&lt;br /&gt;
   XYZ str = { 0.0, 0.0, 0.0 };         /* No stretch */&lt;br /&gt;
   ds2vbb(xyz, str, isize, col, tid, alpha, trans); /* Standard billboard */&lt;br /&gt;
   ns2vthpoint(xyz, col, 3);            /* Plot texture reference point */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   int width = 16, height = 16;         /* Dimensions of texture */&lt;br /&gt;
   int i, j;                            /* Loop variables */&lt;br /&gt;
   int idx;                             /* Index into texture array */&lt;br /&gt;
   unsigned char *tex;                          /* Array of texture values */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc,argv);                     /* Open the display */&lt;br /&gt;
   s2svp(-1.0,1.0, -1.0,1.0, -1.0,1.0);         /* Set the viewport coords */&lt;br /&gt;
   s2swin(-1.0,1.0, -1.0,1.0, -1.0,1.0);        /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0,&amp;quot;BCDE&amp;quot;,0,0);     /* Draw a bounding box */&lt;br /&gt;
&lt;br /&gt;
   tid = ss2ct(width, height);          /* Create a new texture */&lt;br /&gt;
   tex = ss2gt(tid, &amp;amp;width, &amp;amp;height);   /* Get the texture */&lt;br /&gt;
&lt;br /&gt;
   for (j=0;j&amp;lt;height;j++) {&lt;br /&gt;
      for (i=0;i&amp;lt;width;i++) {&lt;br /&gt;
         idx = (j*width + i) * 4;               /* Stored as (r,g,b,alpha) */&lt;br /&gt;
         tex[idx  ] = 127*drand48()+128;        /* Randomish red */&lt;br /&gt;
         tex[idx+1] = 0;                        /* Green */&lt;br /&gt;
         tex[idx+2] = 0;                        /* Blue */&lt;br /&gt;
                                                /* Do nothing to alpha */&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   ss2pt(tid);                          /* Push texture for usage */&lt;br /&gt;
&lt;br /&gt;
   cs2scb(&amp;amp;cb);                         /* Install a callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                           /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2scube</id>
		<title>Function:ns2scube</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2scube"/>
				<updated>2009-01-06T01:52:29Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2scube==&lt;br /&gt;
Draw a solid cube.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2scube(float x1, float y1, float z1, float x2, float y2, float z2,&lt;br /&gt;
	      float red, float green, float blue,float alpha);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a solid cube with filled but transparent faces.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2wcube | s2wcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vscube |ns2vscube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thwcube | ns2thwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthwcube | ns2vthwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   char xopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char yopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char zopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);      /* Draw the coordinate box */&lt;br /&gt;
   s2lab(&amp;quot;X-axis&amp;quot;,&amp;quot;Y-axis&amp;quot;,&amp;quot;Z-axis&amp;quot;,&amp;quot;Plot&amp;quot;);    /* Write some labels */&lt;br /&gt;
&lt;br /&gt;
   float x1 = -0.8, x2 = +0.8;                  /* Box coordinates */&lt;br /&gt;
   float y1 = -0.8, y2 = +0.8;&lt;br /&gt;
   float z1 = -0.8, z2 = +0.8;&lt;br /&gt;
&lt;br /&gt;
   float r = 1.0, g = 0.3, b = 0.2;             /* RGB colours */&lt;br /&gt;
   float alpha = 0.4;                           /* Alpha channel transparency */&lt;br /&gt;
&lt;br /&gt;
   ns2scube(x1,y1,z1, x2,y2,z2, r,g,b, alpha);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vthcline</id>
		<title>Function:ns2vthcline</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vthcline"/>
				<updated>2009-01-06T01:52:06Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vthcline==&lt;br /&gt;
Draw a thick coloured line - vector input.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vthcline(XYZ P1, XYZ P2, COLOUR col1, COLOUR col2, float width);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a thick coloured line, with colour blended between the two given colours along the line, and given width.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thcline | ns2thcline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a thick coloured line. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2line | ns2line ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a line from one point to another in a specific colour.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vline | ns2vline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a line from one point to another in a specific colour - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thline | ns2thline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a thick line from one point to another in a specific colour. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthline | ns2vthline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a thick line from one point to another in a specific colour - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cline | ns2cline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a coloured line, with colour blended between the two given colours along the line. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vcline | ns2vcline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a coloured line, with colour blended between the two given colours along the line - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   XYZ start;                                   /* Start of line */&lt;br /&gt;
   XYZ end;                                     /* End of line */&lt;br /&gt;
   COLOUR col1;                                 /* Colour of line segment (start) */&lt;br /&gt;
   COLOUR col2;                                 /* Colour of line segment (end) */&lt;br /&gt;
   float size;                                  /* Line thickness */&lt;br /&gt;
   int N = 10;                                  /* Number of lines */&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   s2sci(S2_PG_YELLOW);                         /* Set colour */&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      start.x = drand48()*2.0 - 1.0;            /* Random (x,y,z) coordinates */&lt;br /&gt;
      start.y = drand48()*2.0 - 1.0;&lt;br /&gt;
      start.z = drand48()*2.0 - 1.0;&lt;br /&gt;
      end.x   = drand48()*2.0 - 1.0;            /* Random (x,y,z) coordinates */&lt;br /&gt;
      end.y   = drand48()*2.0 - 1.0;&lt;br /&gt;
      end.z   = drand48()*2.0 - 1.0;&lt;br /&gt;
      col1.r   = drand48();&lt;br /&gt;
      col1.g   = drand48();&lt;br /&gt;
      col1.b   = drand48();&lt;br /&gt;
      col2.r   = drand48();&lt;br /&gt;
      col2.g   = drand48();&lt;br /&gt;
      col2.b   = drand48();&lt;br /&gt;
      size    = drand48()*10.0;&lt;br /&gt;
      ns2vthcline(start, end, col1, col2, size);        /* Draw the thick line */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2thcline</id>
		<title>Function:ns2thcline</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2thcline"/>
				<updated>2009-01-06T01:51:44Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2cline==&lt;br /&gt;
Draw a thick coloured line.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2thcline(float x1, float y1, float z1, float x2, float y2, float z2, &lt;br /&gt;
                float red1, float green1, &lt;br /&gt;
                float blue1, float red2, float green2, float blue2,float width);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a thick coloured line, with colour blended between the two given colours along the line, and given width.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthcline | ns2vthcline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a thick coloured line - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2line | ns2line ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a line from one point to another in a specific colour.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vline | ns2vline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a line from one point to another in a specific colour - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thline | ns2thline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a thick line from one point to another in a specific colour. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthline | ns2vthline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a thick line from one point to another in a specific colour - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2cline | ns2cline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a coloured line, with colour blended between the two given colours along the line. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vcline | ns2vcline ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a coloured line, with colour blended between the two given colours along the line - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   float x1, y1, z1;                            /* Start of line */&lt;br /&gt;
   float x2, y2, z2;                            /* End of line */&lt;br /&gt;
   float r1, g1, b1;                            /* Colour of line segment (start) */&lt;br /&gt;
   float r2, g2, b2;                            /* Colour of line segment (end) */&lt;br /&gt;
   float size;                                  /* Thickness of line */&lt;br /&gt;
   int N = 10;                                  /* Number of lines */&lt;br /&gt;
   int i;                                       /* Loop variable */&lt;br /&gt;
&lt;br /&gt;
   srand48((long)time(NULL));                   /* Seed random numbers */&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   s2sci(S2_PG_YELLOW);                         /* Set colour */&lt;br /&gt;
   for (i=0;i&amp;lt;N;i++) {&lt;br /&gt;
      x1 = drand48()*2.0 - 1.0;                 /* Random (x,y,z) coordinates */&lt;br /&gt;
      y1 = drand48()*2.0 - 1.0;&lt;br /&gt;
      z1 = drand48()*2.0 - 1.0;&lt;br /&gt;
      x2 = drand48()*2.0 - 1.0;                 /* Random (x,y,z) coordinates */&lt;br /&gt;
      y2 = drand48()*2.0 - 1.0;&lt;br /&gt;
      z2 = drand48()*2.0 - 1.0;&lt;br /&gt;
      r1  = drand48();&lt;br /&gt;
      g1  = drand48();&lt;br /&gt;
      b1  = drand48();&lt;br /&gt;
      r2  = drand48();&lt;br /&gt;
      g2  = drand48();&lt;br /&gt;
      b2  = drand48();&lt;br /&gt;
      size = drand48()*10.0;                    /* Line thickness */&lt;br /&gt;
      ns2thcline(x1,y1,z1, x2,y2,z2, r1,g1,b1, r2,g2,b2, size); /* Draw the thick line */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vthwcube</id>
		<title>Function:ns2vthwcube</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vthwcube"/>
				<updated>2009-01-06T01:51:27Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vthwcube==&lt;br /&gt;
Draw a cube - vector input.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vthwcube(XYZ P1, XYZ P2, COLOUR col, float width);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a wireframe cube (with axes parallel to the coordinate axes) in a specific colour and thickness&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thwcube | ns2thwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2wcube | s2wcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2scube | ns2scube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vscube |ns2vscube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   char xopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char yopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char zopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);      /* Draw the coordinate box */&lt;br /&gt;
   s2lab(&amp;quot;X-axis&amp;quot;,&amp;quot;Y-axis&amp;quot;,&amp;quot;Z-axis&amp;quot;,&amp;quot;Plot&amp;quot;);    /* Write some labels */&lt;br /&gt;
&lt;br /&gt;
   XYZ xyz1 = { -0.8, -0.8, -0.8 };             /* Box coordinate */&lt;br /&gt;
   XYZ xyz2 = { +0.8, +0.8, +0.8 };             /* Box coordinate */&lt;br /&gt;
&lt;br /&gt;
   COLOUR col = { 1.0, 0.3, 0.2 };              /* RGB colours */&lt;br /&gt;
&lt;br /&gt;
   float w = 2.0;                               /* Box border width */&lt;br /&gt;
&lt;br /&gt;
   ns2vthwcube(xyz1, xyz2, col, w);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2thwcube</id>
		<title>Function:ns2thwcube</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2thwcube"/>
				<updated>2009-01-06T01:51:11Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2thwcube==&lt;br /&gt;
Draw a wireframe cube.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2thwcube(float x1, float y1, float z1, float x2, float y2, float z2,&lt;br /&gt;
		float red, float green, float blue, float width);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a wireframe cube (with axes parallel to the coordinate axes) in a specific colour and thickness.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthwcube | ns2vthwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2wcube | s2wcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2scube | ns2scube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vscube |ns2vscube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   char xopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char yopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char zopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);      /* Draw the coordinate box */&lt;br /&gt;
   s2lab(&amp;quot;X-axis&amp;quot;,&amp;quot;Y-axis&amp;quot;,&amp;quot;Z-axis&amp;quot;,&amp;quot;Plot&amp;quot;);    /* Write some labels */&lt;br /&gt;
&lt;br /&gt;
   float x1 = -0.8, x2 = +0.8;                  /* Box coordinates */&lt;br /&gt;
   float y1 = -0.8, y2 = +0.8;&lt;br /&gt;
   float z1 = -0.8, z2 = +0.8;&lt;br /&gt;
&lt;br /&gt;
   float r = 1.0, g = 0.3, b = 0.2;             /* RGB colours */&lt;br /&gt;
&lt;br /&gt;
   float w = 2.0;                               /* Box border width */&lt;br /&gt;
&lt;br /&gt;
   ns2thwcube(x1,y1,z1, x2,y2,z2, r,g,b, w);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2verc</id>
		<title>Function:ns2verc</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2verc"/>
				<updated>2009-01-06T01:50:52Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2verc==&lt;br /&gt;
Draw an arc - vector input.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2verc(XYZ P, XYZ N, XYZ S, float deg, int nseg, float axratio);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw an arc with specified major/minor axis ratio. The major axis is given by the starting vector.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; [[Function:ns2erc |ns2erc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an arc.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; [[Function:ns2arc |ns2arc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an arc at (px,py,pz) with normal (nx,ny,nz) in current pen (thickness,colour)..&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2varc | ns2varc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an arc at (px,py,pz) with normal (nx,ny,nz) in current pen (thickness,colour) - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2line |s2line]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a poly line, n vertices at (xpts, ypts, zpts).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   XYZ pos;                                     /* Position */&lt;br /&gt;
   XYZ normal;                                  /* Normal */&lt;br /&gt;
   XYZ start;                                   /* Starting vector */&lt;br /&gt;
   float deg = 180.0;                           /* Angular extent */&lt;br /&gt;
   int nseg = 48;                               /* Number of segments */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   pos.x    = 0.0; pos.y    = 0.0; pos.z    = 0.0;      /* Set position */&lt;br /&gt;
   normal.x = 0.0; normal.y = 1.0; normal.z = 1.0;      /* Normal vector */&lt;br /&gt;
   start.x  = 1.0; start.y  = 0.0; start.z  = 0.0;      /* Normal vector */&lt;br /&gt;
&lt;br /&gt;
   s2slw(3);                                    /* Set line width */&lt;br /&gt;
   s2sci(S2_PG_YELLOW);                         /* Set the colour */&lt;br /&gt;
&lt;br /&gt;
   float axratio = 2.0;&lt;br /&gt;
&lt;br /&gt;
   ns2verc(pos, normal, start, deg, nseg, axratio);     /* Draw the arc */&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2erc</id>
		<title>Function:ns2erc</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2erc"/>
				<updated>2009-01-06T01:50:37Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2erc==&lt;br /&gt;
Draw an arc.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2erc(float px, float py, float pz,&lt;br /&gt;
	    float nx, float ny, float nz,&lt;br /&gt;
	    float sx, float sy, float sz,&lt;br /&gt;
	    float deg, int nseg, float axratio);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw an arc  with specified major/minor axis ratio. The major axis is given by the starting vector.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; [[Function:ns2verc |ns2verc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an arc - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; [[Function:ns2arc |ns2arc]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an arc at (px,py,pz) with normal (nx,ny,nz) in current pen (thickness,colour).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2varc | ns2varc ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw an arc at (px,py,pz) with normal (nx,ny,nz) in current pen (thickness,colour) - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:s2line |s2line]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a poly line, n vertices at (xpts, ypts, zpts).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   float px, py, pz;                            /* Position */&lt;br /&gt;
   float nx, ny, nz;                            /* Normal */&lt;br /&gt;
   float sx, sy, sz;                            /* Starting vector */&lt;br /&gt;
   float deg = 180.0;                           /* Angular extent */&lt;br /&gt;
   int nseg = 48;                               /* Number of segments */&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   px = 0.0; py = 0.0; pz = 0.0;                /* Set position */&lt;br /&gt;
   nx = 0.0; ny = 1.0; nz = 1.0;                /* Normal vector */&lt;br /&gt;
   sx = 1.0; sy = 0.0; sz = 0.0;                /* Starting vector */&lt;br /&gt;
&lt;br /&gt;
   s2slw(3);                                    /* Set line width */&lt;br /&gt;
   s2sci(S2_PG_YELLOW);                         /* Set the colour */&lt;br /&gt;
&lt;br /&gt;
   float axratio = 0.5;&lt;br /&gt;
   ns2erc(px,py,pz, nx,ny,nz, sx,sy,sz, deg, nseg, axratio);&lt;br /&gt;
                                                /* Draw the arc */&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vplanetx</id>
		<title>Function:ns2vplanetx</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vplanetx"/>
				<updated>2009-01-06T01:50:16Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vplanetx==&lt;br /&gt;
Draw a planet with texture id.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vplanetx(XYZ iP, float ir, COLOUR icol, unsigned int itextureid, &lt;br /&gt;
                 float texture_phase, XYZ axis, float rotation);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a planet, which is a textured sphere whose texture can be &amp;quot;slid&amp;quot; around the planet, and the planet then rotated about an arbitrary axis. Texture phase is in the range [0..1], while rotation angle is in degrees.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vplanett | ns2vplanett]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a planet - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vsphere | ns2vsphere ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a sphere, with a given centre, radius and colour - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2spheret | ns2spheret]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture filename &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vspheret | ns2vspheret]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture filename - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2spherex| ns2spherex]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture ID&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vspherex | ns2vspherex]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture ID - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sphere| ns2sphere]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a sphere.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   float radius = 0.5;                          /* Radius of planet */&lt;br /&gt;
   XYZ xyz = { -1.0, 0.0, 0.0 };                /* Location of planet */&lt;br /&gt;
&lt;br /&gt;
   COLOUR colour = { 1.0, 1.0, 0.0 };           /* Yellow */&lt;br /&gt;
   static int tid = -1;                         /* Texture id */&lt;br /&gt;
   if (tid &amp;lt; 0) {                               /* First time through? */&lt;br /&gt;
      tid = ss2lt(&amp;quot;firetile2_pow2_rgb.tga&amp;quot;);    /* Load texture for re-use */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   static float phase = 30.0;                   /* Set the texture phase */&lt;br /&gt;
   XYZ axis = { 0.0, 0.0, 1.0 };                /* Set the rotation axis */&lt;br /&gt;
   static float rotation = 0.0;                 /* Set the rotation value */&lt;br /&gt;
&lt;br /&gt;
   ns2vplanetx(xyz, radius, colour, tid, phase, axis, rotation);&lt;br /&gt;
                                                /* Draw the &amp;quot;planet&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
   xyz.x = 0.0;                                 /* Shift centre */&lt;br /&gt;
   axis.x = 0.0; axis.y = 1.0; axis.z = 0.0;    /* New rotation axis */&lt;br /&gt;
   ns2vplanetx(xyz, radius, colour, tid, phase, axis, rotation);&lt;br /&gt;
                                                /* Draw the &amp;quot;planet&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
   xyz.x = 1.0;                                 /* Shift centre */&lt;br /&gt;
   axis.x = 1.0; axis.y = 0.0; axis.z = 0.0;    /* New rotation axis */&lt;br /&gt;
   ns2vplanetx(xyz, radius, colour, tid, phase, axis, rotation);&lt;br /&gt;
                                                /* Draw the &amp;quot;planet&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
   rotation += 1.0;                             /* Update rotation in degrees */&lt;br /&gt;
   if (rotation &amp;gt; 360.0) rotation = 0.0;        /* Full circle? Reset */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
&lt;br /&gt;
   ss2ssr(32);                                  /* Set the sphere resolution */&lt;br /&gt;
   cs2scb(cb);                                  /* Install dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vplanett</id>
		<title>Function:ns2vplanett</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vplanett"/>
				<updated>2009-01-06T01:49:57Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vplanett==&lt;br /&gt;
Draw a planet with texture filename.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void ns2vplanett(XYZ iP, float ir, COLOUR icol, char *itexturefn,float texture_phase, XYZ axis, float rotation);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Draw a planet, which is a textured sphere whose texture can be &amp;quot;slid&amp;quot; around the planet, and the planet then rotated about an arbitrary axis. Texture phase is in the range [0..1], while rotation angle is in degrees.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vplanetx | ns2vplanetx]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a planet - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vsphere | ns2vsphere ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a sphere, with a given centre, radius and colour - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2spheret | ns2spheret]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture filename &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vspheret | ns2vspheret]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture filename - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2spherex| ns2spherex]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture ID&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vspherex | ns2vspherex]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a textured sphere, with given centre, radius, colour and texture ID - vector input.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2sphere| ns2sphere]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a sphere.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void cb(double *t, int *kc)&lt;br /&gt;
{&lt;br /&gt;
   float radius = 0.5;                          /* Radius of planet */&lt;br /&gt;
   XYZ xyz = { -1.0, 0.0, 0.0 };                /* Location of planet */&lt;br /&gt;
   static char *texture = &amp;quot;firetile2_pow2_rgb.tga&amp;quot;;     /* Texture filename */&lt;br /&gt;
&lt;br /&gt;
   COLOUR colour = { 1.0, 1.0, 0.0 };           /* Yellow */&lt;br /&gt;
&lt;br /&gt;
   static float phase = 30.0;                   /* Set the texture phase */&lt;br /&gt;
   XYZ axis = { 0.0, 0.0, 1.0 };                /* Set the rotation axis */&lt;br /&gt;
   static float rotation = 0.0;                 /* Set the rotation value */&lt;br /&gt;
&lt;br /&gt;
   ns2vplanett(xyz, radius, colour, texture, phase, axis, rotation);&lt;br /&gt;
                                                /* Draw the &amp;quot;planet&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
   xyz.x = 0.0;                                 /* Shift centre */&lt;br /&gt;
   axis.x = 0.0; axis.y = 1.0; axis.z = 0.0;    /* New rotation axis */&lt;br /&gt;
   ns2vplanett(xyz, radius, colour, texture, phase, axis, rotation);&lt;br /&gt;
                                                /* Draw the &amp;quot;planet&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
   xyz.x = 1.0;                                 /* Shift centre */&lt;br /&gt;
   axis.x = 1.0; axis.y = 0.0; axis.z = 0.0;    /* New rotation axis */&lt;br /&gt;
   ns2vplanett(xyz, radius, colour, texture, phase, axis, rotation);&lt;br /&gt;
                                                /* Draw the &amp;quot;planet&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
   rotation += 1.0;                             /* Update rotation in degrees */&lt;br /&gt;
   if (rotation &amp;gt; 360.0) rotation = 0.0;        /* Full circle? Reset */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
&lt;br /&gt;
   ss2ssr(32);                                  /* Set the sphere resolution */&lt;br /&gt;
   cs2scb(cb);                                  /* Install dynamic callback */&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vplnett</id>
		<title>Function:ns2vplnett</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:ns2vplnett"/>
				<updated>2009-01-06T01:49:16Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ns2vplanett==&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Back to [[Function:Template | template]] page.&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2help</id>
		<title>Function:s2help</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2help"/>
				<updated>2009-01-06T01:48:48Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==s2help==&lt;br /&gt;
Set the custom help string.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void s2help(char *helpstr);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Set the custom help string.This is shown on the 2nd press of the F1 key for S2PLOT programs, if it is set.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;, argc, argv);                   /* Prompt for display type */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0,&amp;quot;BCDET&amp;quot;,0,0);  /* Draw coordinate box */&lt;br /&gt;
&lt;br /&gt;
   s2textxy(-1.0, 0.0, 0.0, &amp;quot;Press F1 twice to see custom help&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   s2help(&amp;quot;This is a custom help message - press F1 again to toggle off!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2wcube</id>
		<title>Function:s2wcube</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:s2wcube"/>
				<updated>2009-01-06T01:26:30Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==s2wcube==&lt;br /&gt;
&lt;br /&gt;
Draw a wireframe cube.&lt;br /&gt;
&lt;br /&gt;
==Prototype==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void s2wcube(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Draw a wireframe cube with edges parallel to the main coordinate axes.  Thickness and colour controlled by standard S2PLOT functions.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2scube | ns2scube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vscube |ns2vscube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a solid cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2thwcube | ns2thwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;[[Function:ns2vthwcube | ns2vthwcube ]]&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Draw a wireframe cube - vector input. &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;quot;s2plot.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
   char xopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char yopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
   char zopt[] = &amp;quot;BCDETMNOPQ&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
   s2opend(&amp;quot;/?&amp;quot;,argc, argv);                    /* Open the display */&lt;br /&gt;
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */&lt;br /&gt;
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);      /* Draw the coordinate box */&lt;br /&gt;
   s2lab(&amp;quot;X-axis&amp;quot;,&amp;quot;Y-axis&amp;quot;,&amp;quot;Z-axis&amp;quot;,&amp;quot;Plot&amp;quot;);    /* Write some labels */&lt;br /&gt;
&lt;br /&gt;
   float x1 = -0.8, x2 = +0.8;                  /* Box coordinates */&lt;br /&gt;
   float y1 = -0.8, y2 = +0.8;&lt;br /&gt;
   float z1 = -0.8, z2 = +0.8;&lt;br /&gt;
&lt;br /&gt;
   s2sci(S2_PG_RED);&lt;br /&gt;
&lt;br /&gt;
   s2wcube(x1,x2, y1,y2, z1,z2);&lt;br /&gt;
&lt;br /&gt;
   s2show(1);                                   /* Open the s2plot window */&lt;br /&gt;
&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[S2PLOT:Function List | Back]] to S2PLOT function list.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	<entry>
		<id>https://astronomy.swin.edu.au/s2plot/index.php?title=Function:template</id>
		<title>Function:template</title>
		<link rel="alternate" type="text/html" href="https://astronomy.swin.edu.au/s2plot/index.php?title=Function:template"/>
				<updated>2009-01-06T01:25:24Z</updated>
		
		<summary type="html">&lt;p&gt;Summary: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Template==&lt;br /&gt;
&lt;br /&gt;
Link&lt;br /&gt;
&lt;br /&gt;
[[Function:s2wcube | s2wcube]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Back to [[Function:Template | template]] page.&lt;/div&gt;</summary>
		<author><name>S2plot admin</name></author>	</entry>

	</feed>