Introduction to Computer Graphics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

+1 this was my entry point into gfx. haven't gone any further than the content of this course though. it's great! this other course from UC Davis goes into the hardware implementation in GPUs. It's a bit old though, not sure if it's still relevant...

👍︎︎ 1 👤︎︎ u/jurniss 📅︎︎ Apr 02 2015 🗫︎ replies

The link on the chalkboard: http://graphics.cs.ucdavis.edu/~joy/ecs175/

👍︎︎ 1 👤︎︎ u/knellotron 📅︎︎ Apr 02 2015 🗫︎ replies

I've been learning 3D modeling and writing basic graphics demos in OpenGL but I haven't really gotten into the theory of Computer Graphics , this really sheds light on the matter.

👍︎︎ 1 👤︎︎ u/SouthAfricanPickle 📅︎︎ May 03 2015 🗫︎ replies
Captions
on your in 175 which is computer graphics this course bcs 175 my name is Ken joy and I go by Ken I don't go by professor joy I don't go by Professor Ken professor those old guys back on the East Coast the wear suits and teach and IV colored buildings right we aren't that way out here my ta for this course is Sebastian Inge and Sebastian's back there in the far corner you're going to get to know him really well okay by the time this quarter is over I have my office here is all the information is on the sheet that you put out so I'm not going to write it all down on the board too or it's on this website my office is three oh four five in camper Hall I have my office hours Monday through Friday 11:30 to 1 and what I'll do is if you can't make those I mean there's always somebody who can't make them can't make those we can arrange something else for you right just write the email and we can arrange another time Sebastian's also going to be holding office hours he's also a student right so he's trying to get his schedule together right now but we'll have those out on the web very shortly okay there's also a discussion section for this class this evening this evening late this afternoon okay it will be held today okay and we'll we'll start going so Sebastian is graduate student in computer science he's a graduate he's working on visualization and computer graphics and he's been through this class before he's been an undergraduate at UC Davis before he's been through the wars okay so tap him he knows a tremendous amount about this field and and then you know the website is where everything will appear all your assignments all the reference materials everything for this course is going to appear on the website so log on to the website make sure it's there occasionally on the weekend this website goes down because it's housed in academic surge not in Kemper and they take the power down an academic surge sometimes okay occasionally it'll go down for a few hours it'll come back up you know you have to wait for a bit but occasionally on the weekend this website will go down a little bit the students have told me in the past okay so this is a course in computer graphics and I have to tell you what your what your expected in this class basically we will have what we're going to do is study the fundamentals and computer graphics in this class and 3d computer graphics not 2d or whatever we're going to do 3d computer graphics and the biggest thing that most students have in this class is that this class contains there's that there's a couple difficulties here this class contains mathematics because we have to figure out how to move things around in three-dimensional space so you're going to see more mathematics here than you've probably seen in many computer science courses okay we have to move things around turns out it's pretty easy to do it's all four by four matrices which is why the GPUs and you're in your laptops all do 4x4 matrices really well that we can limit all everything to 4 by 4 matrix generation or multiplication and so we got to figure out how to move things around in 3-dimensional space so we're going to be doing some things like geometry and things like that in this course and doing a little bit more mathematics than you sometimes see we're going to be doing polynomials and that hard math but a lot of math and sometimes computer science students coming into this course tell me you know God you could do a math on the first day you're not doing CS ok but you're going to see that second thing to do graphics well you have to figure out how light bounces off surfaces ok and you have to look at surface models and color models and things like this this is physics ok we have to dive into a little bit of physics here to figure out how light reflects off things and where the color models come from so you'll see a little bit of physics and then you're going to see a lot of computer science we're going to have you build a small graphic system of your own ok I'll have what we call a hierarchical modeling system and actually take this system and produce some cool pictures toward the end and we're going to build this up as we go along in the class ok so those are the things that that we're going to do in this class it's going to we're going to move pretty quickly through it but as part of it all we're going to have to learn some software we're going to have to learn how many know qt it's been offered in some classes you're going to learn cutie in this class if you don't know it memorized the faces of those people who just raise their hands okay the you're going to you're going to have to learn cutie that's how we get the images up on the screen put the buttons and sliders and things that we can manipulate up there okay so that's what Sebastien is going to be lecturing on today okay is some cutie will provide us with some examples etc we're going to be listening to we're going to be learning OpenGL you can kind of - OpenGL or DirectX OpenGL is easier for us then DirectX is they're both effectively the same except the calls are slightly different okay but we will do OpenGL in this class and and the difference that computer that I always tell my colleagues in computer science the thing that we do that's different than most of computer science is that we write our software toward an API called OpenGL or call QT that's that's the end product that we use done released underneath it all we don't write core all the way down at the bottom of the computer level right drivers etc etc we write toward this API and so we tend to do higher level code in general and what you'll find is where you're going to write a lot of code in this class it's a pretty it's a pretty overwhelming class for a lot of people because you're going to write a lot more code than you do in most other classes here okay but it's going to be code that gets pictures out the other difficulty people have with this class is the following is that once you get your prototype computer science and when I took computer science classes once you get your program working you're just about done okay maybe there's a couple little things to change but in this field right once you get your program working your picture looks like crap okay and that's when you have to start working is after your program gets working okay and those people in this class that decide to start the assignments the night before get killed okay they get killed because it's that last process that takes sometimes 40 50 percent of the time is the inter picture so that joy and Eng actually like it okay it'll give you a good grade for it because you know that's one of the objectives here is this is a visual field we're producing visual images right we don't want them to look you know awful so that's one of the difficulties that people have in this field is that once you gets program working that's only step one now now you have to get the picture looking right okay and that's often quite frequently a much much longer process than just getting the initial program working so warned it take take it as a warning okay now what I'm going to do is I'm going to give you four assignments in this course the first one comes Monday okay and it'll be due pretty quick and it's to get up on cutie get going I get your first program's going yet cetera it'll be probably three little pieces of programs to do the second one we start working on our modeling system and starting to write our modeling system the third one we learn and we'll do kind of all polygons in our modeling system okay the third one we start doing curves and surfaces on okay and doing smooth things much more much smoother things and we'll have to get the the colouring system the shading system right etc and then the fourth one is usually kind of a final project that we have to that we do that'll include a lot of all that we've learned all the way through the quarter fourth one is now how do I do this the first three are assigned during the quarter fourth ones the final exam okay I'll usually give it two weeks before the finals I'll make it due on the final exam so everybody loves me because you don't have a final exam in this course okay we do have a midterm in this course okay we do have a midterm and will be given about the eighth week so that's not really midterm but it'll be given about the eighth week okay what I typically do on the midterm as I will give you out a week before a sample midterm okay I'll give you out a sample midterm which will look amazingly like the real one okay now I accept it'll be some slight changes etc and what I do I mean I think of exams also as something that makes you go over to material again you actually learn the material once you go over to a second time right so that that's the strategy here but I'll give you a sample exam now tell you a little story I'll probably tell you this again is that one-quarter teaching the teaching one of my classes I give out these sample exams and I was about to leave for class and I thought I forgot to make up the sample exam I forgot I forgot to make up the real exam right so I jumped on my machine I took the word sample out right of the the the Microsoft Word file right and printed it all out right and and gave exactly the same exam as I gave everybody okay and the distribution was all same right as it was anyway okay I gave them exactly the same exam okay and so but what I'm trying to do on the on the midterm is get you to look over that material one more time that's purpose and one of the purposes of an exam okay the real meat on this course is going to be the assignments right that's where the grades are determined okay and I do two things that are slightly different than most that during dramatics is one slightly different one dramatically different than everyone else the dramatically different one is that I don't accept assignments until they're complete okay there's no partial doing it partial again turning it in getting a partial credit I believe that in this field especially you got to get software that works okay and it's got to be complete so it's got to do what you what it says what it says in the assignment to do and so that you've got to get that last bug out right in the in your assignments and on what I do is I give you I allow you to turn them in late right but I penalize you they're mostly assignments are fifty point assignments I penalize you five points a day all right and a weekend counts a day and what I try to do is I make the assignments do like on Thursday okay and so you get in a weekend almost immediately but a weekend counts as one day so you're allowed to turn in assignments late here if you turn them in if you turn them in and they're not completed at all all we're going to do is write you an email and say no I'm not good enough okay we're waiting for the real one all right that's one difference that I do that's dramatically and Everett than everyone else is I don't do partial credit right we want pictures to come out here right that's that's the difference in this course the second thing I do this different a lot different is that the university set up kind of to teach you all individually right we call it cheating when you look at somebody's else's paper okay or something but in the real world that's not the way things are done okay you learn by collaborating with all your other people there's a tremendous amount to learn in this course okay and what I want you to do is I want you to work right as a team a team right against me and get these things done okay I'm going to give you some really wild assignments okay draw the Meyer sundial on November 10 o'clock in the morning on November 5th 2005 okay that's the assignment and the question is what's the buyer sundial right and you know you what I'm going to do is I expect everyone to figure these out now it's much better if you're working with a group or a team or your neighbor or whatever to do this so what I want you to do is to feel free to turn to your neighbor and say hey what's he talking about right how do I do this etc well if you discover something on the web share it with other people right that you found you know you work as a team in this course and talk if I do my job right I see little groups of you over drinking coffee of the silo in the mornings okay working on some of the assignments if you work individually on it it's going to be a pretty substantial workload you should try to work as a group now there's a problem with this strategy and all by the way all these things I'm saying right now are out on the website okay they're all out there there's a problem with this strategy and that the university requires that I grade you individually okay and they require that the work that's turned in be your own creation okay so all I require of you is you can solve the problems you can help each other debug you can do all these things with the code your turn in has to be your own code okay not somebody else's code in the last room that you borrowed to make the program work all right that's the only thing I ask of you is that you turn in your own code the rest of time talk I mean if one of the best classes I ever had was a ECS 177 class and that we have kind of we call it interactive grading they have to show me their program how it works and I went down one night and maybe half the class showed me the problems right right away they were done they showed me them and yes good enough good enough and then that half the class maybe ten or twelve people they didn't leave what they did was they went back in to the room and they started helping the people who weren't finished yet okay and they were I heard comments come on come on we got to get this we got to get this we can't let can win on this problem and that's the attitude I want to see in the classes if I do my job right is that these classes all talk to one another so a lot of work to do in this class okay a lot of work okay let's see where's the library all right here's the library okay that's the lot that's the library for this class okay if you aren't going out on the library and you're not going on Google and you're trying to find things right you're doing something wrong if you're in that big huge building in the middle of campus okay unless you're using the wireless trying to do things you're doing something wrong okay you're doing say you should be bells and whistles going off in your head okay the library is the net on this class every single piece of information we need is out there okay waiting for you there's a lot of things that Google searches that people don't know right if you add this to your search right file type : cpp guess what you only get C++ files back really cool when you're trying to write code nice to look at other people's files if you put PDF out here you get PDF files back when I make when I make up PowerPoint talks I quite frequently search with file type : PPT okay and it gives me all PowerPoint files back it doesn't give me all the junk that usually comes with a Google search right you can limit it down and think about things like this you know it's much better than going if you're doing the carrot card catalog in the library right you're doing something wrong in this class because everything that we have out there all the Qt documentation is out there on the web okay that's linked off the website there's a link for that on the website all the opengl documentation is out there on the web okay I haven't been in the library in almost seven years now on this campus okay but I'm in that library every single day and trying to find things and it's amazing how quickly you can find them much faster than walking over to to the library here and walking back okay who has a copy of the book what's it look like yeah okay all right all right there's I am NOT a book person and in this field there's not many good books okay and so about four or five years ago I stopped recommending a book for this class and what you should do is if you are a book person and there are book people in this room who would like to look at the books see what happens there are some really good books out there right but they're what you should do is find the one that's right for you okay there's one called Hernan Baker right which is a good solid book I thought of these again they're on the website okay they're on the website what I suggest you do is just for your book person and you want to do this you know and you want to have a book and one of you which is you know which many people do that you go right sit down at the floor of the bookstore look through a few books find the one you want you know take a look at the two books that we've got out there on the website there kind of the two that everybody uses and and you know buy one ok you can get them through Amazon in a day or two days if you want and that's fine but the bookstore here at UC Davis is real you really used to me sitting down on the bookstore on the floor of the bookstore and thumbing through books I do it all the time right to see if I can find information or something like that but also you can do this entire course through the library okay you can do this entire course through the library I have an extensive set of notes out there which are going to mirror pretty much the lectures that I do in this class okay the all the manuals and everything else and what Sebastian's lectures will help you get code it started with code and and then we go from there mostly we use C++ and graphics most of people you do graphics use C++ you can use other things too but there's also for most of my lectures and all and most of the things I talk about here there are C++ classes out there on the website that you can download and use free of charge okay so I got tired of in this class of people writing up programs that multiplied 4x4 matrices together right so we give you those classes you can use them however you like so with all this there's a lot of information out there right but there's going to be a lot of information that comes out you're really fast in this class and we're going to have to you know you're going to have to learn all of this and you're going to have to write some substantial software as we go along so everything okay I mean I heard 45 people in here and I just counted 63 so I assume that there's a waiting list or something like that but we should be able to go quickly as we go along so everybody ok with this remember this one right I mean most people it's amazing how many people don't realize where the library is in computer science right it's right in front of you all the time I maintain the universities that have always been enclaves of scholars surrounding a library universities are eventually going to be distributed around because the library is the net now right and it's becoming more so all the time so our library is slowly you know slowly dying and staff because there's none of people coming in anymore so everybody okay remember file tape : cpp right or with me it's there's also another one file tape : cap see some people like to put cap see those of us use VI right like put cap see there but this gets you all C++ files that you can look at so you could take an OpenGL command right and you could Google search for that OpenGL command file tape : CPP and you'll get a whole bunch of samples of C++ code that use that command okay and you can look at it so it's a really really valuable thing to do questions are get started ok ready okay all right what's a vector space anybody ever see this term before yeah what you want to take a shot at it yep close right the way we think of a vector space is that that was really good right is that you can take any two things in your vector space you can add them together okay and you get another thing in the space okay and then you can multiply anything in your vector space by constant and you get another thing in the space okay that's all and then there's some rules to make it make sense all right that's the way I always lose that you know mathematicians always like to say the distributive property the associative property the commutative property I mean those things are they're just they're so they make so things make sense okay I mean you want V 1 plus V 2 to be same as V 2 plus V 1 for example okay you want this stuff to make sense but in a vector space you really have these two properties right you have you have two elements in your space if you add them up you get another one okay and here's an element in your space you add them up when you get another one most people think of vector spaces as vectors right okay now I mean you know we have vectors writing with the things with arrows sticking out and you know that's what they think of as vector spaces and vectors spaces of vectors are in general vector spaces yeah they are because you can add any two vectors together right and you can use the parallelogram rule and you get another vector okay here you can add them component wise or whatever you can take any vector you can multiply it by a scalar and you get a longer vector or a shorter vector or one in the opposite direction if your scalar is negative okay and so most people think of vectors as vector spaces but that's only one thing okay and we use vector in computer graphics all the time as directions okay we use them as directions to point it we're going to see me walking around with fingers sticking out my nose pointing at things okay one of the very first things we have to do in this class is figure out how to position a camera in three-dimensional space and take a picture of something okay take a two-dimensional picture of that one thing and placing that camera in three-dimensional space we're going to have vectors running around okay well vectors kind of turn you into something company we call frames okay and frames are important because they're kind of little coordinate systems that we use that was a bad let's try this one okay it's got a little coordinate systems that we use and we run around with different coordinate systems and you know if we're in a plane our plane has a little coordinate system that we have to manipulate right and so we have to manipulate these three vectors at a time okay coordinate systems have something there even that that in addition to vectors though there's four things with these little frames four things with these little frames there's three vectors but there's also an origin of the frame if you have a little coordinate systems that's running around in your helicopter as you're flying around something there's an origin to that and you have to keep track of that origin and so we end up with things called points and vectors that we deal with all the time in computer graphics okay we deal with points and vectors all the time and there are properties with these little points and vectors that we use for example that if you take a point here's a point to point P and here's a vector V that if we take a point I'm going to put a little hats over my vectors so that I distinguish them we can take the point we add a vector we get another point okay we get another point Q where Q here is kind of P plus V okay point is called up of you can add a vector to a point get another point similarly you can get a vector V by taking two points and subtracting them okay now we already know we can add vectors over there we can multiply by scalars you can also get a vector by subtracting two points okay it turns out and there's a little there's one other thing you can do and that you can get a point P by this operation oh let me do let me try and draw you one more thing here first so I actually motivated yeah OOP top up let me try another thing here if we have a point P here pride and a vector V if I take P plus some alpha times V I can get any point on this line okay I can get any point on a line that goes through here and you're going to see this representation really a lot and there's a couple ways to think of that and that I'm breaking chalk all over the place here if I have two points p1 and p2 right I can say that if I take P 1 plus T P times P 2 minus P 1 like this now hang on I'll get to okay now this is a vector right subtract two points again a vector so if I take a if I take P plus T times some vector I can get all the points on the line here and you can kind of see in this case all right you can kind of see in this case that if T is equal to 0 I get t1 right and if T is equal to 1 I get P 2 I think write t1 minus P 1 here effectively so if T is equal to 1 I get P 2 so you're going to see this formulation all the time here but this formulation actually motivates something that looks slightly different if I say 1 minus T times P 1 plus T times P 2 you see they're the same thing ok this gives me any point on the line going through here so does this ok and you're going to see this thing over and over again because this is an operation with points and with things outside of points it's the only operation we can do with points other than subtract two of them and get a vector is you can do this operation that says if you have P is equal to some alpha 1 P 1 plus alpha 2 P 2 plus alpha 3 P 3 that could be even more out here right where alpha 1 plus alpha 2 plus alpha 3 happens to be 1 okay if you add if you put constants in front of points such that the constants all add up to be 1 and these guys do write these two constants in front add up to be 1 because the T's go away you get something called an ad this is called an affine combination and the the vectors plus the points are called an affine space now this word affine is something that probably you haven't seen before that you're going to come across a lot in this class because this is the way we we figure out points and vectors and combine them all together and everything else okay so you're going to see this let's see I had a question back here go ahead yes except if you're a computer scientist here you take P plus the vector V you're going to create a new point okay whereas if you take two points and subtract them you're going to create a new vector yet they can kind of generally do that but yeah it kind of looks that way algebraically same thing over there kind of looks that way algebraically but not quite okay yeah but in reality there's only two things we get to do with points okay we can subtract two of them and make a vector okay we can add well we can add a vector to a point get another point or we can do these affine combinations of points okay oh thank you is that what you mean uh-huh yep okay thank you thank you by the way please take Ken's like Ken does not lecture and it's it's it's you know it's not the Bible when Ken lecture is not perfect okay please take my lectures with a little bit of grain of salt I'll do this so this a fine combination you'll hear me do this a little bit as we get a lot as we go along so let's go over here for a second and I'll show you let's take a triangle like this your p1 p2 and p3 and we create frequently had to feet have to figure out a point here take any point in the Triangle P okay and how do I write T in terms of the vertices of this triangle it is one of the problems we come up against in graphics all the time how do I write P in terms of the points of the triangle well you can kind of see that if I look at this vector here if I look at the vector P 2 minus P 1 all right so let's look at a vector now look at the vector P 2 minus P 1 and the vector P 3 minus P 1 which is this one okay you can kind of see that I can get to P by going up here a certain distance right and then going over here a certain distance so this is if I is certain percentage of the vector P to be 1 and this is a certain percentage of this vector right P 3 and P 1 P 3 and if this distance here if say is alpha how am I going to Seska I'm going to call this alpha 2 in this distance here is alpha 3 the length here I can write P as I start at P 1 and then I add on the vector alpha 2 times the vector P 2 minus P 1 and then I add on the vector alpha 3 times P 3 minus P 1 CN and I get to P all right if I start at p1 i add i add on this constant times P 2 minus P 1 then I add on this constant times P 3 minus P 1 I get to P I think and if I look at this correctly and do a quick rewrite this is 1 minus alpha 2 minus alpha 3 times P 1 plus alpha 2 P 2 plus alpha 3 P 3 and if I call this one here alpha one right then what I get is P this point P inside is alpha 1 P 1 plus alpha 2 P 2 plus alpha 3 P 3 right where alpha 1 plus alpha 2 plus alpha 3 better be I think it is 1 ok so this is something where I can write any point inside a triangle in terms of the points at the vertices of the triangle okay where are these alpha values I put in front have to add up to 1 okay and it turns out that every point I pick inside has a unique set of alpha values for it and so consequently we kind of think of this as a coordinate system for a triangle ok the alphas are the coordinates of points inside the triangle kind of weird coordinates usually don't look like this but we think of it that way you can see that if alpha 1 let's see if alpha 2 is 0 right alpha 2 is 0 then alpha 1 and alpha 3 add up to be 1 and you get a point on the line P 1 P 3 here etc ok so it's it's a cool little system these are called in the math world Bary centric coordinates all right they're called barycentric coordinates and they're coordinates of triangles they're coordinates of triangles but you see here this affine combination you see this affine combination sitting here okay so I find combinations are kind of cool well they're even cooler okay so let's see here's let's see let me do this one minus T squared 2t times 1 minus T and T squared here's three polynomials okay here's three polynomials and no matter what T I put in here okay I get I get values out and it's really set up to have T between 0 and 1 these polynomials okay and what are these pole and always add up to be by 1 minus 2t plus T squared I think is that one this one is 2t minus T squared and that's T squared all right now minus 2t squared there you go that makes me feel better suppose I add these guys up what I get 1 right okay so here's at some point suppose I have three points one two three suppose I have three points okay and I write P is equal to a new point P is equal to one minus T squared oops p1 plus 2t times 1 minus T p2 plus T squared times p3 now this is an affine combination right that's an affine combination because all the coefficients in front add up to 1 all the alphas add up to 1 so it's an effing combination but what's cool about it is I can stick in any T I want and I get a new point out okay if I ticking its ticking T equals 0 I get out I hope p1 right because T equals 0 makes this go away to equal 0 makes this go away I get p1 out my stick antique 1 ok I stick in T equal 1 I get p3 out I stick in other things I get write something out universities saving money on chalk I get other things out and I get a curve ok and I get a curve out which is it's actually kind of cool from this affine combination because I can put any t I want in there ok and these polynomials in front actually have a name they're called the bernstein polynomials if you take a probability class in statistics or in mathematics here you see these all over the place ok they're called the bernstein polynomials and they can be used to make curves ok this one happens to be you'll see this you'll see this again in your first do next time I'll lecture get on this next time a little bit this one happens to be a parabola ok it happens to be a parabola the so here's a cool way of generating parabolas but I can do this again all right let me do it again here's another set of polynomials okay just see how I generated this one right I started with 1 minus T cubed up here and T to the 0 if you will and then as I went down I added 1 power to T as I went down and I subtracted 1 power from the 1 minus T as I went down right and then the coefficients in front we're one-to-one over there they're 1 3 3 1 here right no no magic involved ok so that comes from Pascal's triangle ok but if I do this I can take four points okay and guess what I can put in T's from 0 to 1 I think it's pretty easy to see that when T is 0 you get p1 and when T is 1 you get p4 ok and I put in T between 0 and 1 I get some curves ok some kind of terror curve and it's not too hard to see it's a cubic curve here right cubes running around okay you get a lot you can have a lot more fun this way you have a lot more fun this way you can have P 1 P 2 P 3 and P 4 and get something looks like that ok you have a lot more fun with 4 points and you can with 3 3 you always get a parabola ok but I'll show you how you take 3 I'll show you Monday how you can take 3 and make it in 1972 there was a fellow named George chicken who actually lectured at the University of Utah he said hey I have this cool idea right and I'll show you the cool idea I mean I'm this really cool idea of how to generate curves and all he was doing it turns out with varying parabolas right and piecing them together right he could generate these curves by piecing parabolas together really in a cool way ok and that everybody said wow that's really neat unfortunately we don't have enough memory and computer power to actually do the things you want to do then the 1990s all of a sudden when computers became faster these things came back out as subbed what we call subdivision methods again I'll do a little bit on this on Monday and now we have subdivision surfaces and all those characters you see an up and Toy Story not Toy Story that wasn't done then and some yes the last toy story it was but all all those things are generated with what we call subdivision surfaces ok which came from George chickens lecture in 1972 and you can see I have things out there on the web for chickens algorithm and all so one of what kind of wanted to show you here is that these affine things are cool we're going to do a lot of stuff with a fine things there's points and there's vectors they don't get too freely combined to combine them in only a few ways you subtract two points you get a vector he had a vector to a point you get another point or you with points you can do these affine combinations and these affine combinations give you other points but it has the caveat that all those coefficients in front have to add up to one which is sometimes a pain in the neck okay and we use these things over and over and over again in computer graphics okay let me do this one really quick I've got five more minutes let me do this one and I'm going to blow you away okay not really here we go let's expand this thing out okay it's a Miss all right let's expand it out and it's going to be a mess here but it's going to be 1 minus 3 T plus 3 T squared minus T cubed times P 1 ok and you get 3 let's see you get 3t minus 6t squared plus 3t cubed times P 2 still with me and you get 3t squared minus 3t cubed still ok times P 3 plus T cubed times P 4 ok okay with everybody okay this is equal to how am I going to do this this is equal to one - don't copy this down right 3t just watch it's just simple algebra guys T cubed times 3 t 6t squared plus 3t cubed 3t squared minus 3t cubed T cubed vector matrix night times P 1 P 2 P 3 P 4 ok this is the trick we use all the time you're going to see me do this a lot okay all I'm going to do is take that polynomial thing or something and I'm going to turn it into this is just a dot product write a 1 by 4 vector a 1 by 4 matrix times a 4 by 1 okay okay now you ready for this one ah oops okay now that it works right I take this times this I get that this times this I get that okay so what happened here was that I have this matrix here which is a constant matrix same no matter what T is right and I can change the points over here and the points over here but if I have an engine that multiplies 4 by 4 matrices together really fast okay and you'll see that I do because this is what we're going to do in this course you're going to see four by four matrices to death in this course okay our camera transformation the really tough thing that we'll do in about week two-and-a-half or three the camera transformation is a four by four matrix okay it turns out if I have a 4 by 4 matrix entered all I have to do is modify this thing right and I'm off okay and I can code this up as a 4 by 4 matrix saying I can cut it up in parallel I can do all kinds of stuff with it and make it really fast and so here we go from a fine to all of a sudden we've got to change these always our math things in the computer things right changing this into computer things if I look at it as far as matrices is actually easy ok the other thing now the thing that will blow you away is what was that what if I was to ask what the what the derivative of this curve was okay it turns out that there's lots of principles of these curves you'd like to know these curves by the way are used in the CAD industry all over the place your car was designed with them your vacuum cleaner right the microphones probably in front of you were designed with them okay they're all over the place these things are used so what what if I want to find the derivative of this thing okay how do I find the derivative of this thing oh that's easy derivative the derivative of that curve is 0 1 2 T 3 T squared times this matrix times that matrix okay I'll have to do is go ahead differentiate the first one it come just drops right out okay and we own computer land love these things that are based here I got this complete cubic curve that I've done and all I need to know is four points okay and we love it when you can do continuous things you can drop them down to discrete things right only a few points and do it we love that in computer like in computer land and that's what these things are good at so it turns out that these polynomials form the basis of a vector space here we go again right they form the basis of a vector space and you can get any polynomial by a combination of these okay usually we think you can get any any cubic polynomial by a combination of just these right but these guys form a basis right of that vector space there's another vector space that pops out the space of 4x4 matrices is another vector space you can add them together you get to write you get a new one a new matrix you can multiply by a constant you get a new matrix another vector space matrices are going to be a little fickle for us though because when you multiply matrices together it depends on which order you multiply them in okay as to the result you get and that will cause us problems as we go along we won't just be able to multiply them in any order you'll see okay so lots of stuff today what I want you to remember out of today's lecture put in the back of your mind we're doing vector spaces all you have 22 a we're doing at all this quarter right everything we do and then the word affine put in your head that little thing that says we can take points and put coefficients in front of the points you know multipliers in front of the points as long as the coefficients add up to one we get another point okay we're going to be using that over and over and over again for that and I will see you on Monday I think
Info
Channel: UC Davis Academics
Views: 187,089
Rating: undefined out of 5
Keywords:
Id: 01YSK5gIEYQ
Channel Id: undefined
Length: 49min 44sec (2984 seconds)
Published: Fri Dec 19 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.