Hi Miguel,

By default the OSG creates display lists for drawables, including the
ShapeDrawable, and this won't automatically update unless you tell the
drawable it needs to recompile the display list which you can do via
drawable->dirtyDisplayList().  If you plan to modify the shape regularily
then it's best to just disable display lists outright via
drawable->setUseDisplayList(false) as the compilation is relatively
expensive.

Robert.

On Mon, Sep 14, 2009 at 4:26 PM, Miguel Lokida <mlok...@yahoo.fr> wrote:

> Hi,
>
> Here 's my problem. I have a cylinder shape that I have added to my
> scenegraph. here a sample code:
>
> I have declared instances in the headers. And I can display the cylinder.
>
> Code:
>
> rp_cylinder = new osg::Cylinder();
>
> rp_cylinder->setHeight(1.0f);
> rp_cylinder->setRadius(100.0f);
> rp_cylinder->setRotation(osg::Quat( (M_PI / 2.0f),osg::Vec3(0.0f, 1.0f,
> 0.0f)) );
>
> rp_CylinderDrawable = new osg::ShapeDrawable(rp_cylinder.get());
>
> rp_cylinderGeode = new osg::Geode();
>
> rp_cylinderGeode->addDrawable(rp_CylinderDrawableDebFen.get());
>
> rp_position->addChild(rp_cylinderGeode.get());
>
>
>
>
>
> But, I would like to modify the radius and height of the cylinder. So, I
> do:
>
>
> Code:
> osg::Cylinder * cylinder = static_cast<osg::Cylinder
> *>(rp_cylinderGeode->getDrawable(0)->getShape());
> cylinder->setHeight(2.0f);
>
>
>
>
> But the problem is that nothing happen. No modification of the geometry.
> The address of the pointer is always the same so it is the same object.
>
> What 's wrong with my implementation ?
>
>
> Thank you![/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17347#17347
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to