Function:s2wcube

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:26, 6 January 2009
S2plot admin (Talk | contribs)

← Previous diff
Current revision
S2plot admin (Talk | contribs)

Line 1: Line 1:
==s2wcube== ==s2wcube==
 +
 +Draw a wireframe cube.
 +
 +==Prototype==
 +
 +<code><pre>
 +void s2wcube(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);
 +</pre></code>
 +
 +==Description==
 +Draw a wireframe cube with edges parallel to the main coordinate axes. Thickness and colour controlled by standard S2PLOT functions.
 +
 +==See Also==
 +<table>
 +<tr><td>[[Function:ns2scube | ns2scube ]]</td><td>Draw a solid cube.</td></tr>
 +<tr><td>[[Function:ns2vscube |ns2vscube ]]</td><td>Draw a solid cube - vector input. </td></tr>
 +<tr><td>[[Function:ns2thwcube | ns2thwcube ]]</td><td>Draw a wireframe cube. </td></tr>
 +<tr><td>[[Function:ns2vthwcube | ns2vthwcube ]]</td><td>Draw a wireframe cube - vector input. </td></tr>
 +</table>
 +
 +==Code Example==
 +
 +<code><pre>
 +#include <stdio.h>
 +#include <stdlib.h>
 +#include "s2plot.h"
 +
 +int main(int argc, char *argv[])
 +{
 + char xopt[] = "BCDETMNOPQ";
 + char yopt[] = "BCDETMNOPQ";
 + char zopt[] = "BCDETMNOPQ";
 +
 + s2opend("/?",argc, argv); /* Open the display */
 + s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
 + s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0); /* Draw the coordinate box */
 + s2lab("X-axis","Y-axis","Z-axis","Plot"); /* Write some labels */
 +
 + float x1 = -0.8, x2 = +0.8; /* Box coordinates */
 + float y1 = -0.8, y2 = +0.8;
 + float z1 = -0.8, z2 = +0.8;
 +
 + s2sci(S2_PG_RED);
 +
 + s2wcube(x1,x2, y1,y2, z1,z2);
 +
 + s2show(1); /* Open the s2plot window */
 +
 + return 0;
 +}
 +
 +</pre></code>
 +
 +[[S2PLOT:Function List | Back]] to S2PLOT function list.
 +
 +__NOTOC__
 +__NOEDITSECTION__

Current revision

s2wcube

Draw a wireframe cube.

Prototype

void s2wcube(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);

Description

Draw a wireframe cube with edges parallel to the main coordinate axes. Thickness and colour controlled by standard S2PLOT functions.

See Also

ns2scube Draw a solid cube.
ns2vscube Draw a solid cube - vector input.
ns2thwcube Draw a wireframe cube.
ns2vthwcube Draw a wireframe cube - vector input.

Code Example

#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"

int main(int argc, char *argv[])
{
   char xopt[] = "BCDETMNOPQ";
   char yopt[] = "BCDETMNOPQ";
   char zopt[] = "BCDETMNOPQ";

   s2opend("/?",argc, argv);                    /* Open the display */
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */
   s2box(xopt, 0,0, yopt, 0,0, zopt, 0,0);      /* Draw the coordinate box */
   s2lab("X-axis","Y-axis","Z-axis","Plot");    /* Write some labels */

   float x1 = -0.8, x2 = +0.8;                  /* Box coordinates */
   float y1 = -0.8, y2 = +0.8;
   float z1 = -0.8, z2 = +0.8;

   s2sci(S2_PG_RED);

   s2wcube(x1,x2, y1,y2, z1,z2);

   s2show(1);                                   /* Open the s2plot window */

   return 0;
}

Back to S2PLOT function list.


Personal tools