필터 지우기
필터 지우기

patchm vertex ordering?

조회 수: 4 (최근 30일)
William
William 2012년 4월 23일
Here I have two triangles with vertices resting on the unit sphere, specified in clockwise order looking at the outer surface of the sphere. Plotting vgood with patchm gives the expected result, a triangle in the projected map. However, vbad is interpreted as the inverse, a polygon covering the entire globe, leaving the triangle as a hole.
Given that both triangles have the same vertex ordering, I would expect them to have the same behavior. What's the problem here?
vbad = [ ...
-0.6375993113323332 -0.20403949778403738 -0.7428559763053484; ...
-0.8500194502416963 0.09199320574455130 -0.5186561330088028; ...
-0.8113166555881062 -0.28694517808882358 -0.5093405041196936];
vgood = [ ...
-0.6375993113323332 -0.20403949778403738 -0.7428559763053484; ...
-0.6518705906365251 0.19086859353491015 -0.7339168298010295; ...
-0.8500194502416963 0.09199320574455130 -0.5186561330088028];
% convert to lat/long
llbad = [-acos(vbad(:,3)) atan2(vbad(:,2),vbad(:,1))]*(360/(2*pi));
llbad(:,1) = llbad(:,1)+90;
llgood = [-acos(vgood(:,3)) atan2(vgood(:,2),vgood(:,1))]*(360/(2*pi));
llgood(:,1) = llgood(:,1)+90;
axesm pcarree;
patchm(llbad(:,1), llbad(:,2), 'FaceColor', 'r', 'EdgeColor', 'k');
patchm(llgood(:,1), llgood(:,2), 'FaceColor', 'g', 'EdgeColor', 'k');
  댓글 수: 1
William
William 2012년 4월 24일
Looks like this is a bug, there is a bug report on this same issue that is claimed to be fixed in 2010b, however I'm using 2011a and I am having the same problems.
http://www.mathworks.com/support/bugreports/641390

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by