[osg-users] Converting 3d Models to OSG type

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Mon Oct 24 03:03:48 PDT 2016


Hi Uma,


> Hi all,
>
>          I tried simple program to do conversion from 3d model to osg type. I tried to call osgconv using system() method. Here is my code.
>
> Generalized one:
>         char *src = "D:/3D_Models/3D Model.obj";
> 	char *dest = "D:/converted_Models/3D Model.osg";
Simply don't use char* here...
>
> 	std::cout << "converting ........" << std::endl;
>
> 	system("osgconv src dest");
Syntactically correct ;-)

>
> 	std::cout << "Completed Conversion !!!! :)" << std::endl;
>
> Have i done any mistake in my code. Because I am getting message saying that no plug in to read "src" and "dest".
Yepp, that's literally what you called with the above. "osgconv src dst" 
is the string you put to the commandline.


>
> If I do like this,
>
> system("osgconv D:/3D_Models/3D_Model.obj       D:/converted_Models/3D_Model.osg");
>
> I am able to convert.
>
> How will I change my code to generalize the conversion (like first method) so that i can get input and output from user ?.
If you really need to do it the crude way:
std::string src ("D:/3D_Models/3D Model.obj");
std::string dest("D:/converted_Models/3D Model.osg");

system(std::string("osgconv " + src + dst).c_str());


Cheers
Sebastian
>
>
>
>
> ...
>
> Thank you!
>
> Cheers,
> Uma
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69132#69132
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list