Function:ns2vtext
From S2PLOT
ns2vtext
Draw text at a given position, with right and up vectors, a specific colour, and a text string of course - vector input.
Prototype
void ns2vtext(XYZ P, XYZ R, XYZ U, COLOUR col, char *text);
Description
Draw text at a given position (P), with right vector (R) and up vector (U), RGB colour (col), and text string (text). Uses vector data structures.
See Also
ns2text | Draw text at a given position, with right and up vectors, a specific colour, and a text string of course. |
struct_COLOUR | Data structure for (r,g,b) colour indices. |
struct_XYZ | Data structure for (x,y,z) coordinates. |
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
XYZ xyz = { 0.0, 0.0, 0.0 }; /* Position */
XYZ right = { 0.4, 0.3, 0.2 }; /* Right vector */
XYZ up = { 0.2, 0.8, -0.6 }; /* Up vector */
COLOUR col = { 1.0, 0.0, 0.4 }; /* Colour */
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 */
ns2vtext(xyz, right, up, col, text); /* Display some text */
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.