[vtkusers] Bug or Design: Rendering concave polygons with vtkActor2D

Xiaofeng Z xf10036 at hotmail.com
Tue May 11 18:39:46 EDT 2010


Hello,

 

As suggested by some, I tried vtkTriangleFilter to tessellate concave polygons.  It almost works, except some bright pixels appearing within the polygon forming streak like lines as well as some at the boundary.  Attached is a typical example of such a streak.  This streaks appear or disappear as the magnification changes.  I think they come from overlapped pixels from neighouring triangles.  I need suggestions in how to remove them.

 

Thanks!

Xiaofeng


 
> From: dave.demarle at kitware.com
> Date: Thu, 6 May 2010 11:15:23 -0400
> Subject: Re: [vtkusers] Bug or Design: Rendering concave polygons with vtkActor2D
> To: xf10036 at hotmail.com
> CC: vtkusers at vtk.org
> 
> Try vtkTriangleFilter.
> 
> If there is a better alternative hopefully someone on list with more
> mesh experience than I will fill in the details.
> 
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 28 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-371-3971 x109
> 
> 
> 
> On Thu, May 6, 2010 at 11:06 AM, Xiaofeng Z <xf10036 at hotmail.com> wrote:
> > David,
> >
> > I am thinking of using GLU to perform Tessellation.  I wonder how involved
> > it would be if I try to do it inside VTK.
> >
> > I would appreciate it if you can provide some insight.
> >
> > Thanks!
> >
> > Xiaofeng
> >
> >
> >
> >
> >> From: dave.demarle at kitware.com
> >> Date: Wed, 5 May 2010 07:51:40 -0400
> >> Subject: Re: [vtkusers] Bug or Design: Rendering concave polygons with
> >> vtkActor2D
> >> To: xf10036 at hotmail.com
> >> CC: vtkusers at vtk.org
> >>
> >> I suspect that is because OpenGL doesn't render concave polygons
> >> properly, thus VTK, which uses GL to render, doesn't either. So
> >> unfortunately you have to tesselate that into a set convex polygons in
> >> order to have it drawn properly.
> >>
> >> David E DeMarle
> >> Kitware, Inc.
> >> R&D Engineer
> >> 28 Corporate Drive
> >> Clifton Park, NY 12065-8662
> >> Phone: 518-371-3971 x109
> >>
> >>
> >>
> >> On Tue, May 4, 2010 at 11:38 AM, Xiaofeng Z <xf10036 at hotmail.com> wrote:
> >> > Concave polygons are not rendered as expected with vtkPolyDataMapper and
> >> > vtkActor2D (see below).  Is it by design or is it a bug?  If it's by
> >> > design,
> >> > is there any flag can be set to alter the rendering behaviour?
> >> >
> >> > Thanks!
> >> >
> >> > Xiaofeng
> >> >
> >> > Hi all,
> >> >
> >> > How do I make uniform transparency in a concave polygon, instead of
> >> > getting
> >> > multiple shades, e.g. in the attached graph?
> >> >
> >> > The polygon are created with:
> >> >
> >> > vtkPoints* points = vtkPoints::New();
> >> > vtkCellArray* cells = vtkCellArray::New();
> >> > points->SetNumberOfPoints(4);
> >> >
> >> > // create a concave polygon (equilateral with a cutout at the bottom)
> >> >
> >> > points->SetPoint(0, 10.0, 10.0, 0.0);
> >> > points->SetPoint(1, 110.0, 183.2, 0.0);
> >> > points->SetPoint(2, 210.0, 10.0, 0.0);
> >> > points->SetPoint(3, 110.0, 110.0, 0.0);
> >> > cells->Allocate(1, 5);
> >> > cells->InsertNextCell(5);
> >> > cells->InsertCellPoint(0);
> >> > cells->InsertCellPoint(1);
> >> > cells->InsertCellPoint(2);
> >> > cells->InsertCellPoint(3);
> >> > cells->InsertCellPoint(0);
> >> > vtkPolyData* poly = vtkPolyData::New();
> >> > poly->Initialize();
> >> > poly->SetGlobalWarningDisplay(1);
> >> > poly->SetPoints(points);
> >> > poly->SetPolys(cells);
> >> >
> >> > A vtkActor2D and a vtkPolyDataMapper2D was used for the rendering.
> >> >
> >> > Many thanks!
> >> > Xiaofeng
> >> >
> >> >
> >> >
> >> > ________________________________
> >> > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars
> >> > with
> >> > Hotmail. Get busy.
> >> > ________________________________
> >> > Hotmail has tools for the New Busy. Search, chat and e-mail from your
> >> > inbox.
> >> > Learn more.
> >> > _______________________________________________
> >> > Powered by www.kitware.com
> >> >
> >> > Visit other Kitware open-source projects at
> >> > http://www.kitware.com/opensource/opensource.html
> >> >
> >> > Please keep messages on-topic and check the VTK FAQ at:
> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >
> >> > Follow this link to subscribe/unsubscribe:
> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >
> >> >
> >
> > ________________________________
> > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
> > Hotmail. Get busy.
 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100511/39d7d352/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkTriangleFilter.png
Type: image/png
Size: 18447 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100511/39d7d352/attachment.png>


More information about the vtkusers mailing list