Help with plotting an image on 3D

3 ビュー (過去 30 日間)
Fabiana Portillo Carrasco
Fabiana Portillo Carrasco 2021 年 5 月 7 日
Hi, I am trying to design a cricket stadium. I already plot a ground image simulating the cricket field ground and I am trying to do the same with the ''walls'' of the stadium.
Here is my code:
% Cricket Field Design (THIS PART WORKS)
field_image = imread('field4.png');
surf([-68.5 68.5], [-76 76], [0 0;0 0], 'CData', field_image, 'FaceColor', 'texturemap');
axis equal
hold on
% Stadium Seats (THIS PART DOESN'T WORK COMPLETLY)
field_image2 = imread('stadiumseats.jpg');
surf([-68.5 68.5], [76 76], [50 50;0 0], 'CData', field_image2, 'FaceColor', 'texturemap');
field_image3 = imread('stadiumseats.jpg'); *** PLEASE HELP HERE
surf([68.5 68.5], [76 -76], [50 0; 0 50], 'CData', field_image3, 'FaceColor', 'texturemap');
*** There is where coordenates are not working, I have tried everything but image just keep coming inversed.

回答 (1 件)

KSSV
KSSV 2021 年 5 月 7 日
Try image instead of surf.
If you use surf, try reversing the y-axis direction.
  2 件のコメント
Fabiana Portillo Carrasco
Fabiana Portillo Carrasco 2021 年 5 月 7 日
編集済み: Fabiana Portillo Carrasco 2021 年 5 月 7 日
I keep reversing the y-axis but I just can't find the correct coordenates. Any suggestions for the right coordenates? I have also tried to variate Z coordenates and multiple combinations, but nothing helps.
Fabiana Portillo Carrasco
Fabiana Portillo Carrasco 2021 年 5 月 7 日
All good mate, its sorted out! Ta.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeHistorical Contests についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by