3D cube with multi colored faces?

6 ビュー (過去 30 日間)
Nicholas Morgan
Nicholas Morgan 2017 年 3 月 29 日
回答済み: KSSV 2017 年 3 月 30 日
Hello.
As a small portion of a project, I am trying to create a 3D plot of a rubix cube. I want a cube with each face being broken into a 3x3 grid where I can assign each square a color.
My initial thought was to (somehow) create 6 surfaces that have a corresponding 3x3 matrix consisting to integers. Where each integer corresponds to a specific color I define. I would then use a custom colormap to color the faces.
Not sure if this is the correct way to go about it. I haven't worked out the actual code yet, I've been struggling with it a bit and it seems a little cumbersome.
Are there any simpler ways to produce a cube where I can define each face to have a 3x3 grid of color?
Thanks in advance, Nicholas
  1 件のコメント
Rik
Rik 2017 年 3 月 29 日
I think I would use a for-loop with a patch inside it. I bet there is a much better way, but at least your idea should work.

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

回答 (1 件)

KSSV
KSSV 2017 年 3 月 30 日
You may refer this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/31672-rubik-s-cube-simulator-and-solver. You can follow what author followed there.

カテゴリ

Help Center および File ExchangeRubik's Cube についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by