-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anim8.m plays the vizualisation slower than the choosen speed. #36
Comments
Hi @Ipuch thanks for using GIBBON and for testing You've probably found the timing setting icon on the top left right? Using this button you can set the pause time between frames:
First of all skipping every second step would speed things up. However I can imagine one would not like to do that. Instead you could try to reduce the number of properties/handles you vary. Essentially it seems to be you are altering only 2 things, coordinates, and colors. If you can frame this using 2 handles you can achieve the maximum speed. So you should try to "group" things together. In the For this bunny I create the plot using: Looking at your simulation perhaps you can group things into:
So perhaps you only have 7 things to update over time in this way. BTW your quiver vectors can also be created using patch graphics see also Let me know if this helps. |
Sounds like you are getting there. Using large markers for the points rather than actual spheres will be faster than. You could use patch graphics for markers in this way (note the use of a giant dummy face): cFigure;
f=1:1:size(V,1); %Dummy face so we can use patch but face is not plotted as color is off
% C=rand(size(V,1),1); %Colormapped colors
C=rand(size(V,1),3); %nx3 RGB color array, e.g. [1 0 0] is red
hp=patch('Faces',f,'Vertices',V,'FaceColor','none','FaceVertexCData',C,'EdgeColor','none');
hp.Marker='o';
hp.MarkerFaceColor='flat';
hp.MarkerEdgeColor='k';
hp.MarkerSize=25;
axisGeom;
drawnow; Then you can update the vertices with
Since we are using MATLAB to actually draw all the graphics things in real time, as fast as we can, this is really difficult. It depends on your system and how your system resources are currently used. In the
Yes. The export figure widget can be used to export a gif animation (it relies on export_fig). It is activated by the gif icon on the right. The gif export uses the actual desired pause time (not the one resulting from graphics updating issue) as the pause time between gif frames. These gifs should then play in real time (provided the image resolution is not too high such that your system is able to update frames at the desired speed).
I have done this before so would need to dig it up, it is not difficult to do. Currently saving the figure does not save my custom GUI items so it does not work. However if we save the anim8 structure as well as the figure we can restore everything again by calling the anim8 function again. Something like this could function as a save/import operation for anim8 stuff. If you want this, would you be able to post this as a feature request? |
Any luck with this? Let me know how you are getting on. |
Thank you again for the tip and everything. When using this visualization it looks cartoon-like. However, when I zoom in, the markersize is not function of the zoom. So there is a lack of 3D visualization when using markers. Unless you know an easy way to update the size ?
Yes.
I agree.
I didn't succeed to generate real-time gif.
Yes ! Can you tell me how to post a feature request ? |
By feature request I meant to open an issue here where you ask for that feature. About the markers. Yes I think markers are line/dot data which matlab appears to draw as a certain number of pixels rather than a fixed size, so yeah they change size when you zoom. BTW if you not like that the markers have edges drawn you can do Alternatively you could draw the markers using patch data but base them on a Platonic solid (see I'll close this issue for now but let me know if you need more help. |
Hi,
I tried to use your useful anim8 tool to vizualise my musculoskeletal simulation of CusToM. I used it on Matlab 2018a, on a Windows 10 with the following config:
However the function is not playing the simulation at real speed. Do you have any idea how to do it ?
One of my explanation is that the animStruct is too large to be handle by the anim8.m function.
Here it is the link with a zip of the figure and the animStruct.
Best regards,
Pierre
The text was updated successfully, but these errors were encountered: