On Tue, 2011-07-05 at 10:38 -0600, Paul Martz wrote: > On 7/5/2011 10:10 AM, Glenn Waldron wrote: > > I usually pull them from the CullVisitor/CullStack during the cull > > traversal. > > Right -- During cull you can access these from the CullVisitor: > osg::RefMatrix* view = cv->getModelViewMatrix(); > const osg::Camera* cam = cv->getCurrentCamera(); > const osg::Matrix& proj = cam->getProjectionMatrix(); > const osg::Viewport* vp = cam->getViewport(); > > If you're trying to get these during draw, you need to get them from > osg::State: > const osg::State* state = renderInfo.getState(); > const osg::Matrix& view = getModelViewMatrix(); > const osg::Matrix& proj = getProjectionMatrix(); > const Viewport* vp = getCurrentViewport(); > > -Paul
Thanks Paul and Glenn. I have a cool example coming demonstrating Signed Distance Field rendering, particularly as it pertains to text (inspired by an e-mail from a fellow named John Smith. It's exceptionally cool stuff, I'm just having trouble understanding the relationship between the current ViewMatrix and and the algorithm's idea of "scale." I get decent results with a 1:1 ratio, but there's more to it than that. Much reading shall take place! > > > > Glenn Waldron / Pelican Mapping / @glennwaldron > > > > > > On Tue, Jul 5, 2011 at 12:01 PM, Jeremy Moles <[email protected] > > <mailto:[email protected]>> wrote: > > > > Hey guys, I have a really quick question. I'm trying to debug a piece of > > code and what I need is access to the current MV/Proj matrices as > > affected by the Viewer's active camera. > > > > I see that they can both be queried from an osg::State object, though > > I've never had to interface directly with this. > > > > Does anyone have any quick tricks? > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > <mailto:[email protected]> > > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > > > > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

