getting multiple intersection points through callback function

2 visualizzazioni (ultimi 30 giorni)
patch('Faces',T,'Vertices',V,'FaceColor','white','ButtonDownFcn',@MyCallback)
axis equal;
pointCo = getappdata(0, 'point');
function MyCallback(src,eventData)
p = eventData.IntersectionPoint;
setappdata(0, 'point', p);
end
The goal of the above code is to return the coordinates of the points I clicked on a 3d surface triangular mesh. I am very new callbacks so I hope this is not very hard.
Question 1: The code is functioning if I only care for a triplet of coordinates of one intersection point. How can I return the coordinates of multiple ones (by clicking many times on the mesh and coordinates not overriding each other)?
Question 2: If I want an intersection point that is currently not visible from the viewing angle in the figure created by patch, I need to add cameratoolbar to rotate the mesh. The moment I add cameratoolbar it seems like it stops working.

Risposte (0)

Categorie

Scopri di più su Graphics Object Properties in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by