[vtkusers] Pb during extruding a cone.

Guz despriee at enserb.fr
Mon Jun 5 10:04:23 EDT 2000


Hello,

Hello, 


I'm trying to use the vtkLinearExtrusionFilter, and I had a pb when I
used it on a cone : I got 2 separated cones but not one extruded cone.

I've certainly made a mistake in my code, but I don't know where.
(My code is attached with this mail)

Please help me !

Thanks.


-- 
Guz
------------------------
mailto:despriee at enserb.fr
mailto:despriee at free.fr
-------------- next part --------------


#include "vtk.h"



main ()
{


  // create a window
  vtkRenderWindow *renWin;
  renWin = vtkRenderWindow::New();

  //create renderer
  vtkRenderer *ren1;
  ren1 = vtkRenderer::New();
  renWin->AddRenderer(ren1);


  // create interactor
  vtkRenderWindowInteractor *interactor;
  interactor = vtkRenderWindowInteractor::New();
  interactor->SetRenderWindow(renWin);

  // create extruded cone
  vtkConeSource *cone;
  cone = vtkConeSource::New();
  cone->SetRadius(1.0);
  cone->SetHeight(2.0);
  cone->SetResolution(20);

  vtkLinearExtrusionFilter *exCone;
  exCone = vtkLinearExtrusionFilter::New();
  exCone->SetInput(cone->GetOutput());
  exCone->SetExtrusionType(VTK_VECTOR_EXTRUSION);
  exCone->SetVector(1.0, 1.0, 1.0);
  exCone->SetScaleFactor(3.0);

  // map 
  vtkPolyDataMapper *exConeMapper;
  exConeMapper = vtkPolyDataMapper::New();
  exConeMapper->SetInput(exCone->GetOutput());

  // actor 
  vtkActor *exConeActor;

  exConeActor = vtkActor::New();
  exConeActor->SetMapper(exConeMapper);
  exConeActor->GetProperty()->SetColor(0,0,1);


  ren1->AddActor(exConeActor);
  ren1->SetBackground(0,0,0); //black background
  //create camera/lights automatically


  // Render
  renWin->Render();

  //  Begin mouse interaction
  interactor->Start();


}




More information about the vtkusers mailing list