CS479 Lab 2 RDJ

advertisement
Johnson 1
Ryan D. Johnson
CS479
02/13/2012
Lab2 Write-up
1) Lab is called RJ354Game2@0218120331.
2) In the actual Texture.fx and PositionColor.fx, I changed how the VertexShaders and
PixelShaders were declared, as they are now unique variables when dealing with shaders
higher than 1.1. In addition, for both the “ColorEffect” and the “TextureEffect”, I had to
specify the number of techniques used (in this case zero), instead of just having it at
simply “CurrentTechnique” with no parameters.
3) Yes, but it involves looking directly at the Earth, and slightly down at the ground while
very close up. The earth nearly fills the whole screen. This is fairly subjective, as on
higher resolutions or with a different rotation, it would be impossible, whereas on lower
resolutions with a different rotation, it would be crazy easy.
4) Adjusting the variables for each triangle provides different results. With the X variable,
they get fatter, the y variable, they get taller, the Z variable affects rotation, so they end
up with a pretty fast rotation, or a further out rotation. Combing them creates various
visual effects and distortions.
Johnson 2
5) Yes, they can be combined, although it’s kinda superfluous in this case.
earthRotation = (earthRotation + gameTime.ElapsedGameTime.Milliseconds / 1000.0f)
% (2.0f * MathHelper.Pi);
By changing the rate of rotation to 100, it requires that it rotates more within a given
frame of game time due to have a much smaller window of time. It goes much faster at
100. The opposite is true if you up it to 10000. It goes significantly slower.
6) I used the following lines of code in the “Draw Ground” method:
a. Matrix test = Matrix.Identity;
7)
8)
9)
10)
11)
12)
test.M11 = 7.00f;
if (test.Equals(world))
test.M11 = 11.0f;
else
test = world;
I found out through a combination of trial and error, and asking in class. I tried a few
different ways of doing it, but I had very little success until I asked around.
7) Changing the “triangleVertex[X]” declaration under the “Initialize Triangle” method will get
them the same size. In addition, you can change the “scale” variable under the “DrawMoon”
method to cause the moon to change size.
8) Matrices are essentially a vector layout of how things move in space and time. They can be
either a row vector or a column vector, and when used in conjunction with X, Y, and Z
coordinates, they make things move or not move as the case may be.
Download