# When going from face 2 to face 4 - can you specify that it pass through face 5?

1. ##### Brett Gilbert
5 posts
Member since:
Sep 2009

Posted 05 Oct 2009 Link to this post

I am trying to lock the cube and only use 4 faces (faces 2-5) This is based off of the form wizard example.  my problem is that I want to go from face 2 to face 4 in the same visual fashion as going from face 2 to 3 or 2 to 5. A nice horizontal rotation.  Instead it rotates vertically and horizontally resulting in an ugly face change.

Are there any parameters or suggestions on how to get this to happen?
Thanks,

2. ##### Hristo Borisov
298 posts

Posted 06 Oct 2009 Link to this post

Hello Brett Gilbert,

Unfortunately, we made a mistake when we designed the layout of the RadCube. As a consequence our cube doesn't have the same layout as a regular dice. That is why, you expect faces 1 and 6 to have no point of contact, which is not true for our RadCube. If you take a closer look at the layout of the faces you will notice that faces from 3 to 6 all lay on the same plane. Thus, my advise is to use sides from 3 to 6 to achieve only horizontal rotation of the cube. Here is a quick example of this.



And the code behind part:

 private void Button_Click(object sender, RoutedEventArgs e) { cube.SelectedIndex++; }

Sorry once again for the inconvenience. If you have need any further assistance, don't hesitate to contact us again.

Best wishes,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
3. ##### Brett Gilbert
5 posts
Member since:
Sep 2009

Posted 06 Oct 2009 Link to this post

This is the answer to my other question. =]

This question is when on face 3 and I want to go to the opposite face (face 5), I want the cube to rotate from face 3 to face 4 on to face 5.  instead it rotates on a diagonal axis straight from face 3 to face 5.

I found a solution using a Dispatch Timer.

I have 4 buttons that i can click to go to any face from any face.
On click, if the target face is the opposing face of the current face, it runs through the delay timer.
basically forcing it to animate from face 3 to face 4 to face 5 and then turns off the timer.

 public partial class Page : UserControl { private int faceIndex = 2; public Page() { InitializeComponent(); RadCube1.SelectedIndex = 2; } int timerCount = 2; int starter = 0; public void StartTimer() { System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer(); myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 250); // 100 Milliseconds if (starter == 0) { myDispatcherTimer.Tick += new EventHandler(Each_Tick); starter = 1; } if (timerCount == 0) { myDispatcherTimer.Start(); } else if (timerCount == 2) { myDispatcherTimer.Tick -= Each_Tick; myDispatcherTimer.Stop(); } } // Fires every 100 miliseconds while the DispatcherTimer is active. public void Each_Tick(object o, EventArgs sender) { if (timerCount == 0) { this.faceIndex++; if (this.faceIndex > 5) { this.faceIndex = 2; } RadCube1.SelectedIndex = this.faceIndex; timerCount = 1; } else if (timerCount == 1) { this.faceIndex++; if (this.faceIndex > 5) { this.faceIndex = 2; } RadCube1.SelectedIndex = this.faceIndex; timerCount = 2; } else if (timerCount == 2) { StartTimer(); } }

Hope this helps.
4. ##### Hristo Borisov
298 posts

Posted 06 Oct 2009 Link to this post

Hello Brett Gilbert,

We will consider changing the layout of the cube in order to reflect a regular dice which will get rid of some of your problems. If you have any other feedback that you are willing to share feel free to contact us again.

Sincerely yours,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.