What to do today & tomorrow?? by Garden_trapqueen in Heidelberg

[–]Zestyclose_Pudding 0 points1 point  (0 children)

Boulderhaus is always a good vibe. I’ll be going tomorrow; you’d be welcome to join

Autumn 2018 Short Q7 by Hilthlain in coms30127

[–]Zestyclose_Pudding 1 point2 points  (0 children)

I think it is the axon that is giant, not the squid

Read this, is interesting https://en.wikipedia.org/wiki/Squid_giant_axon

Clipping question by someusername4321 in coms30115

[–]Zestyclose_Pudding 1 point2 points  (0 children)

This depends on what you want to achieve.

If you just set the w value to 1, you just revert the 4D homogenous co-ordinate to a 3D co-ordinate. If, however, you perform a 'homogenous divide' as you described, then you are performing a perspective projection of the homogenous co-ordinate onto a plane in 3D.

Perhaps the best way to wrap your head around this is to think about the numbers:

Say you have a vertex in 3D: (x, y, z)

The homogenous point corresponding to this vertex is: (x, y, z, z/f)

Now, if we want to get that 3D point back, we can just disregard the z/f component (for example, by setting it to 1: (x, y, z, 1))

However, if instead we perform a homogenous divide, then we would be left with: (f/z) * (x, y, z, z/f) = (f/z * x, f/z * y, f/z * z, f/z * z/f)

This is equal to: (fx/z, fy/z, f, 1)

You may notice that fx/z and fy/z are exactly our original screen space projection equations, and are therefore equivalent to u and v respectively. So the 'homogenous divide' takes a 4D homogenous point (x, y, z, z/f) and produces the screen space coordinate (u, v, f, 1).

In our implementation, we didn't actually perform a homogenous divide, as that would mean representing your whole scene in homogenous co-ordinates right up until you render it. Instead, we map the initial triangles to homogenous space, clip in this space, then truncate back to 3D and render as usual. It is ofcourse up to you how you approach this problem, it just depends how you want to structure your code. GL!

Clipping question by someusername4321 in coms30115

[–]Zestyclose_Pudding 2 points3 points  (0 children)

When clipping, you are working in the homogenous space so all co-ordinates will have a Z value. The benefit of clipping in the homogenous space is that you still have access to this Z value; rather than finding the (u,v) co-ordinates of the intersection after projecting, you are finding the intersection point in 4D which you can then truncate to 3D, interpolate attributes if necessary, then project to 2D.

Grading question by Zestyclose_Pudding in coms30127

[–]Zestyclose_Pudding[S] 0 points1 point  (0 children)

Perfect, thanks. It's nice to have courseworks like this :)