WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Plug-in development (https://forum.worldviz.com/forumdisplay.php?f=8)
-   -   Modifying transform node in C++ extension (https://forum.worldviz.com/showthread.php?t=3903)

rafael 09-06-2011 11:48 AM

Modifying transform node in C++ extension
 
Hi,
I need to modify the position and orientation of a 3D model in an C++ extension. Tried to pass a model and a transform node (created by Transform = vizmat.Transform() ) to the extension.

Have tried something like this:
int HybridTrackingExt::modifyNode(viz::Data &data)
{

osg::Node* osg_root = data.getPointer("osg_root");


if(osg_root != NULL)
{
std::cout << "Node found!" << std::endl;

osg::MatrixTransform* mt = static_cast(osg_root);
if(mt)
{

_transform.makeTranslate( osg::Vec3(3.0f, 0.0f, 0.0f));
mt->setMatrix(_transform);

}

}
return 0;
}

Unfortunately, this didn't work. How could a transform a 3D model using an extension?

regards,
Rafael


All times are GMT -7. The time now is 12:54 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC