<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=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Microsoft YaHei";
        panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
        {font-family:"\@Microsoft YaHei";
        panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
        {font-family:"\@\5FAE\8F6F\96C5\9ED1";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Microsoft Sans Serif";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:SimSun;
        mso-believe-normal-left:yes;}
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
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;}
span.E-MailFormatvorlage20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><![if mso 9]><style>p.MsoNormal
        {margin-left:7.5pt;}
</style><![endif]><!--[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=DE link=blue vlink=purple style='margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hey Sangma,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>you can derive your own Mapper from vtkPolyDataMapper, overwrite the Render(...) function and place you own OpenGL-code in that function. Then you use your mapper in combination with an actor and the renderer.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards, Rocco<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>--------------------------------------------------<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Dipl.-Ing. Rocco Gasteiger<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Otto-von-Guericke University<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Faculty of Computer Science<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Department of Simulation and Graphics<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Universitätsplatz 2, 39106 Magdeburg, Germany<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'> <o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Office: G29-223<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Phone: +49 391 67 127 59<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Fax: +49 391 67 111 64<o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>Website: <a href="http://www.vismd.de/"><span style='color:blue'>http://www.vismd.de</span></a><o:p></o:p></span></p><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:Consolas;color:#1F497D'>-------------------------------------------------<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>Im Auftrag von </b>sangmaxie<br><b>Gesendet:</b> Donnerstag, 9. Februar 2012 02:37<br><b>An:</b> vtkusers<br><b>Betreff:</b> [vtkusers] Help for Using OpenGL with VTK<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'>Hi:<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> I want to use OpenGL with VTK. For example, I want to draw a line with OpenGL like this:<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> glBegin (GL_LINES); <o:p></o:p></span></p><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> glColor3f(1.0,0.0,0.0);<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> glVertex2f (-2.5, 2.5);<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> glVertex2f (2.5, -2.5);<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> glEnd ();<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> And I want to render and display it with VTK classes, like vtkRenderer and vtkRenderWindow. But I don't know how to deal with it.<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> The following codes can't work;<o:p></o:p></span></p></div><div><pre><i><span style='color:black'> </span></i><span style='color:black'> renWin->Render();<o:p></o:p></span></pre><pre><span style='color:black'> glBegin (GL_LINES);<o:p></o:p></span></pre><pre><span style='color:black'> glVertex2f (-2.5, 2.5);<o:p></o:p></span></pre><pre><span style='color:black'> glVertex2f (2.5, -2.5);<o:p></o:p></span></pre><pre><span style='color:black'> glEnd ();<o:p></o:p></span></pre><pre><span style='color:black'> iren->Start();<o:p></o:p></span></pre><pre><span style='font-family:"@微软雅黑","serif";color:black'> Can you give me some examples and details? Thank you very much!</span><span style='color:black'><o:p></o:p></span></pre><pre><span style='font-family:"@微软雅黑","serif";color:black'>Sangma Xie</span><span style='color:black'><o:p></o:p></span></pre></div></div></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'> <o:p></o:p></span></p></div><div class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'><hr size=1 width=210 style='width:157.5pt' noshade style='color:#B5C4DF' align=left></span></div><div><p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'>sangmaxie</span><i><span style='font-size:10.5pt;font-family:"Microsoft Sans Serif","sans-serif";color:#969696'> via foxmail</span></i><span style='font-size:10.5pt;font-family:"Microsoft YaHei","serif";color:black'><o:p></o:p></span></p></div></div></body></html>