Function:ns2sphere

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:04, 28 October 2007
S2plot admin (Talk | contribs)

← Previous diff
Revision as of 23:07, 28 October 2007
S2plot admin (Talk | contribs)

Next diff →
Line 16: Line 16:
<table> <table>
<tr><td>[[Function:struct_COLOUR | struct_COLOUR ]]</td><td>Data structure for (r,g,b) colour indices. </td></tr> <tr><td>[[Function:struct_COLOUR | struct_COLOUR ]]</td><td>Data structure for (r,g,b) colour indices. </td></tr>
 +<tr><td>[[Function:ns2vsphere | ns2vsphere ]]</td><td>Draw a sphere, with a given centre, radius and colour - vector input.</td></tr>
 +<tr><td>[[Function:ns2spheret | ns2spheret]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture filename </td></tr>
 +<tr><td>[[Function:ns2vspheret | ns2vspheret]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture filename - vector input.</td></tr>
 +<tr><td>[[Function:ns2spherex| ns2spherex]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture ID</td></tr>
 +<tr><td>[[Function:ns2vspherex | ns2vspherex]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture ID - vector input.</td></tr>
</table> </table>

Revision as of 23:07, 28 October 2007

ns2sphere

Draw a sphere, with a given centre, radius and colour.

Prototype

void ns2sphere(float x, float y, float z, float r, float red, float green, float blue);

Description

Draw a sphere, with a given centre (x,y,z), radius (r) and RGB colour (red, green, blue).

See Also

struct_COLOUR Data structure for (r,g,b) colour indices.
ns2vsphere Draw a sphere, with a given centre, radius and colour - vector input.
ns2spheretDraw a textured sphere, with given centre, radius, colour and texture filename
ns2vspheretDraw a textured sphere, with given centre, radius, colour and texture filename - vector input.
ns2spherexDraw a textured sphere, with given centre, radius, colour and texture ID
ns2vspherexDraw a textured sphere, with given centre, radius, colour and texture ID - vector input.


Code Example

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

int main(int argc, char *argv[])
{
   float radius = 0.5;				/* Radius of sphere */
   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 */

   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