7 - Computergraphik [ID:12154]
50 von 963 angezeigt

Welcome for Computer Graphics.

We looked into transformations last week and in fact we slowly started going from 2D to

3D. So we were again looking at homogeneous coordinates which in fact for 3D transformations

are 4D coordinates and we looked at different types of transformations in 3D which was pretty

simple. So most transformations like translation or skewing and stuff like that directly transforms

from 2D to 3D but probably more interesting are rotations because the space of rotations

is very different in 3D than it's in 2D. In 2D essentially we only have one possible

rotation axis so a rotation is described by a single axis which is very simple to write

down but in 3D it's more complicated because the space is three dimensional. We need three

values, three angles to describe rotations and we were looking into for instance Euler

angles which is to describe an arbitrary rotation in 3D by rotating first around the x axis

then around the y axis and then around the z axis which is a rather often used way to

describe rotations or pose in 3D but it has practical problems and a much more practical

but more abstract and maybe more difficult to understand way are quaternions. So the

idea of quaternions is that it's four dimensional points. In fact it's like complex numbers

but the imaginary part is three dimensional and we've seen or I've explained that any

rotation can be described by such a quaternion using this operation here. So if we want to

rotate a vector v we transform it to a quaternion by making v the imaginary part and setting

the real part to zero and then computing that product and q is the quaternion that describes

the rotation. So we multiply q with this new vector and then multiply with q inverse and

this gives us again a vector with a zero in the real part and the imaginary part now is

a rotated version of v. And yeah this can be used to describe rotations. For this we

need the product operator on quaternions which we define here and we need normalization or

an inverse that we've also defined before and yeah this allows us to describe rotations

but you may ask okay rotations are three dimensional these objects here these quaternions are four

dimensional so how does that work? The reason is very simple. Quaternions or the rotation

described by a quaternion does not change when we scale the quaternion. So we can scale

it with an arbitrary value and you can see it a little bit here if we scale the quaternion

then here because we also multiply with the inverse yeah this scaling factor just cancels

out again. So we can scale that quaternion with an arbitrary value and the rotation it

describes doesn't change so to account for that we simply only look at unit quaternions

that means quaternions with length one. And this is still not unique then because then

q and minus q describe the same rotation but otherwise the mapping is unique yeah and now

we have that four dimensional space yeah quickly imagine the four dimensional space and a sphere

in that space yeah and quaternions are the points on this sphere and yeah so this is

the space of rotations which we work in and this space works very works very well and

in particular it allows us to interpolate rotations pretty well. So we can now take

two quaternions ideally unit quaternions and directly interpolate these and this gives

a very smooth interpolation between two rotations yeah so it gives a very natural way that objects

move for instance from one pose to another. There is one thing that we still have to consider

and that is when we interpolate we want to interpolate these quaternions on the sphere

yeah because yeah I said we usually only look at unit quaternions and if we now make a linear

interpolation yeah the points in between are not on the sphere anymore. In general this

is not a problem because yeah you know also non-unit quaternions correctly describe a

rotation so that's not a big deal but it gives us a problem that I've also described before

if we look at that example yeah so let's say these are two quaternions q1 and q2 imagine

these are vectors in 40 space and now we make a linear interpolation and what happens now

is that if the vectors are pretty far apart and we then and we have a interpolation with

uniform speed here what will happen is that in the beginning or yeah if we if we always

re-normalize the interpolated quaternions in between so that we are back on the sphere

Teil einer Videoserie :

Zugänglich über

Offener Zugang

Dauer

01:32:25 Min

Aufnahmedatum

2019-11-04

Hochgeladen am

2019-11-05 14:19:02

Sprache

de-DE

Einbetten
Wordpress FAU Plugin
iFrame
Teilen