[vtkusers] Rendering error (¿a bug?)

Sergio N. netrangers at ciudad.com.ar
Sat Jul 27 15:23:10 EDT 2002


Hello again!

After I could link the cone example, I made some 
modifications. Below is the code.
When I run it, If found that setting the cone resolution
above 25, it doesn't render good. ¿Why? ¿Is this a bug?
¿There is a problem with my opengl drv?

Bye,
Javier

#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkConeSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindowInteractor.h"

int main ()
{
 vtkActor *coneActor = vtkActor::New();
 vtkRenderer *renderer = vtkRenderer::New();
 vtkConeSource *coneGeometry = vtkConeSource::New();
 vtkRenderWindow *renderWindow = vtkRenderWindow::New();
 vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
 vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();

 renderer->SetViewport( 0.0, 0.0, 1.0, 1.0 );
 renderer->SetBackground( 0.8, 0.4, 0.2 );
 renderWindow->SetSize( 700,700 );
 coneGeometry->SetResolution( 36 );

 coneMapper->SetInput( coneGeometry->GetOutput() );
 coneActor->SetMapper( coneMapper );
 renderer->AddActor( coneActor );
 renderWindow->AddRenderer( renderer );
 interactor->SetRenderWindow( renderWindow );
 renderWindow->Render();
 interactor->SetDesiredUpdateRate( 0.1 );
 interactor->Start();

 // Don't forget to clear memory
 coneGeometry->Delete();
 renderer->Delete();
 coneActor->Delete();
 coneMapper->Delete();
 renderWindow->Delete();
 interactor->Delete();
 return 0;

}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020727/ace52dcf/attachment.htm>


More information about the vtkusers mailing list