[osg-users] osg-users Digest, Vol 4, Issue 74

Chris Denham c.m.denham at gmail.com
Fri Oct 26 08:00:44 PDT 2007


Hi Michele,
Thanks for this. You're probably right, I was floundering about a bit
in that snippet of code I sent. Robert's suggestion contained a much
neater solution - using the sign of the dot product of the vectors
between eye point and face normal. i.e. cull when this is negative.
(Convieniently, the node visitor gives you the eye point in local
coordinates). All this is neatly wrapped up in ClusterCullingCallback
class, so all I needed was one line of code to acheive my objective!
Cheers.
Chris.

Date: Fri, 26 Oct 2007 13:32:53 +0200
From: "Michele Bosi" <michele.bosi at gmail.com>
Subject: Re: [osg-users] Backface culling for a group containing a
       plane of        linestrips.
To: "OpenSceneGraph Users" <osg-users at lists.openscenegraph.org>
Message-ID:
       <6d348da50710260432w5ded0089v62bd588cb2886deb at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Chris,
I did something similar once, I am not totally sure but I think that the
vector should be multiplied before the matrix and that you need to multiply
only the direction component without the position. Once you have the
direction transformed in camera space to see if it faces the camera you
should only need to test if the Z component is > 0 (assuming a right handed
reference system).

Good luck,
Michele



More information about the osg-users mailing list