On 19 Jun 2006, at 13:52, Robert Osfield wrote:

Hi Pete,

Your CullFace code looks correct, but.. its probably ShapeDrawable
that is playing games with you... as it has the ability to draw both
back and front faces, it has this to enable it to multipass build up
of transparent sphere's without the normal visual artifcats of
rendering transparent double surfaced objects.

What are you using the sphere for?  Why only the front face needs to
be rendered?  Would create the geometry by hand using osg::Geometry
suit?

I need the geometry of the inside of a hemisphere - this is effectively the same as a circular fisheye image. This will be fed to our projector, which is fitted with a 180ยบ fisheye lens, and then projected into this inside of a hemisphere - think imax...

I think I've fixed it. I was passing a new osg::CullFace to setAttributeAndModes() rather than the one I'd just setup....seems to be the behaviour I was expecting.

Thanks

Pete Carss


Robert.

On 6/19/06, Pete Carss <[EMAIL PROTECTED]> wrote:

Hello All,

I've been hacking osgprerendercubemap to do fisheye correction for
projection onto a dome. I have modified the example to load an osg file, and render this to the sphere surface. Everything is working swimmingly - better performance than I'd expected (this is Gentoo on a Macbook Pro) - what I need to do though, is to cull the front faces of the sphere. I had thought
the following would do it:

ref_ptr<ShapeDrawable> shape = new ShapeDrawable(new Sphere(Vec3 (0.0f, 0.0f,
0.0f), radius * 1500.0f), hints.get());

osg::StateSet* stateset = shape->getOrCreateStateSet();
 //cull front faces
osg::CullFace* cullFace = new osg::CullFace();
cullFace->setMode(osg::CullFace::FRONT);
stateset->setAttribute(cullFace);
stateset->setMode(GL_CULL_FACE, osg::StateAttribute::ON);
stateset->setAttributeAndModes(new osg::CullFace, osg::StateAttribute::ON);
shape->setStateSet(stateset);

Am I barking up the wrong tree?




Pete Carss - Research Assistant, Immersive Vision
[ i ][>][...] - Institute of Digital Art and Technology
CETL (Centre for Excellence in Teaching & Learning)
Experiential Learning in Environmental & Natural Sciences
University of Plymouth, Drake Circus, Plymouth, PL4 8AA, Devon, UK


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to