Why is Unity's rotation system so hard?

I don’t get it why don’t they just use rotation in Vector3’s, why do they make it so complicated. Every time i need to rotate an object in unity have to do at least 2 hours of researching to even come close, and then i still have trouble and get thousands of errors. Why do they add all this stuff for rotation when it could be as simple as “transform.rotation = new Vector3(0,0,0)” instead its all these big complicated words which i don’t even know what they mean all over the code. So basically my questions is why do they make rotation so complicated and not as simple as positioning. I don’t mean to sound rude or anything but its just so frustrating trying to do rotation.

Is there any tutorials i can go through to learn most things about rotation and what are the links to them if there are.

1 Like

check out these,

Its because euler angles can result in gimbal lock, which results in problems when rotating objects. Quaternions do not have this problem.

Although you can simply set the rotation of the object using setEulerAngles i beleive, and setting that to a new vector 3.

Think of it this way…

The earth rotates every 24 hours. So you get 360 degrees of rotation about the north-pole-to-south-pole axis. So the earth rotates around this axis at 15-degrees per hour. All seems simply, right?

Now imagine some aliens come close by, and, for a laugh, they rotate the earth backwards by about 2 hours, and then rotate the earth around what used to be the longitude by 90 degrees. This puts Kampala up to the north pole. If you have a globe to hand, make this change and see what happens. It all kind of makes sense. You’ve done a rotation of the equator in the opposite direction, and rotated the earth about what we think of as the north to south line that passed through London. Spheres can be rotated by two axes. All pretty simple. Except that with the rotated earth, once the aliens have laughed and headed off, the earth will probably still rotate around what we think of today as the equator. I mean, rotation will still happen with an axis top to bottom, but that this now passes through Kampala down south, which I guess is the centre of the Pacific.

Now think of an aeroplane. It can zoom up and down, with the front nose heading down, or up. So, the plane is rotating through and axis that starts at one wing tip, and passes through to the other wing time. I guess planes do this when they take off and land. And a plane can rotate along an axis that is front of the nose to the rear of the tail. So one wing gets higher than the other. And an aeroplane can be rotated left and right around an axis that goes top to bottom through the centre of the plane. But, as far as i can tell, no plane has this rotation.

So I’ve given you two simple examples, and both end up very quickly with “how does that work at all?” Euler angles do provide rotation around 3 axes. It’s pretty confusing because something like the earth only needs two rotations to make it happen (and confusing very quickly). An aeroplane can’t be rotated around Euler angles in a way that makes sense.

Quaternions are a different way to handle rotation. I am an old confused engineer, and describing quaternions is impossible for me.

1 Like

Quaternions are a very, very, dark art.

I don’t recommend trying to understand how they work, but rather try to understand how to get what you want out of them.

EulerAngles is the cure for the really straightforward approach, but as Graham described, get 2 or 3 rotations underway on different axies and your in a right muddle in no time.

Then I wonder what the rudder is for on planes :slight_smile:

1 Like

Hmm, I am an idiot. All this rotation stuff melts my head.

1 Like

I’m with AaronC here in that Quaternions are a product of some kind of dark magic. But you don’t have to know how they work internally to be able to use them for the greater good.

The key to understanding Quaternions is that they just represent a rotational offset or delta. It’s the same how a float can represent a distance in one-dimensional space, or a Vector2 or a Vector3 can represent a distance in two/three-dimensional space. A Quaternion is the same kind of “delta”, but for rotations.

After that, you just need to know how to use them in code to get the results you want. All the nitty gritty details stay tucked away neatly behind that techy class name.