<!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
<vtk/vtkPLYReader.h><BR>#include
<vtk/vtkPolyDataMapper.h><BR>#include
<vtk/vtkVRMLExporter.h><BR>#include
<vtk/vtkRenderWindowInteractor.h><BR>#include
<iostream.h><BR>#include <stdlib.h></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=MingLiu size=2>int main(int argc,char
**argv)<BR>{<BR>/* if(argc !=
3)<BR> {<BR> cout<<"Need input file
name!"<<endl;<BR> exit(1);<BR> }*/<BR> vtkRenderWindow
*renWin = vtkRenderWindow::New();<BR> vtkRenderWindowInteractor *interactor
= vtkRenderWindowInteractor::New(); <BR> vtkRenderer *ren =
vtkRenderer::New();<BR> renWin->AddRenderer(ren);<BR> interactor->SetRenderWindow(renWin);<BR>
<BR> vtkPLYReader *Reader =
vtkPLYReader::New();<BR> Reader->SetFileName("g0.ply");//argv[1]);
<BR> Reader->Update();<BR> <BR> vtkPolyDataMapper *Mapper =
vtkPolyDataMapper::New();<BR> Mapper->SetInput(Reader->GetOutput());<BR> <BR> vtkActor
*Actor =
vtkActor::New();<BR> Actor->SetMapper(Mapper);<BR> <BR> ren->AddActor(Actor);<BR> ren->SetBackground(0.1,
0.2,
0.4);<BR> interactor->Initialize();<BR>// cout<<"1"<<endl;<BR> renWin->Render();<BR>// cout<<"2"<<endl;<BR> interactor->Start();<BR>// cout<<"3"<<endl;<BR>
<BR> vtkVRMLExporter *exp =
vtkVRMLExporter::New();<BR> exp->SetRenderWindow(renWin);<BR> exp->SetFileName(argv[2]);<BR>// cout<<"11"<<endl;<BR> exp->Write();<BR>// cout<<"111"<<endl;<BR> return
0;<BR>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=MingLiu size=2>runtime error message:<BR>"unhandle exception in
plytovrml.exe(vtkio.dll):0xc0000005:access violation"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=MingLiu size=2>does somebody tell me where the bug is? or show
me another example. Thank you!!</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=MingLiu size=2></FONT> </DIV></BODY></HTML>