So I'm trying to build a simple mechanic where the player see's 3 sides of a cube at a time: top, left and front(I called the front-side "Right" in my code, due to the orthographic view). The player can click on the front side or left side of the cube to rotate the cube so that the side that was pressed moves and becomes the top face. I want to smooth/animate the rotation.  The red faces are the faces that the user can click on.  My Logic seems to work quite well when I click on the left face (Rotating along the x axis), but doesn't seem to work well for the front/right face(It usually works once and then does weird stuff on the next click, this is on the z-axis)  public class CubeRotator : MonoBehaviour {     private const float STOP_THRESHHOLD = 0.1f;     private const float ROTATE_AMOUNT = 90f;      [SerializeField, Header("Touch Quads Colliders")]     private Collider touchQuadLeft;     [SerializeField]     private Collider touchQuadRight;      [SerializeField, Space(10)]     private float timeToRotate;      private bool mustRotateLeft = false;     private bool mustRotateRight = false;      private float targetX = 0.0f;     private float targetZ = 0.0f;      private float xVelocity = 0.0F;     private float zVelocity = 0.0F;      int layerMask;      private void Start()     {         layerMask = LayerMask.GetMask("Touch Quad");     }      void Update()     {         ListenForTouch();         RotateCube();     }      private void ListenForTouch()     {         if (Input.GetMouseButtonDown(0))         {             Vector2 touchPoint = Input.mousePosition;             RaycastHit rayCastHit;             Ray ray = Camera.main.ScreenPointToRay(touchPoint);              if (Physics.Raycast(ray, out rayCastHit, 150f, layerMask))             {                 if (rayCastHit.collider == touchQuadLeft)                 {                     mustRotateLeft = true;                     targetZ = targetZ - ROTATE_AMOUNT;                     zVelocity = 0f;                 }                  else if (rayCastHit.collider == touchQuadRight)                 {                     mustRotateRight = true;                     targetX = targetX + 90f;                     xVelocity = 0f;                 }             }         }     }      private void RotateCube()     {         float zAngle = transform.rotation.eulerAngles.z;         float xAngle = transform.rotation.eulerAngles.x;          if (mustRotateLeft)         {             zAngle = Mathf.SmoothDampAngle(zAngle, targetZ, ref zVelocity, timeToRotate);              if (Mathf.Abs(zVelocity) &lt;= STOP_THRESHHOLD)             {                 mustRotateLeft = false;             }         }          if (mustRotateRight)         {             xAngle = Mathf.SmoothDampAngle(xAngle, targetX, ref xVelocity, timeToRotate);              if (Mathf.Abs(xVelocity) &lt;= STOP_THRESHHOLD)             {                 mustRotateRight = false;             }         }          transform.rotation = Quaternion.Euler(xAngle, 0f, zAngle);     } }   Inspector Values:    I've tried several things, the only problem I can think of is, gimbal lock. Thanks in advance.
I am trying to write code with rotates an object.  I implemented it as:  Rotation about X-axis is given by the amount of change in y coordinates of a mouse and  Rotation about Y-axis is given by the amount of change in x coordinates of a mouse.  This method is simple and work fine until on the the axis coincides with Z-axis, in short a gimble lock occurs.  How can I utilize the rotation arount Z-axis to avoid gimbal lock.
How critical are macOS Mojave compatibility requirements? As per Apple support document, :     1. Check compatibility      You can upgrade to macOS Mojave from OS X Mountain Lion or later on   any of the following Mac models. Your Mac also needs at least 2GB of   memory and 12.5GB of available storage space, or up to 18.5GB of   storage space when upgrading from OS X Yosemite or earlier.         MacBook introduced in early 2015 or later   MacBook Air introduced in mid 2012 or later   MacBook Pro introduced in mid 2012 or later   Mac mini introduced in late 2012 or later   iMac introduced in late 2012 or later   iMac Pro (all models)   Mac Pro introduced in late 2013, plus mid-2010 or mid-2012 models with a recommended Metal-capable graphics card.      I am currently running macOS High Sierra on my Early 2011 MacBook Pro.  What does Apple's requirements mean for my ability to install Mojave? Is it possible or worthwhile to do so? I am lost.   So far...  If $\gcd (a,b) = 1$, by Bezout's Formula  $ax + by = 1$  If $c|(a+b)$, then $cf = a+b$  Then,  $a (x-y) + cfy = 1$   $b(yx) + cfx = 1$  Am I on the right track? Any suggestions? How do I draw a badge on my Dock icon using Cocoa? How do you redirect to a page using the POST verb? When you call RedirectToAction within a controller, it automatically redirects using an HTTP GET.  How do I explicitly tell it to use an HTTP POST?  I have an action that accepts both GET and POST requests, and I want to be able to RedirectToAction using  POST and send it some values.  Like this:  this.RedirectToAction(     "actionname",     new RouteValueDictionary(new { someValue = 2, anotherValue = "text" }) );   I want the someValue and anotherValue values to be sent using an HTTP POST instead of a GET. Does anyone know how to do this? How do I store binary data in ? Proof that the Casimir invariant of a representation commutes with everything When disconnecting from WebSphere MQ with C# client TCP connections are still in CLOSE_WAIT status if G is generated by {a,b} and ab=ba, then prove G is Abelian if G is generated by {a,b} and ab=ba, then prove G is Abelian  All elements of G will be of the form $a^kb^j,\,\, k,j \in \mathbb{Z}^+$   so I need to get $a^kb^j = b^ja^k$ How does PK know better than Jaggu? Log color bar/meta data in PGFPLOT How to get data off a completely dead Android phone? Phone worked perfectly. Then one day completely dead, nothing at all. It may have been that "one day" was after some time of laying around, cannot recall.  Model: Android AT&amp;T Samsung Galaxy S3 (SGH-i747 SKU S9255)  Already tried;   Charging phone: no visual output at all, no leds Removing battery while charging: no visual output at all, no leds Removing SIM and SD card: no visual output at all, no leds Attempt to turn on: no visual output at all, no leds   I need to get our family photo's off this phone (stored on internal memory). I care less about the hardware/phone itself.  Thank you for any help you can offer! How do I parse command line arguments in Java? A closed form of $\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$ This integral has been bugging me since yesterday:     $$\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$$   I've tried substitution $y={1}/{x}$ and $e^y={1}/{x}$, but those didn't help much. Wolfram Alpha gives me result: $-0.67172$. Could anyone here please help me to obtain the closed form of the integral preferably (if possible) with elementary ways (high school methods)? Any help would be greatly appreciated. Thank you. Is there any canon information in Harry Potter that proves one way or another whether a wizard always owns only one wand as a matter of routine?  What I am talking about is a wizard buying and owning one wand and also a second wand (for backup, or simultaneous use, or separate purpose, or ceremonial+work wand), akin to people buying more than one pair of boots, guns or hammers.  A proof would be either canon info showing someone owning 2 wands simultaneously; or a statement showing why that does not happen except in rare exceptions (see below).    NOTE: I am discounting special situations such as winning an extra wand in a duel ala Harry (e.g. the second wand's obtainment wasn't intended/planned), or someone winning a Death Stick from prior owner (in which case it was intended as a replacement wand and not an extra one); or taking another's wand for a time being, ala Voldemort and Lucius Malfoy (since it was more of a "temporary replacement because main wand was useless for the purpose due to paired cores" - far from a normal situation).  Also, I meant wands intended for use - e.g. if Malfoy would have a (imagined by me) collection of rare antique wands, that's as irrelevant as someone having flintlocks in a display case. Is there any way to increase the drop rate of items? Some items in Terraria drop only very rarely from certain enemies. It's a pain having to farm so many enemies to try to get these rare items. Is there any way to make them drop more often? I own a Nikon D40X and just the kit lens and I'm considering buying either a macro lens or some extension tubes.  I don't necessarily want to do true 1:1 macro, just some close ups of bugs, fungi and flowers. Are user accounts on data.stackexchange.com and Stack Exchange two different entities? I tried to search for similar questions, as I always do, but was not able to find one. I just created a new  on Data.Stack Exchange with my existing Google OpenID and it seems to be not associated with my regular Stack Exchange account. Is this by design? and if so, why? What is the translation of what's written below?  I think it may be the poem of the One Ring, but I'm not sure. Does this polynomial evaluate to prime number whenever $x$ is a natural number? Why do Jedi use lightsabers instead of blasters? Blasters seem to be more practical. Is there a special bond or something between lightsabers and Jedi?