On 9. jan. 2007, at 17:13, Jose Luis Hidalgo wrote:

Hi Ole-Morten,

   You are right, it is a problem of wrappers/introspection, there is
no reflected method to push back vertices or I don't know it. osgLua
only acts as frontend of osgIntrospection, so if something is missing
is missing in lua too. :(

Was afraid of that. Anyone know what'd have to be done with the wrappers/introspections stuff to extend it?

- Ole-Morten


Cheers,
   Jose L.

On 1/9/07, Ole-Morten Duesund <[EMAIL PROTECTED]> wrote:
I'm looking for a way to create a Geode via osgLua. An analogue to:

osg::Geode* geode = new osg::Geode();
osg::Geometry* geometry = new osg::Geometry();
osg::Vec3Array* vertices = new osg::Vec3Array();

   vertices->push_back( osg::Vec3(0.1, 0, 0.1) );
   vertices->push_back( osg::Vec3(0.9, 0, 0.1) );
   vertices->push_back( osg::Vec3(0.9, 0, 0.9) );
   vertices->push_back( osg::Vec3(0.1, 0, 0.9) )

geometry->setVertexArray(vertices)

Everything starts out nicely:

>geode = osg.Geode()
>geo = osg.Geometry()
>vertices = osg.Vec3Array()

but then :

> vertices:push_back(osg.Vec3(1,1,1))
Error method TemplateArray< osg::Vec3, osg::Array::Vec3ArrayType, 3,
GL_FLOAT >::push_back(Vec3f) not found
stack traceback:
        [C]: in function 'push_back'
        stdin:1: in main chunk
        [C]: ?

As far as I can tell this is because the osgWrapper doesn't seem to
handle multiple inheritance and apparently just discards the inheritance
from std::vector<osg::Vec3>. Does anyone have a good idea as to how to
get around this? I've been peeking at the genwrapper/osgIntrospection
stuff and can't say I really understand how to extend it.

The background for this is actually that I need/want to use osg from a
java-program. Having experimented with swig generated bindings I
realised that just about any somewhat advanced osg program will include
subclassing and overrides. Swig-generated wrappers really doesn't seem
to help here. Besides, doing this via osgLua should make everything more
flexible - which is usually a good thing.

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



--
 Jose L. Hidalgo ValiƱo (PpluX)
 ---- http://www.pplux.com ----
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

--
Always try to do things in chronological order; it's less confusing that way.

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

Reply via email to