Hello Sanat,
I am trying to create a scene in which I want to add 3d models of humans and
control their motion through keyboard and/or automated.
However I am having trouble starting off as I'm not sure what exactly to do.
You should look into osgAnimation. It is a sub-library of OSG (node kit)
which provides animation functionality, and in particular it can animate
skinned human meshes.
Before you can do anything with osgAnimation you need some human model
it can work with. For this you can go two ways: either get a model that
is rigged and animated already, or create one in a modeling tool
(Blender is open source and can save Collada files, Softimage XSI Mod
Tool can be used for non-commercial uses and can export Collada and FBX
files, and then there are commercial modeling tools like XSI, Maya, 3DS
Max etc). Then you would use one of the OSG plugins that supports
animation to load it (the FBX and Collada plugins can load animations,
not sure if others can too).
On the other hand, if you already have a human 3D model, you could
either load it up in a modeling program to add bones and skinning to it,
or do it programmatically based on any kind of transform nodes your
model has (note that DOF nodes are not really different than other
transform nodes (PAT, MatrixTransform, etc), the way you work with them
is different but they're all transforms, their goal is to specify a
local coordinate system).
Once your data can be loaded (you can use the osganimationviewer example
to test if OSG and the plugin can load your model and animations
correctly) you can programmatically start animations when events happen,
such as input or some AI routines you would write.
It looks daunting, many things to do, but take it one step at a time and
you'll get there :-)
Another thing:
3) I tried to convert a .flt model to .osg from the tutorials dataset using
osgconv but got this message:
C:\tools\OpenSceneGraph-2.8.2_Release\bin>osgconv.exe C:\Users\Sanat\Desktop\CE
M_Res_Software\OSG Code\NPS_Tutorials_src\NPS_Data\Models\t72-tank\t72-tank_des.
flt C:\Users\Sanat\Desktop\CEM_Res_Software\OSG Code\NPS_Tutorials_src\NPS_Data\
Models\t72-tank\tank.osg
Warning: Could not find plugin to read objects from file "C:\Users\Sanat\Desktop
\CEM_Res_Software\OSG".
Error no data loaded.
------------------------------------------------------------------------------------
As klortho would say: "Look at the error message" (though he'd be less
polite about it, and would probably type it in all caps because he yells
a lot). You can see that OSG tried to load
C:\Users\Sanat\Desktop\CEM_Res_Software\OSG
and not
C:\Users\Sanat\Desktop\CEM_Res_Software\OSG
Code\NPS_Tutorials_src\NPS_Data\Models\t72-tank\t72-tank_des.flt
which is the path you specified. It stopped at the space character...
You need to quote the path so that the Windows command line interpreter
doesn't cut your path at spaces. Try this:
osgconv.exe "C:\Users\Sanat\Desktop\CEM_Res_Software\OSG
Code\NPS_Tutorials_src\NPS_Data\Models\t72-tank\t72-tank_des.flt"
"C:\Users\Sanat\Desktop\CEM_Res_Software\OSG
Code\NPS_Tutorials_src\NPS_Data\Models\t72-tank\tank.osg"
That should give you an .osg file.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org