[vtkusers] Display

Hamp Donald hampdonald at yahoo.com
Fri Apr 2 12:50:43 EST 2004


Hi
     I want to import an image in VRML file (001.wrl)
and
want to display the image. Please find below my source
code and the mistake that I am doing. When I am trying
to excute the program, it is giving an error "Error
near line 3: parse error". 

Help Please.

Regards
Donald

int main( int argc, char *argv[] )

{
                                                      
                                                      
                                         
vtkRenderer *ren1=vtkRenderer::New();
vtkRenderWindow *renWin =vtkRenderWindow::New();
renWin->AddRenderer(ren1);
                                                      
                                                      
                                         
                                                      
                                                      
                                         
vtkRenderWindowInteractor
*iren=vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
                                                      
                                                      
                                         
                                                      
                                                      
                                         
vtkVRMLImporter *importer=vtkVRMLImporter::New();
importer->SetRenderWindow(renWin);
importer->SetFileName("001.wrl");
importer->Read();
                                                      
                                                      
                                         
vtkCamera *camera = vtkCamera::New();
      camera->SetPosition(1,1,1);
      camera->SetFocalPoint(0,0,0);
                                                      
                                                      
                                         
                                                      
                                                      
                                         
                                                      
                                                      
                                         
ren1=importer->GetRenderer();
ren1->SetActiveCamera(camera);
ren1->ResetCamera();
ren1->SetBackground(0.1, 0.2, 0.4);
renWin->SetSize(300,300);
}

         

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/



More information about the vtkusers mailing list