<!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> </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. Through hi help I wrote the following
code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>int main( int argc, char *argv[]
)<BR>{<BR> <BR>vtkRenderer *ren1= vtkRenderer::New();<BR>vtkRenderWindow
*renWin = vtkRenderWindow::New();<BR>renWin->AddRenderer(ren1); </FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>vtkRenderWindowInteractor
*iren=vtkRenderWindowInteractor::New();<BR>iren->SetRenderWindow(renWin);</DIV>
<DIV> </DIV>
<DIV><BR>vtkVRMLImporter
*importer=vtkVRMLImporter::New();<BR>importer->SetRenderWindow(renWin);<BR>importer->SetFileName("woman.wrl");<BR>importer->Read();</DIV>
<DIV> </DIV>
<DIV>ren1=importer->GetRenderer();<BR>ren1->SetBackground(0.1, 0.2,
0.4);</FONT></DIV>
<DIV><FONT face=Arial size=2>renWin->SetSize(300,300);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>vtkRendererCollection
*renCollection=vtkRendererCollection::New();<BR>renCollection =
renWin->GetRenderers();<BR>renCollection->InitTraversal();<BR>vtkRenderer
*ren= vtkRenderer::New();<BR>ren = renCollection->GetNextItem();</DIV>
<DIV> </DIV>
<DIV>ren->ResetCamera();<BR>ren->GetActiveCamera()->Dolly(1.75);<BR>ren1->ResetCameraClippingRange();</DIV>
<DIV> </DIV>
<DIV>vtkActorCollection
*actorcol=vtkActorCollection::New();<BR>actorcol=ren->GetActors();</DIV>
<DIV> </DIV>
<DIV>vtkActor
*actor=vtkActor::New();<BR>actor=actorcol->GetLastActor();</DIV>
<DIV> </DIV>
<DIV>vtkMapper *map=actor->GetMapper();<BR>vtkDataSet
*PolyData=map->GetInput();</DIV>
<DIV> </DIV>
<DIV>//vtkDataSet
*PolyData=ren->GetActors()->GetLastActor()->GetMapper()->GetInput();<BR> <BR>vtkDataSetWriter
*writer=vtkDataSetWriter::New();<BR>writer->SetInput(PolyData);<BR>writer->SetFileName("woman.vtk");<BR>writer->Write();<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>The woman.vtk file is created successfully! However when I read it later
and try to scale it only one item of my VRML object, hair piece, is
there.</DIV>
<DIV> </DIV>
<DIV>Either I am not transforming the VRML into vtk completely or I have
problem later when I read the vtk.</DIV>
<DIV> </DIV>
<DIV>Could anyone who has worked with VRML objects provide me with
some guidance?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks very much. </FONT></DIV>
<DIV><FONT face=Arial size=2>Parvaneh Saeedi<BR> </FONT><FONT face=Arial
size=2></FONT></DIV></BODY></HTML>