getting multiple intersection points through callback function
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!