Function:ns2vspheret
From S2PLOT
(Difference between revisions)
Revision as of 23:09, 28 October 2007 S2plot admin (Talk | contribs) ← Previous diff |
Current revision S2plot admin (Talk | contribs) |
||
Line 15: | Line 15: | ||
== See Also == | == See Also == | ||
<table> | <table> | ||
+ | <table> | ||
+ | <tr><td>[[Function:ns2sphere | ns2sphere]]</td><td>Draw a textured sphere, with given centre, radius and colour</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:ns2spheret | ns2spheret ]]</td><td>Draw a textured sphere, with given centre, radius, colour and texture filename. </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:struct_COLOUR | struct_COLOUR ]]</td><td>Data structure for (r,g,b) colour indices. </td></tr> | ||
+ | |||
</table> | </table> | ||
Current revision
ns2vspheret
Draw a textured sphere, with given centre, radius, colour and texture filename - vector input.
Prototype
void ns2vspheret(XZY P, float r, COLOUR col, char *texturefn);
Description
Draw a textured sphere, with a given centre (P), radius (r) and colour (col), using vector data structures. The texture file is specified by texturefn, and must be a .TGA file that has length and width as powers of 2. The utility program texturise.csh can be used to convert your textures to the appropriate format. This is an OpenGL restriction.
See Also
ns2sphere | Draw a textured sphere, with given centre, radius and colour |
ns2vsphere | Draw a sphere, with a given centre, radius and colour - vector input. |
ns2spheret | Draw a textured sphere, with given centre, radius, colour and texture filename. |
ns2spherex | Draw a textured sphere, with given centre, radius, colour and texture ID |
ns2vspherex | Draw a textured sphere, with given centre, radius, colour and texture ID - vector input. |
struct_COLOUR | Data structure for (r,g,b) colour indices. |
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
float radius = 0.5; /* Radius of sphere */
char *texture = "firetile2_pow2_rgb.tga";
/* Texture in directory pointed to by S2PLOT_TEXPATH */
XYZ xyz = { 0.0, 0.0, 0.0 };
COLOUR colour = { 1.0, 1.0, 0.0 }; /* Yellow */
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 */
ns2vspheret(xyz, radius, colour, texture); /* A textured sphere */
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.