Modeling arm movement as a 3D curve in Matlab / Java

I just need some guidance regarding the problem I have, where to look, etc. I use a glove to track movement for one of my projects, which returns X, Y, and Z values ​​for each finger and palm.

What I would like to do is first create a representation of the finger movements based on these coordinates, and then attach each of them to the palm movement in order to have an idea of ​​the hand. This second step will be easy as soon as I can manage the first, but ... I can not cope.

I am trying to implement it in Java (best analysis capabilities), but can simultaneously create a 3D graph with all points. And there are about 45,000 of them on each curve, so ... Could you imagine how to make it more like an animation, for example, when displaying a point in its XYZ coordinates at a given time t?

Another question: is MATLAB really the best option for this? I see how to make this animation work in Java, but I have never used Java to manage data, and I doubt that it is really good at that. Is there any other software / language that handles data management and animation well? Or should I just use Java to create the animation, and Matlab to analyze?

Thanks!

+7
source share
1 answer

You can do the following. Let pos be an Nx3 matrix containing data of x, y, z points, for N instances of time. You write the main script that sets vars, etc., and create a t1 loop timer that calls the doPlot build function. The main script:

clear all clc pos=rand(100,3)*10; %position matrix of random x,y,z coordinates. 100 time instances here ax=axes; set(ax,'NextPlot','replacechildren'); axis([0 10 0 10 0 10]); %set axis limits- fit to your needs Dt=0.1; %sampling period in secs k=1; hp=plot3(pos(k,1),pos(k,2),pos(k,3),'o'); %get handle to dot object t1=timer('TimerFcn','k=doPlot(hp,pos,t1,k)','Period', Dt,'ExecutionMode','fixedRate'); start(t1); 

Then you create a doPlot build function,

 function k=doPlot(hp,pos,t1,k) k=k+1; if k<length(pos) set(hp,'XData',pos(k,1),'YData',pos(k,2),'ZData',pos(k,3)); axis([0 10 0 10 0 10]); else stop(t1) end 

You will see a point (circle) in 3D randomly moving in space. The animation period is Dt secs (in this case, 0.1 s). You have to fit your needs. This is the basic animation in Matlab. You could do so much more. It depends on your needs.

+2
source

All Articles