<div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Dear all,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Using VTK with the following code, I can get the same modelview matrix as OpenGL¡¯s, but the projection matrix. </SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The projection matrix got from VTK: </SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </div> <div
class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">1.944445 0.000000 0.000000 0.000000<BR>0.000000 -2.592594 0.000000 0.000000<BR>0.000000 0.000000 -1.040816 -1.000000<BR>0.000000 0.000000 -40.816326 0.000000</SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT> </div> <div class=MsoNormal> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></div><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The projection matrix got from OpenGL:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">1.9444455063180441 0.00000000000000000 0.00000000000000000
0.00000000000000000 <o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">0.00000000000000000 2.5925940084240588 0.00000000000000000 0.00000000000000000<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">0.00000000000000000 0.00000000000000000 -1020.0000000000000 -20000.000000000000<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">0.00000000000000000 0.00000000000000000 -1.0000000000000000 0.00000000000000000<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt;
FONT-FAMILY: Arial">Here is my code:<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">vtkOpenGLCamera* cam = (vtkOpenGLCamera*)ren1->GetActiveCamera();</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">cam->SetPosition(110.955,100.0,73.0);<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">cam->SetFocalPoint(-67.1446,126.404,-17.5055);<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY:
'Courier New'">cam->SetViewAngle(42.184658);<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">cam->SetViewUp(0.0,0.0,1.0);<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">cam->SetClippingRange(20.0, 1000.0);<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">cam->ComputeViewPlaneNormal();<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">vtkMatrix4x4* v = cam->GetViewTransformMatrix();<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">vtkMatrix4x4* v1 =
cam->GetPerspectiveTransformMatrix(640.0/480,20.0,1000.0);<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Could someone give me some suggestion about this problem? Really appreciate that!<o:p></o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></div> <div class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Ivan Wang<o:p></o:p></SPAN></FONT></div><p>
                <hr size=1>Yahoo! Mail<br>
Bring photos to life! <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=39174/*http://photomail.mail.yahoo.com">New PhotoMail </a> makes sharing a breeze.