Function:ns2vscube
From S2PLOT
(Difference between revisions)
| Revision as of 22:28, 6 January 2009 S2plot admin (Talk | contribs) ← Previous diff |
Current revision S2plot admin (Talk | contribs) |
||
| Line 1: | Line 1: | ||
| ==ns2vscube== | ==ns2vscube== | ||
| + | Draw a solid cube - vector input. | ||
| ==Prototype== | ==Prototype== | ||
| <code><pre> | <code><pre> | ||
| + | void ns2vscube(XYZ P1, XYZ P2, COLOUR col, float alpha); | ||
| </pre></code> | </pre></code> | ||
| ==Description== | ==Description== | ||
| + | Draw a solid cube with filled but transparent faces. | ||
| ==See Also== | ==See Also== | ||
| + | <table> | ||
| + | <tr><td>[[Function:ns2scube | ns2scube ]]</td><td>Draw a solid cube.</td></tr> | ||
| + | <tr><td>[[Function:s2wcube |s2wscube ]]</td><td>Draw a wireframe cube.</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 Example== | ||
| <code><pre> | <code><pre> | ||
| - | </pre></code> | + | #include <stdio.h> |
| + | #include <stdlib.h> | ||
| + | #include "s2plot.h" | ||
| - | [[S2PLOT:Function List | Back]] to S2PLOT function list. | + | 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 */ | ||
| + | XYZ xyz1 = { -0.8, -0.8, -0.8 }; /* Box coordinate */ | ||
| + | XYZ xyz2 = { +0.8, +0.8, +0.8 }; /* Box coordinate */ | ||
| + | COLOUR col = { 1.0, 0.3, 0.2 }; /* RGB colours */ | ||
| - | __NOTOC__ | + | float alpha = 0.4; /* Alpha channel transparency */ |
| - | __NOEDITSECTION__ | + | |
| + | ns2vscube(xyz1, xyz2, col, alpha); | ||
| - | Back to [[Function:Template | template]] page. | + | s2show(1); /* Open the s2plot window */ |
| + | |||
| + | return 1; | ||
| + | } | ||
| + | </pre></code> | ||
| + | |||
| + | [[S2PLOT:Function List | Back]] to S2PLOT function list. | ||
| + | |||
| + | __NOTOC__ | ||
| + | __NOEDITSECTION__ | ||
Current revision
ns2vscube
Draw a solid cube - vector input.
Prototype
void ns2vscube(XYZ P1, XYZ P2, COLOUR col, float alpha);
Description
Draw a solid cube with filled but transparent faces.
See Also
| ns2scube | Draw a solid cube. |
| s2wscube | Draw a wireframe cube. |
| 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 */
XYZ xyz1 = { -0.8, -0.8, -0.8 }; /* Box coordinate */
XYZ xyz2 = { +0.8, +0.8, +0.8 }; /* Box coordinate */
COLOUR col = { 1.0, 0.3, 0.2 }; /* RGB colours */
float alpha = 0.4; /* Alpha channel transparency */
ns2vscube(xyz1, xyz2, col, alpha);
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.
