[Music] you are at the right session this is a visual guide to querian and dual querian a querian is something like this it's a rotation in three dimensional space and a dual querian is a slightly broader class of object that we'll be talking about in the second half of the talk which can do 3D translations and rotation and translations first a little bit about me though I'm a graphics res Archer at Imagination Technologies we make gpus uh before that I did a PhD on virtual reality for structural biology where I used cians a heck of a lot and before that I was actually a math teacher um we say maths in the UK but yes I was a math teacher and I can tell you one thing as a math teacher that this phrase querian are four-dimensional is a useless and damaging thing to say uh I'm not saying that it's exactly
false I'd say that it's about as true as saying that a 3X3 Matrix is nine-dimensional um but in particular while I'm a huge fan of three blue one brown and number file because they give an explanation of querian based on this phrase yeah it's not a great explanation so sections of this talk first I'll talk about how every querian is a mixture of some amount of line which does a 180° rotation and some amount of identity which does a Zer degree rotation and if you don't don't know what this means don't worry whatsoever I'm going to go through it very very slowly and clearly and then in section two I'm going to well let's we're going to move away from the origin uh and we're going to see how and why to use uh dual Quon this is the identity by the way this is a line and the Dual querian allow you to do rotations around the lines that are not through the origin allows you to do rotations around arbitrary lines and also to get rid of this problem that we see here that we call the candy wrapper effect okay so part one a querian is a
mixture of some amount of line which rotates by 180° and some amount of identity which rotates by 0 degrees uh first we'll talk about catonian that rotate by 180° which we Vis visualize as lines through the origin so here's a quan it's got an X part A Y part A Z part and a w part and here's me um what does this querian do to the 3D model that we've got here the answer is that it's a 180° rotation around the Y AIS so just making it can you see this oh I need to all right the y- axis we're going like this all right that's what this Quan does which kind of makes sense because it's got y equal to 1 everything else equal to zero and we've can visualize it this way this quitan is a 180° rotation around the z-axis so it
turns the cow upside down here's our z-axis and if I rotate around here I go from this to this all right and we visualize it with the z-axis and the X querian no prizes for guessing what this one does it's a rotation around the x- axis uh yeah like this and you might look at all of these and say okay they've got an X part A Y part and a Z part we're ignoring w for a second uh this seems a heck of a lot like a vector so why don't you visualize it like a vector right I mean you could just have the X part and the Y part and the Z part of a vector well I I put to you that this is a much better way of thinking about at least these querian in particular uh the way that we're going so you know it's got x coordinate y-coordinate and a z coordinate and the way we go from this Vector to what I've got here is that we uh put an arrow going around that Vector according to the right hand rule then we extrude the shaft of the vector
and then we get rid of the head and get getting rid of the head throws away information you can't see how long the vector was anymore but you do sort of know which direction it was pointing in you know because of the right hand rule it was pointing in this direction because if it was pointing in the other direction then this Arrow would be going around the other way by 180° okay so better be careful with my microphone uh querian multiplication is rotation comp composition what do I mean by that well rotation composition so we start out with a rotation that's like this one this is a 180° rotation around the Y AIS and if we then follow that up with a 180° rotation around the z-axis so we're sort of going like this and then like like this and then like this well whatever something like that uh it's a rotation composition and you can ask the question what if we wanted to go straight from here to here the answer is
that that is a 180° rotation around the z-axis do you know what I think I yeah I should have said y AIS and then x axis and this gives you a 1 a around the z-axis um and if you want this querian based on these two then you can do querian multiplication right and you'll get your lovely composed uh rotation all right adding querian is averaging rotations what do I mean by this well averaging don't know what happened there uh averaging is basically mixing for colors if we're talking about colors uh if you any child can tell you that if you have uh some amount of blue and red then you get purple or at least if you have the same amount of blue and red then you have purple then you get purple um here we've got two querian and I've already shown you what these are this is the Y AIS 180 degree Quan this is the z-axis 180 Quan this is what they do to the cows um and we can add these
together and we're adding X Plus X gives you x and y + y gives you y uh and we get this Quan it's got a Y part and a Z part and it turns out that this querian is a 180° rotation still but it's a 18 180° rotation around the line that is directly in between the Y AIS and the z-axis so if we have like I need to get better at holding this thing uh so we have there's our y AIS and there's our z-axis and there's the axis that's halfway in between them and this rotation that we've got here is like that so this is the addition of this and this all right and that's what it does to the cow still a 180 degree rotation all right but there's something that I've been glossing over for very briefly here which is that if you add blue and red what you really get is not quite that but you instead get twice as much purple as you had blue red okay and that
matters because suppose that you added blue to a larger amount of red twice as much red say you'd get a different color and you'd get even more of that color so what this is showing you is that averaging is weighted right the amounts of the color that you have in there matter in terms of the color that you get out the other side if we take the by uh draw this analogy um we've got uh this one that can be written as two of these added together similarly we've got a querian and another querian and this one can obviously be added uh written as this two two of these added together this one I already told you is 180 around the y-axis now this one is also a y 180 around the y axis it's got some differences to this one for example if you add this querian to another querian then you'll get a different thing than if you added this querian to another querian and there are some other differences that I won't go into but if
you're worried about the difference there you can normalize your cians or your colors like if you take two buckets of uh purple paint you can turn it into one bucket of purple paint similarly you can turn this querian into what we have here which is the unit querian all right the identity querian which does a Zer degree rotation very important quitan here it looks like this x is z y is z z is equal to zero W is equal to 1 though we're tra we're doing something with the w coordinate for the first time what will this do to the cow well the answer is that it does nothing to the cow it's like you start out with the cow and it gives you the cow right uh there's no access to speak of because I mean where is the axis in even doing this uh and we call it the identity quitan because if you translate it if you turn it into a matrix then you'll get the identity Matrix whether that's a 3X3 Matrix or a 4x4 Matrix and you can you can also write the same Quan
as just the number one because multiplying something by one is not doing anything to it so that sounds a lot like this querian all right suppose we add some amount of querian that is a 180 around the z-axis and some amount of identity querian and that'll give us this querian which gives you if you apply it to the 3D model equal quantity of w and z it's a 9 ° rotation around the z-axis it's a quadan that isn't by 180° amazing uh finally we get to these things and you can visualize it this way so you've got the axis again and you've got this Arrow that's going around it uh by 90° in this case and so and that kind of uh makes sense right because it generalizes this idea of like oh I took the when I added the uh 180 around the Y and I added and I added it to 180 around the Z I got uh some kind of average some of kind of
thing that's in between them but it was still a 180 uh this is averaging in some sense the Zer degree rotation and the 180 that we've got there okay this is a Quan I just bring up for uh completeness sake it's the zero Quan if you apply to a 3D model it collapses it to nothing and if you uh you turn it into a matrix you get the zero Matrix or multiplication by zero very very boring um all right linear interpolation also known as lurp for querian and matrices uh linear interpolation is a very important animation technique uh it's also useful if you're a game programmer because suppose that you've got uh a cow here and you've got a cow here and you want what you really want is to go from there to there but by a certain amount right you've got some number T let's say and you want it to be the case that if T is equal to a half then it gets you halfway from this position to this position and you know
even the summer intern could write this uh if you have these positions as vectors then you just do the start plus T multiplied by the end minus the start and that is what lur is and it turns out that you can you can do this uh directly with querian so here I've got an editor uh we've got a cow up here and we are applying some transformation to the cow to get what the cow in this window the transformation is coming from this code that I've got here and over here I've got some things that'll just allow us to inspect some data so in this line I've got a quitan and this is what the quitan looks like I've got another quitan in on this line as well um what we're doing right now to this cow is applying this relatively mild rotation to it um we're applying a q1 uh to our cow uh let's change that to Q2 so that you can see what that looks like it turns the cow upside down
but what if you wanted to interpolate from q1 from this from this orientation to the other orientation uh it turns out there's an easy enough way of doing that so you we're going to define a float called T and I'm going to clamp T to being between zero and one so let's uh dial T up and down oh one second there yeah if we dial T up and down you can see in this window over here here that it's you know sort of staying between Z and one um and if we lurp using the formula that I just said to you uh if we look at if we look down in this window we've got a querian that if I de dial T up and down if you look at this turquoise querian it's going from the bluish one to the greenish one which is sort of what we want and if we apply this to our cow we get
the cow had a different orientation and if I dial T up and down hooray we are interpolating from one orientation of the cow to a different orientation of the cow and I can have any number in between uh and that give me this Quan which when we apply it to the cow gives you that thing that's in between the cow in the first state and the cow in the other state oh but we're going to do another demonstration here because there's another way of transforming things once again uh I've got a querian uh if you look look down here and if I dial T up and down um I'm going from one rotation to another rotation one orientation to another orientation beg pardon um and if I turn these Quan into matrices which I'm doing here uh so here we've got a matrix and and I'm visualizing it with what what it does to the X Direction the y direction and the Z Direction um if I if I I've got these two these two uh matrices which come directly from those two querian that we've got in the bottom
right um and I can similarly do uh the first Matrix plus T multiplied by the second Matrix minus the first Matrix uh Watch What Happens though it to the uh Matrix if I um dial it if I dial T back and forth so I'm going to do yeah this so we've got some green arrows in here and they're starting out at the if we look in the bottom the top right uh we're start they're starting out at where the orange ones are and they're going to where the purple ones are by the way we're not applying this to the cow yet so the cow is still doing querian lurp all right um and you might notice that there's something a little bit uncomfortable going on in there which is that if I leave it at this state and we look at just uh mat's interpolated on its own well that's a little bit unfortunate there both of those vectors are yeah problematic uh let's let's apply this to our cow anyway and we see that the cow has been weirdly
like squashed that's unpleasant and if we uh dial te up and down well we do start out at the right orientation and we end in the right orientation it's doing this horrible thing in between there's something else that I want you to notice about the difference between matrices and quorans in this context though which is that when I dial that number up and down note that the cow is not looking at us right it's going from left to right without turning to face us whereas if I switch us back to the querian version uh and now I dial te up and down again the cow turns to face us and it's starting out in the same place and it's ending in the same place but it's going around the other way to which you might say oh gosh well that sounds horrible what are you telling me that crans go around the other way than matrices no that that I wouldn't want that well I can actually do what the matrices did
well a better version of what the matrices did so let's dial T up and down again and now we see that this is querian interpolation uh linear interpolation that we've got here and the cow is swinging its bum past us right it's not looking at us so it's doing the exact rotation that the matrices did but it's actually doing a better version of it right because an objectively better version because it's not being squashed in the intermediate State okay and the the reason that I point all that out is to is because I want to emphasize that clockwise and counterclockwise are fundamental to how rotations work and it turns out that you can switch querian between clockwise and counterclockwise by multiplying by minus one this may sound like a weird curiosity but it's actually really fundamental to how the quitoni work so here you've got another Quan this is the W equal to minus1 querian what's this going to do to our cow well it turns out that it leaves the
cow alone well that's boring we already had a quan that did that the W is equal to one quitan and you're saying that what we've got yet another querian that does this super boring thing that sounds that sounds like a big waste of time well it's not exactly doing the same thing it's having the same effect on the model but I put to you this will sound strange but it's true that this Quan is doing a 360 degree turn it's a 360 degree turn as opposed to a zero degree turn which is the difference between these two to which you might say okay that sounds bizarre what on Earth are you talking about because surely a Zer degree rotation is the same thing as a 360° rotation I mean look we start out the cow here we do a 360° rotation and the cow ends up in the same place but look at my arm all right we start out here and let's say that I want to do a 180 and then another 180 I get this
thing the cow is in the same place but my arm is kinked up you might say well okay fine but you can't go any further right you so this is what something that is a dead end for rotations well no because watch this I can go like this and like this 180 180 180 180 I can do the same thing for the other axes so here's a 180 around the x- axis 180 180 180 180 and the z-axis is the hardest one uh 180 180 180 180 come on I think I deserve the clap some clapping for that don't ask me to do it again it hurts so much all right this is the bridge in Dublin where querian were discovered it's got a plaque there and it says this equation on it i² J = K = K1 and when I saw this
I was like What on earth does that have to do with querian which I only know about from Unity like but that's what this is if you take the y axis querian for example 180 180 so you're multiplying it by itself you are squaring it you're taking this rotation and doing it twice you get minus one same goes for the other axes right and the other thing that we have here is J J K that and let me show you that one for the sake of completeness so it's i j k minus one all right I J and K are what mathematicians called quorans we just call these X and Y and Z all right so really Hammer this ter here's our Quan that's yal 1 if you multiply it by itself so again yal 1 you compose two 180° ations you get the 360° rotation
okay and put this into to Unity or any uh querian thing that you like and you will get this answer all right now we want to understand querian from axis angle all right and a good way of understanding this function is by plotting the amount of line against the amount of identity for some querian uh here's the function that we're talking about we've got our Ang and we've got our axis and the axis has an X part A Y part and a Z part which makes sense it's coming to us as possibly a vector or possibly aeran it doesn't really matter for the sake of this code and we are okay we're taking the sign and the cosine of the angle that kind of makes sense because it's something to do with rotations and then we're assigning you know the X goes to the X and the Y goes to the Y Z goes to the Z very sensible looking but this is wrong don't please do not type this into your game engine because what I've just shown you here is not axis to angle to to Quan this is Axis angle to Quan you've
got to you've got to divide the angle by two now why would that be well it might remind you of the fact that I've got to go around twice in order to get back to the true start this is the correct one so to understand what's going on there we're going to be plotting the amount of line against the amount of identity for some cians it's very easy to get the amount of identity it's just the W part which is a you know it's one number to get the amount of line we're going to take the square root of the sum of the squares of X Y and Z so kind of like getting the length of a vector all right let's get on with it so we've got the our graph of the amount of line against the amount of identity and we're going to start with this cronian which is the W equals 1 cronian because it's got you know no line part its line part is equal to zero and uh it's got a w part so it's the identity it's the zero degree rotation okay fine how about this one well this is a 180°
rotation because it's got Z equal to 1 I chose Z because why not um I could have chosen any of the others and so long as I had W equal to zero I could have put it here so this is a 180° rotation as I took great pains to tell you about earlier how about this one well this has an equal quantity of Z and W right which means that it's a 90° rotation which I also pointed out to you but you might have noticed something strange going on here because look at that angle what's that angle that's 45° but it's pointing to the 90° rotation H how about this angle going all the way from here to here well that's uh 90° clearly but it's pointing towards the 180° rotation is there's something going wrong here well no this is how it actually works so how about this one this is the 270° rotation even
though what's 270 well 270 is going all the way around like that right and then how about this one well this is the W is equal to minus one Quan right because it's of it's a minus amount of identity uh it's yeah and that I told you is the 360° rotation even though that is 180° what is going on here well this is called a double cover plot and it's called that for a fairly clear reason it's because it's showing you what's going on in here when you put angle into s and cosine you have to divide by two first because your angle is actually an angle in this graph it's not a angle in the game world and that by the way is the sign and that is the cosine all right uh can we use this for anything uh well yes we can use it to think about going from clock clockwise to counterclockwise so we have for
example this querian 90° rotation clockwise and then this querian I put to you is in a strong sense the minus 270° rotation clockwise also as the uh 270° rotation counterclockwise uh and it looks like this and to get from here to here you multiply the X part the Y part the Z part and the W part by minus one so we've got Z 0.7 up here W 0.7 Z isus 0.7 down here- 0.7 down here okay so it's kind of like the upper part is the clockwise rotations and the bottom part is the counterclockwise rotations and I chose clockwise arbitrarily I could instead have said the the top one is the counterclockwise and the bottom one is is clockwise and this matters because it helps us do querian division uh first a little reminder for rotations a and b b multiplied by a means rotate by B but
rotate by a first which means that b divided by a means rotate by B but rotate by the opposite of a first okay that we'll see some very clear uses for this um another way of saying this is get me to where B takes me but starting out from where a would take me and a place that you could you deal with this fairly frequently is in Translation vectors so suppose that I've got the translation that takes me from San Francisco to Los Angeles and the translation Vector that takes me from San Francisco to Las Vegas but what I really want is this Vector I want Los Angeles to Las Vegas how would I get that purely thinking about vectors here well a thing that would be useful would be getting this orange Vector which is the opposite of the gray Vector which we can put it down like that and then having gotten this orange Vector it turns out that this the blue vector is the red Vector added to the orange
Vector because you go from there to there um and you can also write the blue Vector as the red Vector minus the gray Vector because it's the red Vector plus the the gray Vector multiplied by minus one okay but suppose you were thinking about a longer trip you're thinking about uh Spain to Madagascar and Spain to India but what you really wanted was Madagascar to India you wanted this flight path and these are in some these flight paths are in some sense rotations around the center of the earth uh this plot comes in very handy because what you want from this thing you have you have Spain to Madagascar but what you really want is Madagascar to Spain and to get this catonian from this catonian it turns out that this one is right below this one right or to put it another way you are negating the X Y and Z Parts you're
leaving the W part alone one way of thinking about this is that you've got any rotation let's say like that is some amount of identity and some amount of 180 and if you instead say oh do you know what I'd like the 180 that's this way because uh and the 180 that's this way will be this 180 multiplied by minus one because check it out I have this one80 and then I multiply by minus one I go around 360 and there we have it that is the 180 that we really want so what we want instead of having a mixture of the identity and this 180 we have an A mixture of the identity with this 180 and that gives us the going this way a little bit as opposed to going that way a little bit all right so can we use that yes we can use that so if you want if you've got a rotation like this but you want a rotation like that you want to go from
here to here in some sense and then here to here well the red one can be written as the purple one followed by the dark blue one uh the red one and and yeah that's just Quan composition it's Quan multiplication um so that means that you can write the purple and well we know that you can write the purple one as the inverse of the orange one and so if all you had was the orange one you could take this and write it as the blue one divided by the orange one all right let me check my time dual querian this is part two of The Talk dual querian which animators like and I think they like them better than 4x4 matrices and so should you and what we have down here are some examples of dual querian because at this point you pretty much know everything there is to know about querian we want to do something a bit more exotic uh dual querian let you manage both rotation and translation in the way that querian
let you manage rotation so I've got a querian what we've been talking about for a long long time this is a dual querian dual querian contain querian as a special case so you can take the W part of the querian and put it into the W part of the Dual querian we're doing something quite specific with X Y and Z though we're going to turn oh well uh X Y and Z represent a line um and it turns out that we actually need now six floats in order to do line arbitrary lines in threedimensional space so Quan only ever let you do uh line uh rotations around lines through the origin with a dual cerian it really could be anywhere um but it turns out that the X part we've got for for reasons that will become apparent eventually it's be you best off thinking of the X part as the YZ part why is that well if I bring myself back up so the uh rotation around
say the x- axis right so this rotates from Z to Y right it's going like that so you can kind of think of X as being Z to Y right and you can think of Y as being Z to X so like that and yeah for the other one uh and that's why we rename X Y and Z to y z z X and XY in here we also don't want to mix them up with these three which will which are easily mixed up with X Y and Z uh and that's the reason for the renaming okay unifying rotation and translation so Quan do your rotations you often probably think of vectors as doing your translations so moving stuff around but what if you want to think of these as the same kind of thing you want to think of uh translating uh but with the uh composition operator uh well this composition operator is
dual querian multiplication to which a lot of people will be saying hey well hang on don't be so fast this is also 4x4 matrix multiplication right and that's true so you can so 4x4 matrices and dual querian both unify uh rotations and translations which is great for both of them but if we compare them which is what we're going to do in this section we'll see that there's lots of advantages to dual querian inverting for a querian you saw is just minus signs on the X Y and Z part and that's also true of querian of dual querian which is nice inverting is a matrix is a bit more involved and the reason for that is because clockwise and counterclockwise is still multiplication by minus one for and we're this here we're thinking about quorans but this applies to dual cians as well dual caterans can be applied to points
lines planes and normals in exactly the same way which is nice and elegant whereas 4x4 matrices can actually only be applied to this without conversion uh 4x4 Matrix animation also has this thing called the candy wrapper effect so this poor woman's arm has been twisted up like she's a balloon or something like that uh we call it the candy wrapper effect because it's like we've tested the wrapper of a candy a candy I don't know what that means so uh why is this happening well her skin is made of a mesh like this of course and inside her she's got some bones um and if we twist one of those bones and we try to make the uh skin follow that the bones in a natural way we kind of see that oh okay I mean I guess that kind of makes sense as a thing to do but that's clearly not what human flesh does so we uh we want something different and this is why
blender and Houdini and uh Autodesk and Maya have all implemented dual quarians to some extent in them uh they call it they give it this specific name which is preserve volume preserve volume just means dual querian and I mean I don't work with many animators but I picture some animator ticking this box and being like Oh that looks much nicer and they're like they don't realize how much work it's creating for us but anyway 4x4 matrices candy wrapper effect du cians no candy rapper effect potentially um 4x4 matrices have 16 degrees of freedom duus have eight degrees of freedom and this is actually kind of better all right because shearing is something that 4x4 matrices can do but it's something that dual caterans can't do so this is the one game I've ever seen where they had shearing on purpose right you can see what the car is doing like that like it was skewed to the side a bit there that's shearing and no whenever you see this in any
other game yeah something's gone wrong right dual cians can't do shearing and that's a good thing okay if I persuaded you that dualan sound a little bit useful you might be interested now okay six floats for that axis line how do you read those six floats and it turns out that these are the same things as what you might have heard being called pluca coordinates uh if you've never heard of pluca coordinates don't worry because I'm about to explain what these things are okay let's go to another demonstration all right here I've got two lines these are both lines through the origin got this line here and this line here uh and I can interpolate from one to the other as usual so watch the Green Line in this bottom right hand window as I interpolate T up and down uh ignore the cow for a second we're mostly interested in the bottom right window uh we're able to interpolate the orange one to the blue one just by again sort of
component wise thinking about you've got the E the X part and the Y part and the X yeah yeah it's just linear interpolation again um but suppose that you wanted to think about a line that wasn't through the origin and here it is so here we've got a line being created this way I've got a one here and I've got a 1.4 here and if I change that 1.4 to zero I get something which looks actually the same if we're looking in the bottom right hand window the red and the purple look exactly the same and that's because the first three floats that you've got here are the same as the first three floats here so uh this is uh lines through the origin if you want lines that are displaced from the origin then you use floats in this thing over here uh and we can interpolate these as well so I'm going to interpolate from one of the lines to the uh the one that's displaced from the origin so it's
very exciting so look at that again in the bottom right hand corner uh we've got the green line going from the orange line to the purple line um and if we look at the Cow up here uh this is the cow having had a uh 180 degree rotation applied to it but it's a 180 degree rotation around the green line so it's a line that's not through the origin so it's got a it's translating the cow as well uh but now you let's ask a dangerous question what if I put a zero in here so this thing is now displaced from the origin in some way but it's not but it's not got any origin part so this is a line still a line that's very very very far away it turns out what do I mean by very far away well I'm about to tell you so consider if you will the horizon line you might be compelled to say that
the horizon line is more like a circle right because the Earth is spherical um so yeah this feels like a maybe a circle but actually if you look around you'll always see it as a line similarly the Milky Way in this very lovely picture forms a line in the sky and both of these lines in a strong sense are super duper far away there's a word that we have for lines that are this far away which is lines at Infinity they are infinitely far away in that sense this line here is infinitely far away you can look at it from any angle it'll always be surrounding you because it's just so far away all right why do you care about these well because translations behave more like rotations than you might think if you've worked with 4x4 matrices all your life then you might not have seen this before but translations behave just like
rotations except with axes how their axes are very very distant in fact their axes are infinitely far away so let me show you what I mean by this with another little toy okay here I've got a Lego motorbike and I can turn the handlebars and first I'm going I've got some uh lines going through the axles of this motorbike and I'm going to first turn the handlebars as much as I can and you'll see that the uh axes are crossing now let me bring you down to here if I put the motorbike like this yeah all right holding it like that I'm going to push the motorbike forward a bit now and you'll see that it is rotating around precisely the point where these two lines cross all right it's rotating around here if I change the handlebars a little bit so they're still kind of like this but we go back down here um these still
lines are still crossing maybe somewhere over here and if I push the motorbike forward they're still kind of going around that point the dangerous question is what if you have the handle bars parallel right if you don't turn them at all and now our lines are parallel our axis lines well they're not Crossing in the ordinary sense even if you took them really really far but and obviously if you pushed the motorbike forward now you get just a translation forwards and backwards very very boring but watch this if I hold the motorbike like this how's this going it's hard to hard to see the back one where are you all right if I hold it like this you can kind of see that these axes if you were to extend them in this picture far enough they'd meet some somewhere back there right let me show you what I mean by that so here we've
got our motorbike and the axes are crossing at this point here and the motorbike is if you push it Forward going around here so if it was uh if the motorbike was going around a traffic circle then this would be the center of the traffic circle this is the mot bike with uh the lines parallel to one another and they still sort of meet each other right they meet each other at a point on The Horizon and so in a sense you can still think of there being a line and the motorbike is going not around the line because it can't go all the way around the line but it's a transformation which has this line as its axis another way of thinking about this so here we've got a carousel look at the poles on this Carousel they're all going around the central pole the central spindle of the carousel its axis and I'm going to show you another bunch of poles here we've got some trees and
these trees are going from left to right just like the carel poles were and they're sort of going around the Sun you might say by analogy we can put the carousel like this so it's like the motorbike is going around the carousel there's the center of the spindle of the Carousel and this motorbike over here uh these lines are crossing at this point on the horizon and you can still kind of think of this as having an axis here all right let's formalize that though you've got a dualan it's got an identity part it's got a line through the origin part and it's got a line at Infinity part and if you want an arbitrary line a line that isn't through the origin or at if you want a line that's displaced from the origin you mix together some amount of line through the origin and some amount of line at Infinity in the same sort of way that you mix together a line like this and a line like this all right you lurp them if you will finally it's time to say what this thing does I'm not going to say a whole lot about it but I think of
it as the screw it's a single number uh and it controls the situation where you've got a rotation and a translation right where you're going like this and then translating along that axis okay just like what a screw does okay last part of the talk how much time do I have oh quite a lot wow um slurp slurp is a way of doing smooth animation by interpolating using these things called exponential and logarithm which get shortened to exp and log uh I want to show you a problem with lurp it lurp worked pretty well with our cow um but there's a thing that I call in this context the RS swinging problem or ass swinging Problem whatever uh once again I have two uh I have querian and I'm linearly interpolating from one to the other if you look in the bottom right hand window you can see that yeah
it's starting out in one way and it's ending up in another way but I want you to look at the Cow now and I'm going to I'm going to let you know that I'm trying to dial up the T value as smoothly as I can I'm really trying hard to be consistent but you see that the cow has inconsistent speed it starts out kind of slow and then it swings its bum past you and then it ends up slow again right that that is an artifact of lurp and I love querian lurp but this is a bit of a problem right we might want to fix that because we might want a super smooth animation um where the uh cow is moving past us in a way that's like that's like tick tick tick just like this going along the angle okay exponential and logarithm are what we're going to use to fix this bug so to speak exponential is something that you've actually already seen in some sense in some sense so exponential is
kind of the same thing as axis angle to querian logarithm is then the opposite of that so if you take a querian that does a rotation and you put it into the logarithm function you'll get the axis and the angle of that querian uh to be clear though this is just the version for ordinary quitan uh yeah but we want to think about dual Quan so we've got to think in a slight more advanced way about the axis that we're talking about here when we say axis um here we've got our Carousel so that's a that one's a rotation this one was a translation and then this one is a screw motion so if you go down a hel to Skelter like is what that's what we call these things in Britain so go down a hel to Skelter like this you're going around the thing and you're also going down the thing as well so it's like if you're going downwards you're preserving this line at the horizon that's the uh axis of your translation
downwards it turns out that if you take the logarithm of this rotation you get the rotation axis so this line with amount angle over two so it's like it's t it's we've got that we've got that line um but if you do X2 + y^2 + z^2 all whole thing square rooted you'll get angle over two uh and this is with a line that's not as Infinity which defines a rotation a pure translation if you take the logarithm of a translation and it's dualan you will get the translation axis so you'll get that line back there with amount in some sense distance over two uh and if you have a screw motion as with this Helter Skelter then you'll get a rotation axis added to a translation axis both of them with a mounts angle over two and distance over two okay so we want to make this thing that's called slurp slurp is the thing that's going to allow us to smoothly interpolate our uh
cow from one to the other while not having this uh thing where it swings past us super fast uh slurp looks like this so you start by saying the ending thing that you want divided by the starting thing that you want which will get you the rotation from where the start takes you to where the end takes you you take the logarithm of that which will give you the axis of this transformation scaled by the angle of the transformation you then multiply that by your T value where your T value is the amount that you want to go from here to here then you take the exponential and this gives you a rotation from here to here by the amount T in some sense and then you multiply by the start because what you really want to do is to go to the start and then go from the start towards the end by the amount T and that
is slurp why do they get called exponential and logarithm um yeah I don't have time to go through this because math like yeah if you want the querian that's done that's Q done three times then you're kind of raising it to a power and that's a little bit like raising a number to a power and so yeah the idea of logarithm and exponential from uh numbers generalizes fine to this situ ation algebraically I mean I find it hard to think about this geometrically but yes that's exponential and logarithm we wanted to solve this problem we want something like this we don't want something like this the candy wrapper problem the way that we deal with meshes is we've got these bones inside them we've also got vertices for every vertex we have a position for the vertex we've got the bones that it's affected by um we might have that as 4x4 matri the bones being uh stored as 4x4 matrices
but I put to you that it's better off as having them as dual querian and you also have some weight so for each uh vertex here you know you want to say okay it's affected This Much by this bone and this much by this bone and this much by this bone and I've got the number four in here um I don't know how often how frequently people use numbers other than four but four is the number that I've seen people use um you could easily have a different number but yeah four we're we're deciding that uh vertices are only significantly affected by four bones that surround them there's one way of blending with dual querian which reduces the candy wrapper effect in comparison with 4x4 matrices which is where you just uh take your four querian and you multiply them by the weight and then you just add all of those together no biggie but this doesn't completely uh get rid of the candy wrapper effect but it is very fast because you're adding eight floats um instead of 16 floats for a 4x4 Matrix so
it's pretty nice if you want to eliminate the candy wrapper though you have to use something like this which uh you can apply the same logic to um well you can derive this equation in the same sort of way that you derived the slurp equation that I said earlier so it's a kind of like a slurp esque blend um but you have to uh up you have to start with an initial guess which will be a uh probably the quitan which has the highest weight sorry catonian the bone that has the highest weight um and then you have to run this through a few times uh so it's less performant but it does get rid of the candy wrapper effect completely and in imagination Technologies we are implementing well not implementing it's already implemented but we are exposing this thing called the sync function uh which is used in both the exponential and logarithm and this will allow you to make it so that you're using exponential and logarithm super fast when you're doing it on the GP U uh so to recap this talk a querian is
some amount of identity and some amount of axis line with the axis line being x y and Zed and the amount of identity being W the double cover plot shows us how querian can be clockwise or counterclockwise and how to invert them because you just take the uh the point down here and that's the opposite of the quitan that you have going this way uh and it also shows us how why some formula for querian have a factor of two in them which is a bit random uh dual querian which allow allow you to have lines around any axis can be displaced from the origin whatever you like um and this can even include having an axis that's infinitely far away in some sense and that is what a translation is compared with luring matrices querian and dual querian lur slurp is faster and it reduces the candy wrapper effect and
slurping which uses exponential and logarithm though slower eliminates the candy wrapper effect let me check my time I've still got a few minutes so I'm going to show you this slide which I thought I had to cut out but uh yeah so this is this gives you a better a slightly better intuition for what's going on with the exponential and logarithm so if I go to this web page if you don't get this part don't worry too much I mean but yeah so here we've got a nice map um and if I move this map around we've got something weird going on uh this is a particular kind of map projection where you have uh angles are conserved from a certain point so if I put us uh with let's say San Francisco in the very middle of the map if you walk from here to here um along this map then that will Faithfully represent the angle that you have to go by on the Earth but if you have to walk from here to here that's not so true because it's impossible to have that with a flat map um if I get out of
there this uh so by analogy this is a little bit like how the logarithm works and a little bit like how slurp works right so here you walk along a line on the map um and what you're doing when you take the logarithm and then you multiply by T is that you are choosing a certain point which is your starting point um and then you are you're choosing a certain point which is your starting point um and which is the center of your map and uh you can interpolate on this map very Faithfully okay um and one one other thing is that 4x4 matrices do have a big Advantage which is that you can do camera projections with them so you eventually need to do do need to convert your dual cians to 4x4 matrices but that can actually be the last step although one thing that Eric langel has done is uh potentially shown a way that you can do camera transformation with dual caterans but this is ongoing research okay and with that it remains
to say these are my socials please get in touch with me I'd love to chat with anybody who's interested in this kind of thing I'm in San Francisco until the 31st that's my email that's my Twitter thank you very much for listening we do have time for questions we got seven minutes for questions which I'm Amazed by mic oh and we've got mics there are um uh there should be some roaming mics stands oh and there are two there are two stands okay we have question question uh are there any issues and uh or any suggestions that you can recommend to in converting Oiler to querian or working with uh having to convert something to Oiler and they yeah so so Oiler angles is uh is very very easy I even had a demonstration about it but well all okay all you do is you take
you've got your Oiler angles and your Oiler angles are rotations around X and Y and Z in some order that you decide on specifically um and all you have to do is you take this formula the correct Ang axis angle to catonian formula you figure out your angle around your x-axis your angle around your y axis and your angle around your z-axis and then you multiply and so you've got three cians from those angles you multiply those Quan together that's that's how you convert from Oiler angles to Quan okay and there can be no uh data loss in terms of converting from one to the other oh um oh yeah sorry uh well I'd severely doubt it I mean yeah co co Cen sign we've got very very accurate Cen sign for 32 bit floats I mean sorry have you had that problem possibly suspecting it yeah um oh well interesting I'd love to talk to you about that afterwards yeah so I
don't have any advice there okay no no that's good thank you it seems like this is a very useful tool for translations internations three in three dimensions are there equivalent Frameworks for higher mathematical Dimensions higher Dimensions like a six six dimensional uh there certainly are yeah so um this is part of what the second talk is about yeah um I mean I can't so first of all one way of saying what the Dual catonian are is that there are three dual there are three basis dual catonian that square to minus one which are the ones through the origin and there are three basis ve basis dual quarians which Square to zero which are the three basis lines at Infinity um and if you then just know now I guess it's quite complicated You' got to yeah you've got to use something called Clifford algebra there which is what I'm talking about in the next talk so okay great I'll get to that one then yeah thank
you I think you already answered my question but I just wanted to uh this is equivalent to the other formulation with a A number that squares to zero like Epsilon um yeah I is this is this this this formula what you mean what I've been presenting today yeah dual cians I've Just Seen another one where you just add quorans with a extended the reason that dual quorans are called dual quorans is because they are the tensor product of the Dual numbers which are this Epsilon thing where you've got a thing that squares to zero uh with there's a tensor product of the Dual numbers with the catonian right because you yeah um if you don't know what a tensor product is you well I would guess that you do um uh yeah and indeed that that's why they're called the Dual quorans because it comes from the dual numbers yeah so the thank you no worries and the the screw screwy part squares to zero the
and the three basis lines square square Infinity Square to zero yeah okay okay just to help clarify something if uh if the first three values like one through zero determine or like a like 10 a uh rotation and how much of that rotation is built on its identity so it requires both the W and that value what happens if it's w is zero but you have something like say 0. five like zero like a y is just 0.5 instead of one well that's uh that's the so you can the thing that I was trying to say with this slide is that uh so these two querian do the same rotation right which is to say that you can take any number that you like uh you know any single floating Point number and if you multiply it by all of these but if you take if you multiply this
this querian by that number unless the number is zero you will always get a querian that's the same rotation so if you had a quan that was xal 0 yal 0.5 Z equal 0 wal 0 that is still a 180° rotation okay so basically then if you're you're going to get all these equivalent rotations and this is why we want to do the normalization so we don't get this confusion when it comes to this um these equivalent in quotes that's one reason to normalize yeah okay thank you that helps no worries no worries um yeah I didn't say a whole lot about normalization in this talk uh one reason that you want to normalize it's probably worth saying is that if you don't if you are in unity for example um and you don't normalize a querian well and then you apply that querian to a uh to a point then the point can end up further away because you've got a querian that has a scale
part as well um one reason that I didn't bring that up is because it's a bit confusing in the context of my second talk because my second talk is significantly about homogeneous points and homogeneous points don't have that problem if you apply an unnormalized querian to a homogeneous Point it'll rotate the homogeneous point just fine um same with the Dual querian and I mean you'll get a point which has a a different a well you'll you will you will get a a point which has different floating Point values in there but it will have the same geometric interpretation it'll still be a point in the same place okay cool there any more questions sounds like we're done all right okay thank you very much for listening [Music]
Auto-generated captions from YouTube — names and numbers may be misheard.
Distilling the key insights…
Game Developers Conference · 2026
Game Developers Conference · 2026
Deconstructor of Fun · 2026
Comments