Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know If I understend you correctly. Texturing is described well in <a href="http://www.glprogramming.com/red/chapter09.html" rel="nofollow noreferrer">redbook</a>. They use GLUT in the book, so you should find the answer in the examples.</p> <p>In short: call glTexCoord2f(u,v) before call to glVertex (if you do not use VBO), where u,v are texture coordinates.</p> <p>HTH</p> <p>EDIT: Sorry, now I understand the question. </p> <p>I have never used tesselators, but maybe I can help :-)</p> <p>Tesselators only find points where new vertices should be created. Standard glVertex is used to send them to the GPU. </p> <p>You can use your own function to draw vertex. If you register callback with</p> <pre><code>gluTessCallback(tobj, GLU_TESS_VERTEX, (GLvoid (*) ()) &amp;vertexCallback); </code></pre> <p>then your function is called every time new vertex is created. You can also use </p> <pre><code>gluTessCallback(tobj, GLU_TESS_COMBINE, (GLvoid (*) ()) &amp;combineCallback); </code></pre> <p>to add some information to the vertex - like normals, colors, tex coordinates.</p> <p>See <a href="http://www.glprogramming.com/red/chapter11.html" rel="nofollow noreferrer">redbook - chapter11</a> example 11-2</p> <pre><code>/* a different portion of init() */ gluTessCallback(tobj, GLU_TESS_VERTEX, (GLvoid (*) ()) &amp;vertexCallback); gluTessCallback(tobj, GLU_TESS_BEGIN, (GLvoid (*) ()) &amp;beginCallback); gluTessCallback(tobj, GLU_TESS_END, (GLvoid (*) ()) &amp;endCallback); gluTessCallback(tobj, GLU_TESS_ERROR, (GLvoid (*) ()) &amp;errorCallback); gluTessCallback(tobj, GLU_TESS_COMBINE, (GLvoid (*) ()) &amp;combineCallback); /* new callback routines registered by these calls */ void vertexCallback(GLvoid *vertex) { const GLdouble *pointer; pointer = (GLdouble *) vertex; glColor3dv(pointer+3); glVertex3dv(vertex); } void combineCallback(GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], GLdouble **dataOut ) { GLdouble *vertex; int i; vertex = (GLdouble *) malloc(6 * sizeof(GLdouble)); vertex[0] = coords[0]; vertex[1] = coords[1]; vertex[2] = coords[2]; for (i = 3; i &lt; 7; i++) vertex[i] = weight[0] * vertex_data[0][i] + weight[1] * vertex_data[1][i] + weight[2] * vertex_data[2][i] + weight[3] * vertex_data[3][i]; *dataOut = vertex; } </code></pre> <p>It should be sufficient to bind texture as usually - do it before drawing with tesselators.</p> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload