Outline for Today
Wiki
Link to the UR Courses wiki page for this meeting
Media
Transcript
Audio Transcript
-
So here we are meeting nine.
-
So we're going to talk about Chapter Four
-
serve as an example.
-
I guess I'm a Florida
-
material state
-
assignment
-
it's not just and or convenient
-
Okay, so here's the link for attendance.
-
Just I'm here I want to reiterate
-
so we're having our midterm exam on Monday. The 23rd. So that's three weeks from today.
-
So our schedule
-
so that means you're going to have three more
-
so you have today's meeting
-
and Wednesday's meeting, that's this week and then there's a break.
-
So we have today for three more
-
and then
-
23rd is the midterm. So
-
chapters one through
-
five.
-
So I asked your input in creating the midterm so it's a fair evaluation that we've done.
-
Okay, who can
-
read what I've written on the board?
-
exam that is a fair evaluation of what we've done. Okay.
-
Get a gold star. Anyone, man? Good question so far. Do we have like
-
do you have like, over 1000 people? Yeah. I'll post this week. Thank you.
-
So that's not a guarantee that that's what this will look like. But we'll find it.
-
Yeah, sure.
-
So you can comment about whether you like certain questions or styles or questions and so on. I think that might have been a 50 minute exam. Whereas this could be a 75 minute exam so it could be a little bit longer. If that's a good thing. Or a bad thing.
-
Okay
-
any questions or comments about the assignment
-
last one is the like
-
alright. All right.
-
Other than politics
-
as
-
you explain about records, cast get what you want in our assignments, like nine different come in three iterations back? I'm not quite sure about keywords how do we want?
-
So just that's
-
there's a link for you today
-
assignment
-
so now an assignment
-
I talked about transformations. But that's maybe not quite the language he's using in the application. So we're subdividing the triangle into recursive?
-
So we're saying to make a triangle with subdivide, do we call it with each of these three triangles.
-
So then there's a way we can say what
-
color that triangle color one and not triangle color to that triangle color three
-
now for say the last transformation last subdivisions so.
-
Please remember this
-
is an equal lateral triangle of drawing.
-
Although it's getting a little bit out of whack.
-
So this, this triangle is has been subdivided
-
we've taken
-
the set the same subdivision twice so we say
-
we call it.
-
Oops next year so in there
-
so, if we call it again
-
save us
-
so that's let's say this is our first iteration and then we call subdivide.
-
Sounds it's good. It makes sense though.
-
I imagined that word but if we say subdivide a, b and c, so A, B and C is called colors one, two and three. So when we subdivide a and then
-
we go into the routine
-
so
-
these corners are getting
-
so this is subdivide a fall by subdivide a kids color.
-
Or that's a triangle. That's right. In the corner.
-
And similarly something like
-
so that makes sense. I know I'm not getting to your question yet, but I just want to review the whole thing again. Does that make sense?
-
So if we so it's about
-
using the
-
way the track functions are called to assign colors to the triangles so what are some ways you can pass information to a shader to determine color, but isn't based on vertex vertices?
-
Sorry, what's
-
the like the global disease
-
so not not a multiplier so let's just think about so we have
-
so we're talking about positions or attributes from the buffer. During we're getting a position for each vertex. We may not we don't need to change we may not need to think of a one to one association.
-
So when I did a rotation, for example, we use the uniform variable so that's something we can set that isn't attached to each vertex so that's really more important. When we talk about the chaos game approach.
-
To that detour, helper not
-
busy idea clear.
-
So they're keeping track of so in this case, we're keeping track of one or two trends. One or two function calls the last ones that are made before we draw the triangle
-
don't want to go through the whole assignment for you right now. We're leaving a bit of a challenge still so
-
but that ideas, okay. All right.
-
So then we're doing chaos
-
so let's say we start here, another choosing a random, one of the three vertices, and we're moving the point halfway towards that new vertex. So if we choose vertex one, and they move here
-
and then a free choose
-
vertex.
-
Well, let's call it 1233.
-
Choose vertex two and then vertex three
-
and call it just call it some other ones. Where we see couldn't be my random number generator.
-
Now 123 pick pick one of the vertices vertices one.
-
Okay
-
shouldn't all be underlined but
-
close
-
Okay, so
-
should you if you are
-
let's let's just go everyone do one start in the corner here. Good. Okay. So this is where I ended up
-
what? Actually, let
-
me write it down
-
next you can
-
do the same one twice in a row or two. That's alright. You don't have to pick a different one.
-
Okay, next one.
-
Next
-
one more
-
where do we end up? Let's see. Okay. Anyway.
-
So you can see
-
look at the history of colors, or the history of these transformations. So the last ones for this point, whichever I didn't mark it down, but whichever point that was, maybe we had to and then one could think of a moving window here
-
and the next point has one and three
-
and the next one is three and 1133
-
and two,
-
two and three,
-
three and two.
-
So we can say
-
this matches up
-
with that one, and so on.
-
Does that make sense?
-
Man See ya. Okay.
-
Oh,
-
I thought I was doing okay.
-
It's okay.
-
I'll have it sorted out now.
-
Thanks for your patience.
-
So that makes sense. So that's your question.
-
Every one comma do we need to apply red color 12322
-
So I just
-
so I'm just using these to indicate the colors.
-
I didn't say what they should be. So you can you can choose nine colors that are completely different or you can choose colors
-
are related.
-
So how do we how would we relate these three colors? Say this one is red
-
they might add.
-
So if we said this one is red
-
red, red, green, blue.
-
You could say
-
this one is blue with some blue. So this is full This is bright blue, bright red, bright green.
-
And the other two are are some mixture of
-
red blue and so this would be
-
a mixture of green and red. And this would be extra blue and red. Blue and red
-
green and blue and green and blue, red and green. But then maybe we don't want to make one too the same as to one. So we can put more weight on one of the colors so we get
-
more of a tent
-
so maybe let's
-
talk a bit a bit about colors. And let's talk a bit more detail about colors. Before we go too much further than
-
Is this okay?
-
So let's say we begin with no color.
-
So we say that's black
-
and then we can have red
-
zero to one. Sure.
-
Let's use K for black one
-
we have green and zero to learn more
-
so what's this corner
-
so red screen
-
red pause screen any
-
yellow
-
red plus blue
-
magenta
-
and then
-
magenta plus yellow is Wait
-
blue plus green
-
cyan
-
I know everyone is just about ready to say siad virtue
-
then say and plus red makes weight as well.
-
So, this RGB cube
-
is useful in some ways. So the RGB relates to the tristimulus color theory of color
-
so, those are our primitives
-
RGB
-
really, it's an additive model.
-
So, we're starting from black and we're adding color to it. That's what we see on displays.
-
And what about printing we want to subtract from white.
-
So what are the three colors that are
-
the opposites of the RGB magenta
-
cyan black, the sea of yellow
-
so for us cyan, magenta and yellow inks
-
will get a very wet piece of paper and hope it turns out to be black.
-
So that's why one of the reasons why we add printing we have a black ink so we're not mixing black
-
okay.
-
So one thing we know we can notice here is
-
the line
-
from black to white. So
-
if we reorient the cube
-
from the side we have
-
black and white
-
again, that's a square.
-
suspend your disbelief it's a square so if we go right along what colors will we see if we go for on this line? Like to wait
-
yeah, so.
-
So these are all going to be great. So we go from black to white, and shades of gray.
-
Now when we're very close to black, we could add a bit of color. We could go out this far.
-
Now add some color but it's not gonna be much color. It's gonna be just a very tiny hint.
-
We're up here
-
the widest part and we go at full color
-
that's quite a difference. So I can think of mixing colors going from
-
or tenths and tones
-
so this
-
another picture to show what this cross section looks like.
-
That's the hue that's the color.
-
So we'll see. Red magenta, yellow, cyan, green, and blue
-
so we don't see black or white.
-
At this level, we just see those six colors associated vertices and those around them.
-
This
-
so
-
here being
-
go from white
-
so we're going to use
-
squishes into a calm
-
Hue Saturation and Value
-
so we can decide
-
if we're going to
-
forgot to mix colors we could say
-
we start with
-
a primary color and then we can add in
-
another one
-
we can lower the saturation or decrease the value
-
so this is a bit more intuitive way to manipulate colors
-
okay
-
next I want to show you my latest version.
-
So here I have so I had the color selection there before
-
but I made the menu to select drawing mode
-
so
-
there's one red rectangle
-
the yellow one.
-
Now, remember, in the renderer we say draw arrays and then we give it a mode. So I allowed mode to be selectable here. Not all that makes sense.
-
Points works so you
-
can see the vertices that we've entered
-
line strip kind of works
-
so we're connecting pairs of vertices. So we have four vertices
-
next, these these these so that gets us three lines. So we can do a line loop
-
and that gives us what we want.
-
Not so much
-
so the strip says going
-
to commit connect them in sequence and the lines just say so the connection on between two and three on the left. That I've drawn there isn't happening so it's just drawing the two lines
-
so that
-
triangle strip is not the same as a triangle fan
-
and a strip so.
-
We connect the first three and then we make a triangle from the next three a triangle fan
-
so, we do one triangle the same way but then
-
that make sense so
-
so they look quite similar
-
conceptually they're different. So triangle fan
-
has a central vertex. So we can add more pieces to the fan we can do a circle this way
-
if for drying
-
a strap so this is.
-
So it makes sense the difference
-
triangles are we just getting one triangle out of that?
-
So
-
don't even try this latest version
-
instead of 200 as the maximum number of triangles or a number of rectangles I made at 10
-
So I'm
-
just adding a message like that to the log
-
just to test that feature of the code
-
Okay.
-
Okay, so here
-
we have a rotating cube
-
What do you think? Of that?
-
Let's look at the other
-
so what do you see here?
-
What feature What features do you notice about this cube compared to the other one?
-
Transparency fading maybe
-
it's not transparency it's
-
that's an error.
-
And what's the other thing we can notice? Site is divided Yeah, so we get the sense. So we understand there's a lot the geometry is made. Up of triangles.
-
And that's important emphasis emphasize by the fact that we're using we're assigning colors to vertices. And so the color on the face or on the triangle gets interpolated.
-
Now I just want to
-
look at one more variation here.
-
So have this system have the same error as the other model does.
-
Let's look at
-
the code
-
okay
-
so this is the textbook version
-
so we have the canvas GL is going to be our graphics or WebGL context we're dealing with 36 positions
-
so we're calling function color cube to make our cube and we're using a depth as
-
then we're creating a color buffer and a vertex buffer
-
and we have
-
seen a lot of failed location so that's going to pass our rotation angle and like the 2d versions, we can rotate an x y and Zed
-
so it's going to be a vector
-
so our color cube function makes the six sides of the cube
-
now we're finding vertices. So how many vertices do we need to divide a cube?
-
A Yeah. Because they're really two squares. And it's just a matter of connecting them properly which they did and two out of three cases.
-
So here we have eight vertices from the cube
-
and we have colors
-
so we need to make the face into two triangles
-
so we have
-
variables a, b, c, and d.
-
Doesn't help when I point at my screen. I apologize
-
so we're making triangles ABC an ACD.
-
So in the CS is storing the order of vertices
-
so we're pushing
-
values onto the vertex onto the position into the positions array and then.
-
We're pushing
-
for text color
-
based on just the first index so the coloring based on the first vertex of the face
-
so if we
-
commented out uncomment in that first line here, then we would get a different color per vertex
-
so when we're doing the rotation or the rendering sorry, clear the color bed and the depth buffer bed
-
and we're increasing the angle in the selected axis
-
and then we're doing we're giving the value of theta which is
-
a vector with
-
three positions
-
now control the rotation
-
so we're drawing triangles
-
that
-
meet just
-
quickly our last two minutes here
-
So our vertex shader does a rotation
-
so we get the angles from our uniform value that we're passing in. So you can see above there's a uniform back 3d. Calculate cosine and sine and then we're doing a rotation matrix. We do well, three rotation matrices are x are y our Zed and then we're applying those matrices to the initial position.
-
So the new position
-
is the
-
rotation x y and Zed
-
and the fragment color
-
is the vertex color
-
and the vertex color is from any attribute cause.
-
Does that make sense? So we'll go into a little we'll do some matrix math on Wednesday
-
and I'll have
-
a revised version and I'll fix the hole in the
-
in the cube. Anyway,
-
so we're out of time. So,
-
a summary we're doing transformations here. So we saw a bit
-
a bit of the transformations that are possible and so we'll go
-
from there
-
any questions or concerns?
-
Okay,
-
thank you for today.
-
Thank you for your participation in calling out random numbers
-
wasn't so bad was it? Okay, see you Wednesday. Have a great day.
-
Thanks.
-
Thanks.
Responses
What important concept or perspective did you encounter today?
- The most important thing that I learned is that in assignment session, how can we achive the colors to the triangle.
- Today we discussed about the assignment 1 doubts and then learnt about the spinning cube with different colors.
- using the canvaGL for the graphics
- The assignment is something new, I got to understand the assignment more deeply and got to know how to assign colours.
- From the transcript i learned about the canvagl and also about the assignment
- Today I learned about the 3D rectangular box with the color. I did not know that those color are defined every vertices of a rectangular box.
Was there anything today that was difficult to understand?
Was there anything today about which you would like to know more?
- Different variations in cube and code behind it
- Intresting thing I Learned in this lecture was in depth knowledge of RGB colours. Getting to know about most of the GL functions like line_strip, tirangle,rectangle etc was very informative. I would like to know how the Mid term exam should be and how should we prepare for is effectively.