Mtg 12/23: Wed-23-Oct-2024

Outline for Today

Assignment 2 and Midterm Exam

Administration

Today

  • Assignment 2
  • Midterm Exam: Chapters 1-5

For Next Meeting

Wiki

Link to the UR Courses wiki page for this meeting

Media

Transcript

Audio Transcript

  • Hello, Hello, Hello,
  • how's everyone doing today? I
  • so let's talk about Simon two and
  • midterm and
  • let's see where that gets
  • us. I
  • so my computer seems to be
  • better today. It's not giving me two different mouse pointers on
  • the different screens. I'm happy about that anyway. Okay, so
  • let's look
  • at the assignment do
  • Is there any interest in making the Due Date Monday?
  • Anyone strictly opposed to an extension. I
  • Okay, so
  • I'm asking you to write a program and answer a couple
  • questions. So write a web GL two program that generates a 3d
  • hypo. There shouldn't be two there a certain skis tetrahedron
  • and builds a container around it that includes the tetrahedron.
  • This container should have a lid that opens while being connected
  • to the rest of the container along a common edge.
  • So maybe
  • something like
  • this. I
  • that feels like a garbage bin. Let me try again for a king. I
  • Well, that's not better.
  • So we have we
  • have a lid, so we have an opening
  • and a lid that's connected here. And
  • How's my drawing? Okay,
  • I think we got the general idea. Okay,
  • thanks. That's very generous. Okay, so that's that's the
  • general idea.
  • So here's the sample from the code. Sample code from the
  • textbook. This is gasket four in chapter two. So that gives you
  • an idea of what should be included. I suppose you might
  • think of the
  • you could put the tetrahedra, the sierpinsky's tetrahedron,
  • inside a tetrahedron, and have and have one, one or more sides
  • open up and
  • does that convey the idea? Okay?
  • So we should see the there's a tetrahedron inside the
  • container. And so
  • you
  • can use sample code discussed in class and the 315 lab. So for
  • those of you in 733
  • you may not have seen this, so we'll go over it a bit today,
  • not to belabor the point for the people who have done the lab
  • already. But if there are questions I'll do my best to get
  • them sorted out. Okay, so I repeated myself in a different
  • way, I think thanks to me use Apple coat from the glass and
  • the lab,
  • I remember to acknowledge your sources, and then later on, when
  • I corrected the bit of instruction from first
  • assignment. Then I said the same thing, that you should not
  • forget to give credit where credit is due, and not represent
  • other people's work as your own. I
  • so for the submission, I want you to submit a single zip
  • archive. I
  • So Maybe I
  • so maybe you have Two PDF files, or a single PDF file that
  • answers both questions, the readme file and then A code
  • directory that has the common stuff and and your own code.
  • So a note about adapting the lab code for the assignment. So Alex
  • has the shader code and separate files, which doesn't always run
  • well. You click on the
  • HTML file, the marker may run some problems with cores, so I
  • think the easiest solution is to follow the textbook convention
  • of putting The shaders inside the HTML file using script tags
  • and
  • energy. So here's the link to the lab of three.
  • So Alex has done a few things that are nice, a couple things,
  • Well, they don't necessarily match with the textbook Code. I
  • you.
  • This isn't a big thing in this in this code that it's an issue
  • in other places, GL, dot, false doesn't exist. You
  • so instead of in the textbook code where he says, Remember,
  • these are in column major format in The shaders.
  • So Alex has done a Nice silication And We sell you
  • so We do a flat, put a trend, flatten the transpose, so that
  • takes care of
  • switching from the Row, major format in the JavaScript to the
  • column Major form in the shaders and the GPU.
  • So let's
  • look at an example. I
  • so in the lab code here, there's Bridgette. Projection Matrix. I
  • so
  • we have m v so
  • in terms of vertices, we have a position.
  • Or I think he's Alex, is called V position times MB times p, and
  • that gives us the GL to position. So we apply the model
  • view matrix and then the projection matrix and
  • so we start so we're the way it's done, by convention is to
  • post multiply The
  • the viewing matrix
  • with the transformations and so
  • what we start with is the Last thing that's applied, because we
  • go through transformations and
  • is we can say we start with identity, and then we Do the
  • look at
  • and Then we get the ball. You
  • so we're building it out from this way. So you stay you can
  • start empty
  • equals to Look at and
  • then MV
  • equals Mold MeV and
  • Next form I'm
  • so this is
  • a variation On the boxes example in the lab.
  • I am looking at it from a different point of view. Here's
  • an example of how a lid might
  • move to
  • illustrate the show The contents of the box of The container.
  • So the
  • in the vertex shader.
  • I didn't, I didn't correct this one, I guess, oh, because it's,
  • that's not my No, it is,
  • yeah, okay, I see I left the original code there, but I just
  • streamlined it a bit
  • so I
  • so we take the V position, the vertex attribute position,
  • multiply it by MV and then by The projection matrix to get our
  • points and then The fragment shader is just passing through
  • the color. And
  • so I haven't used the matrix stack here I'm just resetting
  • the View after I draw each cube.
  • So
  • start with look at
  • so the first
  • cube is moved on the x axis, but it's still centered
  • on still centered on the axis, just moved further down the x In
  • the x direction and
  • so the translations are the same as
  • if we start with that,
  • if we didn't do a translate, we just did the Rotate, where would
  • we be rotating?
  • Right so we'd be rotating around that center as it is, but we
  • want to rotate on an edge so we translate by one Half, one half
  • And up together. You
  • That one's Not a very good square, but you get the idea. So
  • we're doing a translate, so we have the center of the axis of
  • rotation on one of the edges of the cube, and then we do the
  • rotation, and then we do another translate to put it On top of
  • the other cube.
  • So instead of resetting the MV matrix to look at, we can do the
  • push and pop
  • so we don't have a
  • so That simplifies things a bit. Does That make sense?
  • Was that helpful? I
  • Okay, I
  • Should we Try it with Solid tubes? I
  • any questions about about that at all? Bless You. You.
  • Okay, should We talk about The midterm? I
  • So we'll cover chapters One through Five. You
  • so
  • do a summary of
  • our discussions, some links, resources, and I'll have that to
  • Father for Monday. And if we have questions to
  • to do, whether we can do that, then I
  • So it's going to be
  • in person on paper,
  • so I have more flexibility for The kinds of questions I
  • I think that was the point we used In our example. What
  • you think about
  • that is that that as a question. Take
  • care. So I
  • would say
  • rotation on x means that
  • we have this matrix the cosine and sine, and then if
  • I give you an angle different
  • than 90, I'll give you
  • I'll give you the values to put in as well,
  • so we don't have to memorize values. Just do
  • the process, go through the process. So
  • who likes that idea?
  • Okay, one person, 2345, well, that's okay.
  • Should we do some multiple choice questions? Do Okay.
  • I'm How about give you a little bit of JavaScript or Shake your
  • code to explain what's going on with it.
  • Anyone like that idea for a question, okay?
  • Any other kinds that come to mind? Well,
  • so Of course, some exams, I have a couple that
  • are based
  • On this book,
  • so it's not an indication that so the discussions in class may
  • have been different, but I'll give you the sample exams and
  • samples To in the hope they may be of help. I
  • any Other questions, suggestions? I
  • Okay, so
  • if you have any that come to mind, let's say by the end of
  • Friday, you can post them to the class discussion list, and I
  • will. I would certainly appreciate that that's that's an
  • option, opportunity for participation in the class to
  • give you questions And what you think would Be good answers.
  • Okay, do
  • Okay, so I thought maybe
  • We could talk a little bit more
  • about projection matrices, okay,
  • it also indicate which slides that sharing with you, Maybe I,
  • more relevant than others Do.
  • Okay, so the comment about
  • we're getting everything into the standard view volume and
  • so what is The View? Volume? Make
  • any changes? What are the
  • points? We're able to see? What core points in
  • what are the coordinates that we're able to See without doing
  • anything, setting Up, viewing The transformations.
  • And I didn't put the z values in.
  • So
  • if the positive Z axis is coming out of the board, and so which
  • handed coordinate system?
  • Is this the volume that we have to work with? Do clipping
  • coordinates, it's
  • actually minus one, minus one, minus One and on.
  • So we can apply orthographic projection to
  • get perspective projection So
  • so this is I start with Our model view transformation. So
  • all the transformations we have at the model. And then at the
  • end of that, we do the viewing the lookout to change the basis
  • for the camera space. We do the projection transformation, and
  • then when we go to perspective division, to go from 4d to 3d
  • then we do the clipping, and then we project from 3d to 2d
  • and so we wanted to the information as long as possible,
  • because we want to do the use the Zen buffer, or the depth
  • buffer, to help us with hidden Surface Removal and it.
  • So if we do
  • orthogonal
  • projection, we have an ortho matrix in MV, nu.js specify the
  • left, right, bottom, top and near and far coordinates so that
  • we have this shape, the shape on the left, and it gets
  • transformed into the standard clipping volume.
  • So we move the set the two steps that we need to accomplish. So
  • we move the center to the origin translation then we scale so
  • that the sides have length two, because we go from minus one to
  • plus one.
  • So two divided by right minus left, two divided by top minus
  • bottom, two divided by near minus far, and then the
  • translation that we specify in the first step. So that's
  • that gets us into the clip coordinates, the minus one plus
  • 1q and then
  • this matrix M Orth takes the 3d coordinates and puts them into
  • 2d because We're dropping The Z and
  • so here's an example with the center of projection at the
  • origin the near moving plane at z equals minus one, and the 90
  • degree field of view determined by The planes x plus minus z, y
  • plus and minus z. So that means going out at 45 degree angles.
  • And so the field of u is 90 because we have 45 and 45 and
  • so the simple projection matrix for homogeneous coordinates, so
  • we have minus One in the bottom row. So
  • the point x, y, z.
  • So we can map parameters, alpha, beta, and after the perspective
  • of vision, we get x, prime x divided by z, y prime, y divided
  • by z and z prime is minus alpha plus beta over z,
  • So that projects to the desired part, regardless of alpha and
  • beta.
  • So if
  • we pick alpha and beta carefully, then the clipping
  • Volume is the default again.
  • So we're Stretching out
  • so this,
  • stretching out this plane to be the same size as that, or we can
  • think of we're taking a truncated pyramid and turning it
  • into a parallel plate, but so we can easily get it into the
  • clipping coordinate. So it's the story, but it projects
  • correctly. I
  • so our hidden surface removal with the depth buffer works if
  • we apply the normalization transformation first. So
  • there's some distortion, which might become a problem of small
  • businesses and
  • I anyway, wrote a time I see I hope today was
  • helpful.
  • At any rate, I thank you for your attention
  • today and for time to see me
  • and I rotating cubes. I have office hours tomorrow, but feel
  • free to make comments online as well. So anyway, this is a bit
  • early, but have a good weekend, and we'll see you on Monday, if
  • not before. Take care. Everyone you
  • not before. Take care. Everyone you

Responses

No Responses