필터 지우기
필터 지우기

How to change the Coordinates of the object in the fill3 function?

조회 수: 2 (최근 30일)
ml Lin
ml Lin 2015년 6월 24일
댓글: ml Lin 2015년 6월 25일
I have created an object and used fill3 to provide the face Colour. However, I need to update the position of this object over time.
Thus, I have written something like: axes01 = fill3(X1, Y1, Z1, C1)
When I need to re-position this object, I wrote: set(axes01, 'XData', X2) set(axes01, 'YData', Y2) set(axes01, 'ZData', Z2)
This does not seem to take effect and the filled areas of the object remained at the original position. How do i rectify this?
Thanks

답변 (1개)

Jan
Jan 2015년 6월 24일
Please post the code to reproduce your observation.
Did you insert a drawnow command to trigger an update of the graphics?
You can join the set commands:
set(axes01, 'XData', X2, 'YData', Y2, 'ZData', Z2);
  댓글 수: 1
ml Lin
ml Lin 2015년 6월 25일
Hi Jan,
Yes, I have inserted a drawnow command.
It's hard for me to post the codes but I can further illustrate the situation. An example would be:
I am rendering a cylinder with the surf command. My X, Y, Z for the surf command comprise of the coordinates on the 2 circles. With the surf command, I am able to provide the face colour on the "curved surface" of the cylinder. However, the 2 circles are not shaded (which causes the cylinder to look hollow).
Thus, to work around this problem, I used the fill3 command to do the job. The problem is that, when I change the position of this cylinder, only the "curved side" moves, leaving the 2 circle plates in their original positions.

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

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by