<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=big5" http-equiv=Content-Type>
<META content="MSHTML 5.00.3103.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=MingLiu size=2><BR>#include 
&lt;vtk/vtkPLYReader.h&gt;<BR>#include 
&lt;vtk/vtkPolyDataMapper.h&gt;<BR>#include 
&lt;vtk/vtkVRMLExporter.h&gt;<BR>#include 
&lt;vtk/vtkRenderWindowInteractor.h&gt;<BR>#include 
&lt;iostream.h&gt;<BR>#include &lt;stdlib.h&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu size=2>int main(int argc,char 
**argv)<BR>{<BR>/*&nbsp;if(argc != 
3)<BR>&nbsp;{<BR>&nbsp;&nbsp;cout&lt;&lt;"Need input file 
name!"&lt;&lt;endl;<BR>&nbsp;&nbsp;exit(1);<BR>&nbsp;}*/<BR>&nbsp;vtkRenderWindow 
*renWin = vtkRenderWindow::New();<BR>&nbsp;vtkRenderWindowInteractor *interactor 
= vtkRenderWindowInteractor::New(); <BR>&nbsp;vtkRenderer *ren = 
vtkRenderer::New();<BR>&nbsp;renWin-&gt;AddRenderer(ren);<BR>&nbsp;interactor-&gt;SetRenderWindow(renWin);<BR>&nbsp;&nbsp; 
<BR>&nbsp;vtkPLYReader *Reader = 
vtkPLYReader::New();<BR>&nbsp;Reader-&gt;SetFileName("g0.ply");//argv[1]); 
<BR>&nbsp;Reader-&gt;Update();<BR>&nbsp; <BR>&nbsp;vtkPolyDataMapper *Mapper = 
vtkPolyDataMapper::New();<BR>&nbsp;Mapper-&gt;SetInput(Reader-&gt;GetOutput());<BR>&nbsp;&nbsp;<BR>&nbsp;vtkActor 
*Actor = 
vtkActor::New();<BR>&nbsp;Actor-&gt;SetMapper(Mapper);<BR>&nbsp;&nbsp;<BR>&nbsp;ren-&gt;AddActor(Actor);<BR>&nbsp;ren-&gt;SetBackground(0.1, 
0.2, 
0.4);<BR>&nbsp;interactor-&gt;Initialize();<BR>//&nbsp;cout&lt;&lt;"1"&lt;&lt;endl;<BR>&nbsp;renWin-&gt;Render();<BR>//&nbsp;cout&lt;&lt;"2"&lt;&lt;endl;<BR>&nbsp;interactor-&gt;Start();<BR>//&nbsp;cout&lt;&lt;"3"&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;vtkVRMLExporter *exp = 
vtkVRMLExporter::New();<BR>&nbsp;exp-&gt;SetRenderWindow(renWin);<BR>&nbsp;exp-&gt;SetFileName(argv[2]);<BR>//&nbsp;cout&lt;&lt;"11"&lt;&lt;endl;<BR>&nbsp;exp-&gt;Write();<BR>//&nbsp;cout&lt;&lt;"111"&lt;&lt;endl;<BR>&nbsp;return 
0;<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu size=2>runtime error message:<BR>"unhandle exception in 
plytovrml.exe(vtkio.dll):0xc0000005:access violation"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu size=2>does somebody tell me where the bug is? or show 
me another example.&nbsp; Thank you!!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu size=2></FONT>&nbsp;</DIV></BODY></HTML>