Function:ns2thpoint

From S2PLOT

Jump to: navigation, search

ns2thpoint

Draw a thick point at given position, in colour and thickness in pixels (not world coords).

Prototype

void ns2thpoint(float x, float y, float z, float red, float green, float blue, float size);

Description

Draw a thick point at the position (x,y,z) with RBG colour (red,green,blue) and thickness size pixels (not world coordinates).

See Also

ns2point Draw a point at the given position and colour.
ns2vpoint Draw a point at the given position and colour - vector input.
ns2vthpoint Draw a thick point at given position, in colour and thickness in pixels (not world coords) - vector input.


Code Example

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

int main(int argc, char *argv[])
{
   int N = 100;					/* Number of points */
   float x, y, z;				/* Positions */
   float r, g, b;				/* Colours */
   float size;					/* Thickness of point */
   int i;

   srand48((long)time(NULL));			/* Seed random numbers */

   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 */

   for (i=0;i<N;i++) {				/* Random data positions */
      x = drand48()*2.0 - 1.0;
      y = drand48()*2.0 - 1.0;
      z = drand48()*2.0 - 1.0;
      r = drand48();
      g = drand48();
      b = drand48();
      size = drand48()*10.0;
      ns2thpoint(x,y,z, r,g,b, size);		/* Draw the thick point */
   }
   

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

Back to S2PLOT function list.


Personal tools