Clear Filters
Clear Filters

Writing text on 3D moving object

1 view (last 30 days)
Yuval Froman
Yuval Froman on 8 Aug 2019
Commented: Yuval Froman on 9 Aug 2019
Hi,
I create a 3D cube that can move (it connect to a microcontroller and simulate his movement).
How can i write a text on the face of the cube? i want of course that the text will "move" with the box.
I also add a picture so you can see what i mean.
Thanks
This is the code of creation of the box:
x=6; y=4; z=2;
xlim([-10,10]); ylim([-10,10]); zlim([-10,10]);
f(1)=patch([-x/2,x/2,x/2,-x/2],[-y/2,-y/2,y/2,y/2],[-z/2,-z/2,-z/2,-z/2],'blue');
f(2)=patch([-x/2,x/2,x/2,-x/2],[-y/2,-y/2,y/2,y/2],[z/2,z/2,z/2,z/2],'red');
f(3)=patch([-x/2,-x/2,x/2,x/2],[-y/2,-y/2,-y/2,-y/2],[-z/2,z/2,z/2,-z/2],'green');
f(4)=patch([x/2,x/2,x/2,x/2],[-y/2,-y/2,y/2,y/2],[-z/2,z/2,z/2,-z/2],'yellow');
f(5)=patch(-[x/2,x/2,x/2,x/2],[y/2,y/2,-y/2,-y/2],[-z/2,z/2,z/2,-z/2],'white');
f(6)=patch([-x/2,-x/2,x/2,x/2],[y/2,y/2,y/2,y/2],[-z/2,z/2,z/2,-z/2],'black');
rotate3d on;
  2 Comments
Yuval Froman
Yuval Froman on 9 Aug 2019
Almost, this answer is about adding images.
I want to add just text, i'm sure there is a way add only text without image no?
Thanks!

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!