Function:ns2text

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:39, 30 October 2007
S2plot admin (Talk | contribs)

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

Line 6: Line 6:
<code><pre> <code><pre>
-void ns2text(float x, float y, float z, float rx, float ry, float rz, float ux, float uy, float uz, float red, float green, float blue, char *text);+void ns2text(float x, float y, float z, float rx, float ry, float rz,
 +float ux, float uy, float uz, float red, float green, float blue, char *text);
</pre></code> </pre></code>

Current revision

ns2text

Draw text at a given position, with right and up vectors, a specific colour, and a text string of course.

Prototype

void ns2text(float x, float y, float z, float rx, float ry, float rz, 
float ux, float uy, float uz, float red, float green, float blue, char *text);

Description

Draw text at a given position (x,y,z), with right vector (rx,ry,rz) and up vector (ux,uy,uz), RGB colour (red,greeen,blue), and text string (text).

See Also

ns2vtext Draw text at a given position, with right and up vectors, a specific colour, and a text string of course - vector input.


Code Example

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

int main(int argc, char *argv[])
{
   float x = 0, 				/* Position */
         y = 0,
         z = 0;
   float rx = 0.4,				/* Right vector */
	 ry = 0.3,
	 rz = 0.2;
   float ux = 0.2,				/* Up vector */
         uy = 0.8,
         uz = -0.6;
   float r = 1.0,				/* Colour */
         g = 0.0,
	 b = 0.4;
   char *text = "S2PLOT is great!";

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

   ns2text(x,y,z, rx,ry,rz, ux,uy,uz, r,g,b, text);
						/* Display some text */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.