Function:pushVRMLname
From S2PLOT
(Difference between revisions)
Revision as of 21:58, 16 December 2007 S2plot admin (Talk | contribs) ← Previous diff |
Revision as of 21:59, 16 December 2007 S2plot admin (Talk | contribs) Next diff → |
||
Line 9: | Line 9: | ||
==Description== | ==Description== | ||
- | Push the given name onto the VRML "name stack". When VRML data is written, it is written in "groups" with these names. The default group name is "ANON". To view the VRML output, which is written to a file called <tt>test.wrl</tt>, you will need a suitable VRML viewer for your operating system. VRML output is most useful for incorporating into 3d-PDF documents. See [http://astronomy.swin.edu.au/s2plot/3d-pdf | here] for examples. | + | Push the given name onto the VRML "name stack". When VRML data is written, it is written in "groups" with these names. The default group name is "ANON". To view the VRML output, which is written to a file called <tt>test.wrl</tt>, you will need a suitable VRML viewer for your operating system. VRML output is most useful for incorporating into 3d-PDF documents. See [http://astronomy.swin.edu.au/s2plot/3d-pdf here] for examples. |
== See Also == | == See Also == |
Revision as of 21:59, 16 December 2007
pushVRMLname
Set the clipping plane expansion factor.
Prototype
void ss2snfe(float expand);
Description
Push the given name onto the VRML "name stack". When VRML data is written, it is written in "groups" with these names. The default group name is "ANON". To view the VRML output, which is written to a file called test.wrl, you will need a suitable VRML viewer for your operating system. VRML output is most useful for incorporating into 3d-PDF documents. See here for examples.
See Also
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
fprintf(stderr,"Press <shift>-<w> to write VRML\n");
fprintf(stderr,"Creates VRML file: test.wrl\n");
s2opend("/s2mono", argc, argv); /* Open in mono mode */
s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
pushVRMLname("BOX"); /* Create a new VRML object name */
s2box("BCDE",0,0,"BCDE",0,0,"BCDE",0,0);
/* This will not appear in the VRML */
int i, N = 100; /* Loop variables */
XYZ xyz; /* Point location */
COLOUR col; /* Point colour */
pushVRMLname("POINTS"); /* Create a new VRML object name */
for (i=0;i<N;i++) {
xyz.x = drand48()*2.0 - 1.0; /* Random positions */
xyz.y = drand48()*2.0 - 1.0;
xyz.z = drand48()*2.0 - 1.0;
col.r = drand48()*2.0 - 1.0; /* Random colours */
col.g = drand48()*2.0 - 1.0;
col.b = drand48()*2.0 - 1.0;
ns2vthpoint(xyz, col, 2); /* Draw current point */
}
pushVRMLname(""); /* Restore default VRML object name */
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.