OpenGL 代写|CS代写

 ECE 4122 OpenGL lab 代写案例

To create a dynamic 3D graphics application using lighting, shading, model transformations, and keyboard inputs.

Description:

Using the code from tutorial09_Assimp create an application that loads in the suzanne.obj file and creates 4 instances of the head object. Place (rotate) each of the heads so that it faces away from the origin along the +x-axis, -x-axis, +y-axis, and -yaxis. Translate the heads so that the ears of each head just barely touch and the chin of all the heads just touches the z = 0 plane. Place a green rectangle on the z = 0 plane that is sized to just extend past the front of all the heads.

Modify the keyboard inputs so that (5 points each)

  1. 1)  ‘w’ key moves the camera radially closer to the origin.

  2. 2)  ‘s’ key moves the camera radially farther from the origin.

  3. 3)  ‘a’ key rotates the camera to the left maintaining the radial distance from the origin.

  4. 4)  ‘d’ key rotates to camera to the right maintaining the radial distance from the origin.

  5. 5)  The up arrow key radially rotates the camera up.

  6. 6)  The down arrow radially rotates the camera down.

  7. 7)  The ‘L’ key toggles the specular and diffuse components of the light on and off but leaves the ambient component unchanged.

  8. 8)  Pressing the escape key closes the window and exits the program

Points grading:

  • 30 Points – loading obj file and displaying the fours heads and the green z = 0 rectangle

  • 30 Points – rotating and placing the heads in the correct location and orientation

  • 40 Points – keyboard control

  • 5 pts extra credit – place a texture (of your choice) on the z=0 plane rectangle. Make sure to include the bmp file in your submission. 

    Appendix A: Coding Standards

    When using if/for/while statements, make sure you indent 4 spaces for the content inside those. Also make sure that you use spaces to make the code more readable.
    For example:

    for (int i; i < 10; i++)
    

    j = j + i; }

    If you have nested statements, you should use multiple indentions. Each { should be on its own line (like the for loop) If you have else or else if statements after your if statement, they should be on their own line.

    for (int i; i < 10; i++)
    

    {
    if (i < 5)

    {
    counter++;

    k -= i; }

    else

    {

    k +=1; }

    j += i; }

    Camel Case:

    This naming convention has the first letter of the variable be lower case, and the first letter in each new word be capitalized (e.g. firstSecondThird).

    This applies for functions and member functions as well!
    The main exception to this is class names, where the first letter should also be capitalized.

    Variable and Function Names:

    Your variable and function names should be clear about what that variable or function represents. Do not use one letter variables, but use abbreviations when it is appropriate (for example: “imag" instead of “imaginary”). The more descriptive your variable and function names are, the more readable your code will be. This is the idea behind self-documenting code. 

咨询 Alpha 小助手,获取更多课业帮助