title: Achieve desired value after a 3D die roll without face texture swapping
body: <p>I'm making a 3d dice game and came to one issue I can't wrap my head around so I'm turning to you for help.</p>
  
  <p>In the scene/world (using threejs with cannonjs) I have a plane and one die, which I'm throwing on the plane (screenshots here pre-roll <a href="http://prntscr.com/l9rat5" rel="nofollow noreferrer">http://prntscr.com/l9rat5</a>, result <a href="http://prntscr.com/l9rdeb" rel="nofollow noreferrer">http://prntscr.com/l9rdeb</a>). All works fine, until I want to throw some specific value on a die like 1 for example.</p>
  
  <p>Since I'm using loaded models instead of texture images for faces of the cube, I cannot handle this just by changing faces of the cube in threejs (since model has 100s of them). Therefore I was hoping I can achieve this by somehow changing the initial quaternion of the body (kind of pre-rotate it) so the die falls on a specific side. The die mesh is just following the body position and quaternion.</p>
  
  <p>I have these questions:</p>
  
  <p>Is this even possible to do? Maybe when I change quaternion pre throw it will result always in different final quaternion, which I can not determine? If it is not possible to do with quaternions, any tips?</p>
  
  <p>If it is possible, how do I figure out by which quaternion do I need to multiply my initial one to get desired result value 1? I have available the final quaternion and I know which values are on each face from emulated throw so I was trying to play with quaternion inverse but no luck.</p>
  
  <p>If I just rotate the initial body so that face 1 rotates to the result face (eg. 6) it works in some cases (i throw 1 when emulated result was 6), but when the throw gets more complicated (more rotations) it is not working of course since I'm not counting on all possible rotations.</p>
  
  <p>If it is not clear what I mean let me know pls.</p>
  
  <p>Thanks a lot
  m</p>