Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Program to implement the midpoint displacement, we will expand on it and

ID: 3592780 • Letter: W

Question

Write a Program to implement the midpoint displacement, we will expand on it and this program uses an algorithm to generate a surface and then modify the shaders to display the surface from different viewpoints. The list of commands given are:

N -- view from the north. Position = (0.0, 5.0, -10.0)

S -- view from south. Position = (0.0, 5.0, 10.0)

E -- view from east. Position = (10.0, 5.0, 0.0)

W -- view from west. Position = (-10.0, 5.0, 0.0)

A -- view from above. Position = (0.0, 11.0, 0.0)

B -- view from below. Position = (0.0, -11.0, 0.0)

It should do depth testing to handle hidden surfaces in a proper manner. The value for (H) should be the input.

The normal equation for the displacement is:

Displacement = GaussianRV (0,1) * 1/2^2*H*(i-1)

Where (I) is the iteration number (starts at 1) and (H) is the Hurst exponent (between 1.0 and 2.0)

Explanation / Answer

srand(time(NULL)); const int lineLength = 65; float range = 1.0; float displacedLine[lineLength]; for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote