[vtkusers] Frustum Culling
Michael Knopke
Michael.Knopke at gmx.de
Wed Mar 7 09:39:43 EST 2007
Problem is, that I cant use the latest cvs for my app, coz it has several
issues. Lately I cant even start the app, gives me strange access
violations in vtkPlane.cxx (even though this is the same file I use).
I tried installing only vtkExtractSelectedFrustum but there where too many
dependencies.
I read the source code and cant really say how they detect the
vtkInsideness, its a different way than what I tried, maybe I try to adopt
the code.
Another Question: I read that data inside the frustum will be tagget with
the attribute vtkInsideness How can I querry a Dataset for this attribute?
Regards
Michael
>Have you tried vtkExtractSelectedFrustum?
On 3/6/07, Michael Knopke <Michael.Knopke at gmx.de
<http://www.vtk.org/mailman/listinfo/vtkusers> > wrote:
>
> Hi,
>
>
>
> I'm trying to write a new vtk-filter that can crop-out (set scalars to
> fixed value e.g. 0) selected volumes (e.g. inside of BoxWidget).
>
> Unlike all other cropping filter I know, will this filter work with
> vtkImageData and preserve topology and geometry. This means it will not
cut
> cells.
>
> Therefore I'm trying to implement frustum culling (with the planes from
> BoxWidget) and later add octree to speed up calculation.
>
>
>
> The problem I have is regarding detection if the point that is evaluated
> lies behind the plane. As far as I know, one has to calculate:
>
>
>
> 1). Shortest distance to plane (this works well) à returns
> PlanePointDistance
>
>
>
> 2). Add this distance to the DotProduct of ( PointX, NormalOfPlane):
>
>
>
> Result = PlanePointDistance + (vtkMath::Dot(PointX, Normal));
>
>
>
> 3). If result is negative than pointX lies behind Plane
>
>
>
>
>
> Unfortunately this yields wrong results. Does anybody know what's wrong?
>
>
>
> Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070307/49110c11/attachment.htm>
More information about the vtkusers
mailing list