home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / tri3 / d3dsphr.h < prev    next >
C/C++ Source or Header  |  1997-07-14  |  2KB  |  46 lines

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995, 1996 Microsoft Corporation. All Rights Reserved.
  4.  *
  5.  *  File: d3dsphr.h
  6.  *
  7.  ***************************************************************************/
  8. #ifndef __D3DSPHR_H__
  9. #define __D3DSPHR_H__
  10.  
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /*
  15.  * Generates a sphere around the y-axis centered at the origin including
  16.  * normals and texture coordiantes.  Returns TRUE on success and FALSE on
  17.  * failure.
  18.  *     sphere_r     Radius of the sphere.
  19.  *     num_rings    Number of full rings not including the top and bottom
  20.  *            caps.
  21.  *     num_sections Number of sections each ring is divided into.  Each
  22.  *            section contains two triangles on full rings and one 
  23.  *            on top and bottom caps.
  24.  *     sx, sy, sz   Scaling along each axis.  Set each to 1.0 for a 
  25.  *            perfect sphere. 
  26.  *     plpv         On exit points to the vertices of the sphere.  The
  27.  *            function allocates this space.  Not allocated if
  28.  *            function fails.
  29.  *     plptri       On exit points to the triangles of the sphere which 
  30.  *            reference vertices in the vertex list.  The function
  31.  *            allocates this space. Not allocated if function fails.
  32.  *     pnum_v       On exit contains the number of vertices.
  33.  *     pnum_tri     On exit contains the number of triangles.
  34.  */
  35. BOOL 
  36. GenerateSphere(float sphere_r, int num_rings, int num_sections, float sx, 
  37.            float sy, float sz, LPD3DVERTEX* plpv, 
  38.            LPD3DTRIANGLE* plptri, int* pnum_v, int* pnum_tri);
  39.  
  40. #ifdef __cplusplus
  41. };
  42. #endif
  43.  
  44. #endif // __D3DSPHR_H__
  45.  
  46.