Outline for Today
Theme
Administration
Response to Responses
Response to responses
Today
TODAY
Summary
Summary
For Next Meeting
Wiki
Link to the UR Courses wiki page for this meeting
Media
Transcript
Audio Transcript
-
How's that i
-
Happy Monday you
-
This is 11, number, 23,
-
so suddenly realized There was
no quiz. It occurred to me last
-
night that I had not done that
on Friday. I
-
the assignment who is posted? I
posted that before break, but
-
now I've actually linked it to
you our courses. So if you're
-
looking in your courses for it,
you can click here on the
-
description.
-
Click here for the description,
and it will take you to the
-
description of the assignment.
-
You so they're both programming
and non programming questions.
-
There any questions about the
questions? Yeah, pretty exactly
-
what it says. But like, how do
you determine
-
the highest quality image
without doing extra work. What
-
exactly are you asking for
there? I don't know. I even
-
asked to say anything on the
first question mark. Saw for
-
that. I thought I answered it
well, but terrific, sure.
-
I didn't repeat myself. Did I
miss it? Does have that like
-
the bottom of the questions
thereafter I
-
can be defined transformations.
-
No, I said just not
-
supposed to do. Yeah.
-
So thanks for that. Heads up. I
will
-
clean that up.
-
So the intent of discussion
about how to create a high
-
quality image without doing
extra work, is it
-
supposed to be related to the
gasket? Or was that just like
-
its own separate question?
-
No, it was related to the
gasket. So if we have a stream
-
that's defined against 512 by
512 do if we have US
-
coordinates that go from minus
one to one and
-
so
-
we're dividing the
-
two into 512 we're dividing two
by 512 so the sample, each
-
sample, is assigned that size of
space. So if we make, if we
-
don't generate, so we
-
can say this whole space, what
happens to it under
-
transformations?
-
So we start out with
-
two and then we shrink by one
half and we apply Another
-
transformation, which tricks it
by a half.
-
So is this? So we're getting
-
two to one quarter
-
and so on. So it's was asking
for a discussion about when we
-
could stop how many, how many
levels of recursion do we need
-
to get the size where we
-
Yeah, so the sample relates To
the resolution of the canvas,
-
and Then further random or chaos
game i
-
Well, that's,
-
that's more than 250,000 points.
-
So that's probably a little bit
of overkill. We don't need to
-
generate that many points to
generate a high resolution
-
representation of the gasket and
-
So we can estimate I
-
so 2500 is too Few, but it's up
discussion about how we might I
-
how we might decide what
reasonable number. So the issue
-
here, because it's random, you
don't have the same idea of the
-
precision with the recur
recursive subdivision. So it's
-
it's a simple algorithm to
apply, but it's frustrating
-
because it's random and it's
hard to get precision, precise
-
answers about it. So anyway,
that was the kind of discussion
-
that I was thinking of. Does
that make sense? I
-
so I wanted to talk about major
scenes and
-
I'm viewing
-
less. I also want to say, if you
have some questions about
-
assignment two programming we
I'll have a sound a bit of code
-
to illustrate some of the ideas
I'm Looking for, and we can
-
discuss that on Wednesday. You
-
it so I promised no more Matt on
the board. So I did
-
it with Blake tack. I didn't
plug in the cable. That's why
-
it's not working. You
-
okay, you see that all right,
should I zoom in a bit? I
-
i can see the cursor on the big
monitor that isn't connected to
-
my computer. I
-
so 50th anniversary celebration,
we tried to use the owl camera.
-
But do you know what that is?
It's it looks a bit like an owl.
-
It turns its head 360 degrees to
track who's speaking. Then I got
-
two cursors on my laptop, and
anyway, it was not so great.
-
Sometimes less technology is
better, I think. Anyway, so here
-
we have matrix multiplication.
So we're going to deal with four
-
by four matrices, so I've laid
them out here, and I've labeled
-
the entries in column major
format. So a, one A, one one
-
through a, one four is column
one A, two, one through two,
-
four is column two, column
three, column four and
-
so
-
multiplying The A times B will
give a matrix C and
-
and where we do the
multiplication is we
-
pick a row, not just pick A row,
take the row correspondence. So
-
a one, so c1, one, take row one
from a in column b1,
-
let me say that again. So to
compute the value at the
-
position c1, one,
-
we take row
-
one from matrix A, column one
from matrix B, and we sum them,
-
a, one, One times b1, one A,
two, one times b1, two, A, 231,
-
times b1, three, a, four, one
times b1, four. So here are the
-
rotation matrices around
different axes and
-
so we have rotation around x, y
and z. So here is our example
-
from the other day.
-
Rotate around x by 90 degrees,
rotate around y by minus 90 and
-
rotate around z by 90. So this
is not too complicated, but it's
-
to keep track of the ones and
servers because because cosine
-
of 90 is zero and sine of 90 is
one, because It's all in the y
-
component.
-
So the first step was to combine
and multiply these y and x
-
matrices together.
-
That gives this matrix. And then
this is the rotation around z.
-
So multiply those two together,
-
you get now, that matrix, so
there's no zero columns that I
-
came up with on the board way
back when.
-
Thanks to Corbin for pointing
out my mistake.
-
So then I
-
did something a little
different. Here we took the
-
point we came up with in class
seven to five. So then I
-
I'm going to rotate about that
point. So I
-
so the first step is to
translate that point to the
-
origin. So we write minus seven,
minus two, minus five. That's
-
the translation matrix to bring
our new point for the rotation
-
to the origin, then we apply our
rotation matrix, and then we
-
translate back and it. So this
on the right is the
-
multiplication of these two
matrices, and then we multiply
-
it by the third one to translate
it back. And then you get the
-
final matrix.
-
So you notice that the rotation
is still the same.
-
The upper three by three, the
left upper three by three
-
portion is the same, but the but
the translations are different.
-
So how can I check that I've
gotten to write that I haven't
-
made another mistake in my late
tech I
-
I'm not talking about writing
latex, just to be clear, does
-
anyone use latex For document
processing? Yeah, it's quite
-
nice, I think I
-
so if we're rotating about the
point 725, and
-
what Should that point map to
under the transformation?
-
Yes, I'm going to resist doing
math on The board. Let's try if
-
so okay. I sun, Okay, I'll
-
stop trying to understand why I
can't see a curse on my laptop.
-
So, 7250,
-
times, seven, zero times two,
five times one and
-
And two times, one let
-
me try that again.
-
00, five times one plus two
times one. So the first entry is
-
zero is seven part of me,
-
then we have
-
zero minus two, zero plus four.
So that gives us plus two, and
-
then 700
-
minus two. That gives us five,
so 725, and
-
is a fixed point under that
transformation. So wherever we
-
center the rotation and scaling
and cheer, that'll be the fixed
-
point of The transformation you
-
Does that seem okay? I
-
so the nice thing is that we can
do everything by multiplying
-
matrices together And
-
sorry, I'm having the same
problem. I did
-
the october 11 event and
-
so when we're Talking about
viewing with the computer,
-
we have to position the camera,
select a lens for the camera,
-
which means a projection matrix,
and we need to set the view
-
volume for clipping.
-
So that just means that
-
we we
-
we determine what's visible. We
-
so the default projection is
orthogonal, and that's what
-
we're using in our examples for
2d and for early ones in 3d
-
if we specify objects outside of
the view volume, they'll be
-
clipped out so we won't see
them.
-
So we can reposition the camera.
It's more it's originally at z
-
equals zero.
-
We can
-
move it back so we can see More
objects and so
-
we
-
translate by some distance and
-
so here's the effect of the
translation,
-
and we can move the Camera to
any desired position by sequence
-
of rotations and translations.
So if we were in the side view,
-
we could rotate by 90 degrees
and Then apply the translation
-
to move the camera
-
away. I
-
so it says, Remember the last
transformation specified is the
-
first to be applied. I
-
so that means so we're
Multiplying the matrices
-
together to get The
-
So
-
multiplying them.
-
So remember, we did a
multiplication like this first
-
so we could start with identity,
and then
-
apply rotation matrix X, about
X, rotation matrix For the
-
rotation about y, and then
rotation about said.
-
So the way To do This Is The
-
that makes sense. So
-
we talked a little bit about the
look at the look At function or
-
approach to specifying the
counter position i,
-
so we have the camera and a
position that We look at.
-
We have a camera at a position
that's where I
-
looks out of the scene, so that
we need something to look at. So
-
so that gives us one dimension
of the vehicle. Coordinates i
-
right? So what else do we need
to specify our other two
-
dimensions, other two.
-
Other two vectors are coordinate
basis you
-
the camera could be We
-
have a suspected orientation for
the Camera. How could we do
-
that? I
-
so what if I'm taking a picture
like this of
-
the landscape orientation,
-
if I want to do I want To do a
-
core object or something in
between, I
-
we need to pick a direction.
Here you
-
so we specify the view out right
here, Like
-
and how can we Get
-
the third axis and
-
when should the third axis be in
relation to These two axes? Why
-
can
-
that's take a
-
minute today. What property does
the third axis have in relation
-
to the other two that are here?
Yeah. Does that make sense?
-
Yeah.
-
It so we can find a
perpendicular vector by doing
-
the cross product of the vector
from the eye point to the look
-
point and the left vector does
that.
-
Makes sense? Maybe?
-
So when we're doing
-
by default, we give them
-
orthogonal projections. So that
means that the ones that are in
-
the view volume are clipping
coordinates x and y are
-
preserved, but the projected
value of z is zero, because
-
that's we're removing the Z, the
depth information.
-
So this is a matrix that we
could use to do that. Notice
-
that it's the identity matrix
less than one for z,
-
so
-
that force is said to be zero.
So he makes a note. In practice,
-
you could use that any matrix of
n, set z equal to zero,
-
center of projection for a
simple perspective projection,
-
the center is at the origin, and
the projection plane is at z
-
equal to D, with D greater d
less than zero, because positive
-
z is coming out of the screen in
our right hand, fourth system.
-
So negative z will be into The
screen, into our model and
-
it. So here we have a top and a
side view. So this we're looking
-
down the y axis here, so we have
x and z. So the point at x, said
-
is going to be mapped to the
point
-
XP, at distance d,
-
so looking down the x axis, you
see that the y projected point
-
is going to be At that this is
D. So we can calculate x, p is
-
equal to x over z divided by d
and y, p is y divided by z over
-
d and z p equals d and
-
so the projection is,
-
we have The one over d term in
the bottom row the matrix. So we
-
get,
-
we get that perspective division
and
-
so here's the view volume for an
orthogonal viewing. Specify the
-
left, the right, at the bottom,
The top and the near and far and
-
so then we can also, here's an
example with the Perspective
-
view volume. That's a few
frustum, frustum and
-
so it comes to a plane at the
eye point, and then we have near
-
and far planes as well.
-
So we can specify left, bottom,
left,
-
right, bottom, top, near and
far. We can also specify a field
-
of view and An aspect ratio and
and an aspect ratio. I
-
Ah, so this is a perspective
view volume.
-
So we can change The field of
view and
-
and if we modify the Near
-
So, you can see if we
-
don't set the near and far to
include the models that we want
-
to see will get
-
clipped and
-
and then we can also change the
zip position of The model. We
-
so this is the one Daryl point
out
-
so we can Change the near The
-
so just to show you the shaders.
The vertex shader is
-
we're taking the model view
projection, model view matrix
-
and a projection matrix from
that are specified in the
-
JavaScript file. So we're taking
the attribute position,
-
multiplying it pre multiplying
it by the model V matrix, and
-
then pre multiplying that by the
projection matrix, so that these
-
are uniform variables and so
they're not changing with the
-
attributes, and then The
fragment shader is just Passing
-
through the color and
-
so here we get we set up the
Matrix Model view matrix
-
location and the projection
Matrix location.
-
We have the callbacks we're
-
so these are functions in the MV
new.js file. So we specify we
-
get the i vector and
-
from the radius and the theta
and the phi angles and
-
I'm just looking for where they
specified. Oh, okay, so here the
-
app, it's looking at the origin
and and the up is the y
-
direction, so not To pretty
straightforward there. And
-
so here's the function to
generate the viewing coordinates
-
Based on the eye position the at
Looking at and the up vector.
-
So v is normalized vector that
goes from the look at position
-
to the eye position that's v n
is
-
the view direction vector cross
with the up vector. And then u
-
is the cross between the
-
so n is the normal vector to the
plane defined by the up and the
-
view vectors, And then u is the
cross between N and V. So we
-
have the view vector the normal
to the plane that's
-
perpendicular
-
to the
-
viewing surface. And
-
so that gives us our three
vectors, and then so to return
-
and n. So this is the column
major format. So n is the first
-
column and Then last entry, Not
column Is I
-
so the look at function creates
the transformation matrix that
-
takes us From the object
coordinates To the camera
-
coordinates and
-
so we'll get into more details
the matrices for viewing next
-
day. I
-
and we'll also have a discussion
about what the midterm should
-
look like, and I'll solicit Your
input for that. I
-
any questions or concerns I
-
so I think I have a feeling the
software that I downloaded has
-
messed up my because the cursor
on the big screen is a different
-
location than it is on my
laptop, so maybe I'll have to
-
anyway, not that you care about
that. Thank you for your time
-
today. Have a good rest of your
day and see you on Wednesday.
-
Take care.
-
Take care.
Responses
No Responses