How can I rotate the following cube in real time?
Show older comments
Hello to everyone,
I´m reading some data of an IMU in a microcontroller and I send "roll, pitch and "yaw" information from the angles to Matlab by serial port. I have created that multicolor cube in order to know better which part of the sensor is each face of the cube. I would like to create a function that receives roll, pitch and yaw angle values and then rotates the cube in real time.
patch([0, 4, 4, 0], [0, 0, 3, 3], [0, 0, 0, 0], 'blue') %Cara de la parte de abajo de la imu
patch([0, 4, 4, 0], [0, 0, 3, 3], [1, 1, 1, 1], 'red') %Cara de la parte de arriba
patch([0, 0, 0, 0], [0, 0, 3, 3], [0, 1, 1, 0], 'green') %Borde corto nº1 del sensor
patch([0, 4, 4, 0], [0, 0, 0, 0], [0, 0, 1, 1], 'yellow') %Borde largo nº1 del sensor
patch([4, 4, 4, 4], [0, 3, 3, 0], [0, 0, 1, 1], 'magenta') %Borde largo nº2 del sensor
patch([4, 4, 0, 0], [3, 3, 3, 3], [0, 1, 1, 0], 'cyan') %Borde corto nº2 del sensor
axis square
Thank you in advance,
Accepted Answer
More Answers (0)
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!