getting multiple intersection points through callback function

2 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by