CHAI3DCHAI3D

normal Move wireframe of Multimesh during runtime

More
09 Dec 2016 18:08 #1

I would like a multimesh object to move during runtime. The object should be shown as a wireframe and should not create any dynamic of haptic effects. Basically, it should teach the user a correct movement. However, I fail to do this using the following example:

int main(int argc, char* argv[])
{
...
cMultiMesh* myMesh = new cMultiMesh();
world->addChild(myMesh);

fileload =myMesh->loadFromFile(RESOURCE_PATH("mypath/Example.STL"));
if (!fileload)
{
cout << "Error loading Example.STL file" << endl;
};

myMesh->setWireMode(true, true);

myMesh->setLocalPos(0.5, 0.0, 0.0); // this works
...
}


void updateGraphics(void)
{
...
myMesh->setLocalPos(0.5, 0.0, 0.5); // this has no effect
...
}

Also 'myMesh->translate(0.5, 0.0,0.5);' has no effect. Is there any way to do this?

Please Log in or Create an account to join the conversation.

More
13 Dec 2016 09:55 #2

By looking at the code, please check if you did not declare myMesh twice.

In your main function, the following code

cMultiMesh* myMesh = new cMultiMesh();

should probably be replaced by
myMesh = new cMultiMesh();

where myMesh is declared as a global so that it can be accessed by your other functions.

Please Log in or Create an account to join the conversation.