<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=NL link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB>Dear all,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I currently render a mesh as triangle strips, roughly as follows:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vtkPolyData *mesh = ...</span><span lang=EN-GB style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vtkCellArray *strips = mesh->GetStrips();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vtkPoints *points = mesh->GetPoints();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:blue'> for</span><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> (strips->InitTraversal(); strips->GetNextCell(nPts,ptIds);)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:green'>// Build the structures<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vertex.clear();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> for (int j = 0; j < nPts; j++)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:blue'>double</span> v[3];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> points->GetPoint(ptIds[j], v);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vertex.push_back(v[0]);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vertex.push_back(v[1]);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> vertex.push_back(v[2]);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:green'>// Build the buffers<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> sizeBuffer = vertex.size()*<span style='color:blue'>sizeof</span>(GLfloat);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:green'>// Render</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> glEnableClientState(GL_VERTEX_ARRAY);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> glVertexPointer(3, GL_FLOAT, 0, &vertex[0]); <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> glDrawArrays(GL_TRIANGLE_STRIP, 0, (<span style='color:blue'>int</span>)vertex.size()/3);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> glDisableClientState(GL_VERTEX_ARRAY); <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> }</span><span lang=EN-GB style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I render it in this OpenGL way since I process the mesh with a geometry shader.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Now I would like to include adjacency information, using GL_TRIANGLE_STRIP_ADJACENCY, or possibly GL_TRIANGLE_ADJACENCY.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>(See for example: </span><a href="http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/primitive-assembly/"><span lang=EN-GB>http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/primitive-assembly/</span></a><span lang=EN-GB>)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I’m not sure how to build the structure, and parse the right information from the polydata.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>I was playing around with </span><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>mesh->GetCellEdgeNeighbors</span><span lang=EN-GB>, but that did not yet provide me the results I need.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>I guess I need to find the neighboring point connected to an edge, which does not belong to the current triangle?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Anybody that can give me a pointer where to look next?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Thanks.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Regards<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>-Roy<o:p></o:p></span></p></div></body></html>