tessvertex.3gl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. '\" e
  2. '\"! eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 6 March 1997
  6. .ds Re Release 1.2.0
  7. .ds Dp May 02 11:53
  8. .ds Dm 37 tessverte
  9. .ds Xs 55990 5 tessvertex.gl
  10. .TH GLUTESSVERTEX 3G
  11. .SH NAME
  12. .B "gluTessVertex
  13. \- specify a vertex on a polygon
  14. .SH C SPECIFICATION
  15. void \f3gluTessVertex\fP(
  16. GLUtesselator* \fItess\fP,
  17. .nf
  18. .ta \w'\f3void \fPgluTessVertex( 'u
  19. GLdouble \fI*location\fP,
  20. GLvoid* \fIdata\fP )
  21. .fi
  22. .EQ
  23. delim $$
  24. .EN
  25. .SH PARAMETERS
  26. .TP \w'\fIlocation\fP\ \ 'u
  27. \f2tess\fP
  28. Specifies the tessellation object (created with \%\f3gluNewTess\fP).
  29. .TP
  30. \f2location\fP
  31. Specifies the location of the vertex.
  32. .TP
  33. \f2data\fP
  34. Specifies an opaque pointer passed back to the program with the vertex callback
  35. (as specified by \%\f3gluTessCallback\fP).
  36. .SH DESCRIPTION
  37. \%\f3gluTessVertex\fP describes a vertex on a polygon that the program defines. Successive
  38. \%\f3gluTessVertex\fP calls describe a closed contour. For example,
  39. to describe a quadrilateral \%\f3gluTessVertex\fP should be called four times.
  40. \%\f3gluTessVertex\fP can only be called between \%\f3gluTessBeginContour\fP and
  41. \%\f3gluTessEndContour\fP.
  42. .P
  43. \f2data\fP normally points to a structure containing the vertex
  44. location, as well as other per-vertex attributes such as color and normal.
  45. This pointer is passed back to the user through the \%\f3GLU_TESS_VERTEX\fP
  46. or \%\f3GLU_TESS_VERTEX_DATA\fP callback after tessellation
  47. (see the \%\f3gluTessCallback\fP reference page).
  48. .SH EXAMPLE
  49. A quadrilateral with a triangular hole in it can be described as follows:
  50. .sp
  51. .Ex
  52. gluTessBeginPolygon(tobj, NULL);
  53. gluTessBeginContour(tobj);
  54. gluTessVertex(tobj, v1, v1);
  55. gluTessVertex(tobj, v2, v2);
  56. gluTessVertex(tobj, v3, v3);
  57. gluTessVertex(tobj, v4, v4);
  58. gluTessEndContour(tobj);
  59. gluTessBeginContour(tobj);
  60. gluTessVertex(tobj, v5, v5);
  61. gluTessVertex(tobj, v6, v6);
  62. gluTessVertex(tobj, v7, v7);
  63. gluTessEndContour(tobj);
  64. gluTessEndPolygon(tobj);
  65. .Ee
  66. .sp
  67. .SH NOTES
  68. It is a common error to use a local variable for \f2location\fP or \f2data\fP and store
  69. values into it as part of a loop.
  70. For example:
  71. .Ex
  72. for (i = 0; i < NVERTICES; ++i) {
  73. GLdouble data[3];
  74. data[0] = vertex[i][0];
  75. data[1] = vertex[i][1];
  76. data[2] = vertex[i][2];
  77. gluTessVertex(tobj, data, data);
  78. }
  79. .Ee
  80. .P
  81. This doesn't work.
  82. Because the pointers specified by \f2location\fP and \f2data\fP might not be
  83. dereferenced until \%\f3gluTessEndPolygon\fP is executed,
  84. all the vertex coordinates but the very last set could be overwritten
  85. before tessellation begins.
  86. .P
  87. Two common symptoms of this problem are consists of a single point
  88. (when a local variable is used for \f2data\fP) and a
  89. \%\f3GLU_TESS_NEED_COMBINE_CALLBACK\fP error (when a local variable is
  90. used for \f2location\fP).
  91. .SH SEE ALSO
  92. \%\f3gluTessBeginPolygon(3G)\fP, \%\f3gluNewTess(3G)\fP, \%\f3gluTessBeginContour(3G)\fP,
  93. \%\f3gluTessCallback(3G)\fP,
  94. \%\f3gluTessProperty(3G)\fP, \%\f3gluTessNormal(3G)\fP,
  95. \%\f3gluTessEndPolygon(3G)\fP