Hi Janick,

On Mon, May 5, 2008 at 9:36 AM, Janick Martinez
<[EMAIL PROTECTED]> wrote:
> > Hi, Deriving your own class from osg::Drawable, you can have any
>  > internal draw implementation with your own datastructures. See the
>  > osgteapot example. -- mew
>
>
>  That seems to be a nice way to do the rendering, thank you!
>
>  But what about interaction considerations? How would I,
>  for example, allow a user to specify points on the mesh
>  by just clicking on the surface? Is a ray -> triangle
>  intersection test also possible the same way?

The OpenGL rendering is done via overriding the
Drawable::drawImplementation(..) as illustrated by
the osgteapot example.

To do CPU based interaction you'll such as intersection testing you'll need to
implement the Drawable::accept(AttributeFunctor&) and
accept(PrimitiveFunctor&) methods.   Have a look at
src/osg/ShapeDrawable.cpp and src/osg/Geometry.cpp to see how they
implement these methods.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to