<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi everyone,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am trying to import a VRML object into vtk. One 
of the users advised me to read the VRML and save it into vtk format. This way I 
have access to the actors.&nbsp;Through hi help I wrote the following 
code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>int main( int argc, char *argv[] 
)<BR>{<BR>&nbsp;<BR>vtkRenderer *ren1= vtkRenderer::New();<BR>vtkRenderWindow 
*renWin = vtkRenderWindow::New();<BR>renWin-&gt;AddRenderer(ren1); </FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>vtkRenderWindowInteractor 
*iren=vtkRenderWindowInteractor::New();<BR>iren-&gt;SetRenderWindow(renWin);</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>vtkVRMLImporter 
*importer=vtkVRMLImporter::New();<BR>importer-&gt;SetRenderWindow(renWin);<BR>importer-&gt;SetFileName("woman.wrl");<BR>importer-&gt;Read();</DIV>
<DIV>&nbsp;</DIV>
<DIV>ren1=importer-&gt;GetRenderer();<BR>ren1-&gt;SetBackground(0.1, 0.2, 
0.4);</FONT></DIV>
<DIV><FONT face=Arial size=2>renWin-&gt;SetSize(300,300);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>vtkRendererCollection 
*renCollection=vtkRendererCollection::New();<BR>renCollection = 
renWin-&gt;GetRenderers();<BR>renCollection-&gt;InitTraversal();<BR>vtkRenderer 
*ren= vtkRenderer::New();<BR>ren = renCollection-&gt;GetNextItem();</DIV>
<DIV>&nbsp;</DIV>
<DIV>ren-&gt;ResetCamera();<BR>ren-&gt;GetActiveCamera()-&gt;Dolly(1.75);<BR>ren1-&gt;ResetCameraClippingRange();</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkActorCollection 
*actorcol=vtkActorCollection::New();<BR>actorcol=ren-&gt;GetActors();</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkActor 
*actor=vtkActor::New();<BR>actor=actorcol-&gt;GetLastActor();</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkMapper *map=actor-&gt;GetMapper();<BR>vtkDataSet 
*PolyData=map-&gt;GetInput();</DIV>
<DIV>&nbsp;</DIV>
<DIV>//vtkDataSet 
*PolyData=ren-&gt;GetActors()-&gt;GetLastActor()-&gt;GetMapper()-&gt;GetInput();<BR>&nbsp;<BR>vtkDataSetWriter 
*writer=vtkDataSetWriter::New();<BR>writer-&gt;SetInput(PolyData);<BR>writer-&gt;SetFileName("woman.vtk");<BR>writer-&gt;Write();<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>The woman.vtk file is created successfully! However when I read it later 
and try to scale it only one&nbsp; item of my VRML object, hair piece, is 
there.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Either I am not transforming &nbsp;the VRML into vtk completely or I have 
problem later when I read the vtk.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Could anyone who has worked with VRML objects&nbsp;provide&nbsp;me with 
some guidance?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks very much.&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2>Parvaneh Saeedi<BR>&nbsp;</FONT><FONT face=Arial 
size=2></FONT></DIV></BODY></HTML>