lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This is a dynamic wrapper that uses osgIntrospection to instance and invoke methods of the classes reflected by OSG. It could be used to load data, but since osgProducer is reflected you can set up a viewer from the script.

subversion repository: http://svn.pplux.com/lab/osgLua

This is the first version, and needs a lot of improvement... but may be someone else will find this useful.

Example (http://svn.pplux.com/lab/osgLua/scripts/test.lua):

root = osg.Group()
geode = osg.Geode()
shape = osg.ShapeDrawable()
shape:setShape( osg.Sphere(osg.Vec3(4,5,6),15) )
geode:addDrawable(shape)
root:addChild(geode)

viewer = osgProducer.Viewer()
viewer:setSceneData(root)
viewer:setUpViewer(osgProducer.Viewer.ViewerOptions.STANDARD_SETTINGS)

viewer:realize()

while ( not viewer:done()) do
	viewer:update()
	viewer:frame()
	viewer:sync()
end

Cheers,
Jose L.