Page 1 of 1

Question about API-Visualizer

Posted: Wed Jan 07, 2015 7:54 pm
by saxbyd
Hi All,

I want to use the API Visualizer through Matlab as a error checking tool for some spatial transforms I am performing (basically I want to see where some projected points end up to be confident I've done it correctly).

From what I can tell, using the Visualizer through the API with Matlab will require me to call through class Model() to realize states (global positions). But really I only want to view global positions of markers and don't want to initialize a model with my set of markers in ground to do this. Is there a way, through the API/Matlab, to visualize just the markers the way you can through the GUI?

Best,

David

Re: Question about API-Visualizer

Posted: Wed Jan 14, 2015 6:14 pm
by jimmy
Hi David,

If you are viewing points in space it may just be easier to plot them in Matlab. Is there a reason why this doesn't work for you?

It is true that you need a Model to get the OpenSim API to create a visualizer. But that Model doesn’t have to have anything in it except for Ground (which may be there by default). You can create an empty model and place some objects on the Ground body, then the visualizer would display them.

Let us know if that works,
-James

Re: Question about API-Visualizer

Posted: Tue Jan 27, 2015 12:54 am
by saxbyd
Hi James,

Thanks for the reply.

I wanted a "nice" visualizer and Matlab isn't "nice" :roll: . Also I was just generally trying to work with the visualizer to expand my OpenSim range.

I found a solution though, as you pointed out a model is abstract.

I used model(), then created a bunch of objects with the transformed global coordinates I wanted and attached sphere vtp's. Then scaled them down to an appropriate size.

There was a trick with the visualizer though (might not be a trick but it took me a while!), you need to call show() even if you passed the model states to the visualizer to get it to realize the geometry files. It says this explicitly in the doxy, but I often go cowboy and don't read the doc's.

Best,

David