[vtkusers] How to use backface culling with polylines

David Gobbi david.gobbi at gmail.com
Thu Nov 18 22:07:26 EST 2010


You could also add a clipping plane to your vtk mapper that cuts the
globe in half, back to front.  By adding this plane only to the mapper
that renders the lines, you can remove any lines that are past the
horizon.

  David


On Thu, Nov 18, 2010 at 7:13 PM, Jim Peterson <jimcp at cox.net> wrote:
> Donny,
> I think I would run the state lines through a ribbon filter making them into
> a triangle strip of some width. the strip would have a backface.
>
> Jim
>
> Donny wrote:
>>
>> Thanks guys for the feedback. I have attached two images to visualize what
>> follows. I hope I can explain this clearly.
>>
>> I have three renderers that I am adding to the render window.
>>
>> The first is to contain a textured vtkGlobeSource actor and is called the
>> background renderer.
>>
>> The second contains several vtkPolyData actors and are lines (State and
>> county boundaries, roads, rivers…), this is called the map renderer.
>>
>> The Third contains an actor visualizing a weather radar volume, this is
>> called the radar renderer.
>>
>> The background renderer is always set as layer 0 and so is always rendered
>> first.
>>
>> The map renderer and radar renderer will alternate between the 1^st and
>> 2^nd layers depending on the view angle of the camera.
>>
>> If the camera is more than 45 degrees above the horizon then the radar
>> renderer is layer 1 and the map renderer is layer 2 so that the user can see
>> the features below the radar volume.
>>
>> If the camera is less than or equal to 45 degrees above the horizon then
>> the map renderer is layer 1 and the radar renderer is layer 2 so that the
>> radar volume is always in front of the map features.
>>
>> This works fine until I draw all state lines for the entire US. Because
>> the vtkGlobeSource simulates the curvature of the earth I see the backside
>> of the state lines where they are over the view horizon.
>>
>> Is there a way I can put the map features and radar volume on the same
>> renderer and accomplish the same thing?
>>
>> Thanks.
>>
>> -----Original Message-----
>> *From:* Aashish Chaudhary [mailto:aashish.chaudhary at kitware.com]
>> *Sent:* Thursday, November 18, 2010 8:37 AM
>> *To:* David Gobbi
>> *Cc:* vtkusers at vtk.org; Donny
>> *Subject:* Re: [vtkusers] How to use backface culling with polylines
>>
>> Donny,
>>
>> Were you talking about hidden lines removal may be?
>>
>> Thanks,
>>
>> On Thu, Nov 18, 2010 at 9:03 AM, David Gobbi <david.gobbi at gmail.com
>> <mailto:david.gobbi at gmail.com>> wrote:
>>
>> Jerome is correct, OpenGL culls faces according to the polygon
>> winding. So wireframe polygons can be culled, but polylines cannot,
>> even if they have normals assigned to them. There are some details in
>> the OpenGL FAQ:
>> http://www.opengl.org/resources/faq/technical/clipping.htm
>>
>> David
>>
>>
>> On Wed, Nov 17, 2010 at 11:47 PM, Jérôme <jerome.velut at gmail.com
>> <mailto:jerome.velut at gmail.com>> wrote:
>> > Hi Donny,
>> >
>> > My feeling is that backface culling should not work with polylines
>> > because they
>> > have actually no face.
>> >
>> > Jerome
>> >
>> > 2010/11/18 Donny <donnyz at charter.net <mailto:donnyz at charter.net>>:
>> >> I am drawing polylines using vtkPolyData and cannot get backface
>> >> culling to
>> >> work with them.
>> >>
>> >>
>> >>
>> >> I ran into this subject
>> >> http://public.kitware.com/pipermail/vtkusers/2003-January/065023.html ,
>> >> but
>> >> did not help.
>> >>
>> >>
>> >>
>> >> Any solutions?
>> >>
>> >>
>> >>
>> >> Donny Zimmerman
>> >>
>> >> donnyz at charter.net <mailto:donnyz at charter.net>
>> >>
>> >> 308-227-1756
>> _______________________________________________
>> Powered by www.kitware.com <http://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
>>
>>
>>
>>
>> --
>> | Aashish Chaudhary
>> | R&D Engineer
>> | Kitware Inc.
>> | www.kitware.com <http://www.kitware.com>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
>>
>
>



More information about the vtkusers mailing list