Function:ns2sphere

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:03, 7 January 2009
S2plot admin (Talk | contribs)

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

Line 21: Line 21:
<tr><td>[[Function:ns2spherex| ns2spherex]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture ID</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> <tr><td>[[Function:ns2vspherex | ns2vspherex]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture ID - vector input.</td></tr>
-<tr><td>[[Function:ns2vplanett| ns2vplanett]]</td><td>Draw a planet.</td></tr>+<tr><td>[[Function:ns2vplanett| ns2vplanett]]</td><td>Draw a planet - vector input.</td></tr>
<tr><td>[[Function:ns2vplanetx | ns2vplanetx]]</td><td>Draw a planet - vector input.</td></tr> <tr><td>[[Function:ns2vplanetx | ns2vplanetx]]</td><td>Draw a planet - vector input.</td></tr>
</table> </table>

Current revision

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.
ns2vplanettDraw a planet - vector input.
ns2vplanetxDraw a planet - 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