dilevin / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
2 stars 5 forks source link

How fast should the moon be spinning #17

Closed bod11 closed 5 years ago

bod11 commented 5 years ago

I don't think it mentions this, but the moon in the gifs doesn't seem to match my moon at 1 rotation per second or at 4 rotations per second. I know the moon orbits the earth every 4 seconds, but how fast is the moon supposed to be spinning? Or does this not really matter.

rarora7777 commented 5 years ago

Doesn't really matter. Just choose a reasonable number (slow enough that I can see it, and fast enough that I don't think that you forgot to animate).

umarfarooq96 commented 5 years ago

I think the technically physics-y correct answer is that it should spin at the same rate it rotates. That's how we only see 1 side of the moon, because it's orbit and rotation are synced up.

rarora7777 commented 5 years ago

Oh, I guess I misunderstood your question earlier. Thanks @umarfarooq96 !

Again, we don't really care that the rotation speed matches the revolution speed, but that's the physically correct thing to do. Also, the easiest code to write.

wangshangsam commented 5 years ago

Wait, the moon has to spin?

// Determine the perspective projection (do not conduct division) in homogenous
// coordinates. If is_moon is true, then shrink the model by 30%, shift away
// from the origin by 2 units and rotate around the origin at a frequency of 1
// revolution per 4 seconds.

I thought this means that the moon is rotating around the earth 1 cycle every 4 seconds. I didn't see how this is (or anywhere else is) implying that the moon needs to spin.

rarora7777 commented 5 years ago

First of all, let me restate that the moon spinning or not is not relevant to the assignment and we won't grade based on rotational speed, revolution speed, etc.. We just want to see it revolving around the earth.

Okay, now's let's look at why the moon will spin about its own axis if you do exactly what the instructions ask you to do. First, imagine removing the translation component; you'd see that the moon is spinning about its axis. Now, with the translation added, the moon is still spinning about its axis, just that the rotation and revolution (orbiting) speed are exactly the same. If you want to make it not spin, you'd have to add an extra reverse rotation about its own axis!

If you look at the examples given in the Readme, you can observe that the side of the moon that faces the camera is not fixed.