Function:ss2ssr

From S2PLOT

Jump to: navigation, search

ss2ssr

Set sphere resolution.

Prototype

void ss2ssr(int res);

Description

Set sphere resolution. Spheres are drawn with (res*res) flat surfaces. Larger spheres (or spheres that will be viewed closer-up) require higher sphere resolutions. Be warned that rendering time takes a severe hit with resolutions much larger than about 12.

See Also

ss2qsr Query the sphere resolution.
ns2sphere Draw a sphere, with a given centre, radius and colour.


Code Example

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

int main(int argc, char *argv[])
{
   float radius = 0.5;				/* Radius of sphere */
   int resolution = 32;				/* Sphere resolution */

   s2opend("/?",argc, argv);			/* Open the display */
   s2swin(-1.,1., -1.,1., -1.,1.);		/* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);	/* Draw coordinate box */

   ss2ssr(resolution);			/* Set the resolution */
   ns2sphere(0.0, 0.0, 0.0, radius, 1.0, 1.0, 0.0);
						/* A yellow sphere */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools