Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this one. For this assignment, you will be filling in missing pieces of code within a program. Extract the OpenGL tutorial

I need help with this one.

image text in transcribedimage text in transcribedimage text in transcribed
For this assignment, you will be filling in missing pieces of code within a program. Extract the OpenGL tutorial (one of many ayailablel from the ModuleBTask2.zip file {in the zip file in Start Here]. After unzipping the folder, open the project by clicking on the .sln (solution) file. Before making any changes, reyiew, compile, and run the program. As you write in your code, be sure to use appropriate comments to describe your work. After you have finished, test the code by compiling it and running the program, then turn in your finished source code. There are two activities to do with this code. First, change the color of the objects {you get to choose the colors). For the triangle, the color is set on the eyen numbered lines from 64 to 86. For the square, lines 94, 99, 104, 109, 114, and 119 contain the color property. Second, change the rotation speed of the objects using lines 126 and 12?. The higher the number, the faster the speed; the lower the number, the slower the speed. #+ Lesson5 (Global Scope) WinMain(HINSTANCE hinstance, HINSTANCE hPrevinstance, LPSTR IpCn . + Tabs # Solution Explorer Lesson5 This Code Was Created By Jeff Molofee 2000 Lesson5.cpp A HUGE Thanks To Fredric Echols For Cleaning Up Search Solution Explorer (Ctrl+;) And Optimizing The Base Code, Making It More Flexible! Log Solution 'Lesson5' (1 of 1 project) If You've Found This Code Useful, Please Let Me Know. Lesson5 Visit My Site At nehe . gamedev . net D-D References External Dependencies #include // Header File For Windows Header Files #include / Header File For The OpenGL32 Library Resource Files #include / Header File For The GLu32 Library Source Files ++ Lesson5.cpp HDC hDC=NULL; // Private GDI Device Context 14 HGLRC hRC=NULL; // Permanent Rendering Context HWND hwnd=NULL; // Holds Our Window Handle HINSTANCE hInstance; Holds The Instance Of The Application 17 boot keys [256] ; // Array Used For The Keyboard Routine bool active=TRUE; Window Active Flag Set To TRUE By Default bool fullscreen=TRUE; Fullscreen Flag Set To Fullscreen Mode By Default GLfloat rtri; // Angle For The Triangle ( NEW ) GLfloat rquad; // Angle For The Quad ( NEW ) 24 25 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM) ; // Declaration For WndProc 26 GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window 28 if (height==0) // Prevent A Divide By Zero By height=1; // Making Height Equal One glViewport(0, 0, width, height) ; // Reset The Current Viewport glMatrixMode(GL_PROJECTION) ; // Select The Projection Matrix glLoadIdentity() ; / Reset The Projection Matrix // Calculate The Aspect Ratio Of The Window gluPerspective(45. of, (GLfloat)width/(GLfloat)height, 0. If, 100. of) ; Solution Explorer Git Changes Properties glMatrixMode(GL_MODELVIEW) ; Select The Modelview Matrix glLoadIdentity() ; // Reset The Modelview Matrix Bint InitGL(GLvoid) // All Setup For OpenGL Goes Here 6 5 6 glShadeModel(GL_SMOOTH) ; Enable Smooth Shading 49 glclearColor(0 . of, 0.of, 0.of, 0.5f); Black Background 50 glClearDepth(1. of); Depth Buffer Setup 51 glEnable(GL_DEPTH_TEST) ; Enables Depth Testing glDepthFunc(GL_LEQUAL) ; The Type Of Depth Testing To Do glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) ; Really Nice Perspective Calculations return TRUE; Initialization Went OK 55 56 57 Bint DrawGLScene(GLvoid) // Here's Where We Do All The Drawing 100% T Ln: 459 Ch: 6 Col: 18 TABS CRLF Output 4X Show output from:IT 312 Fill in the Blank Guidelines and Rubric Overview: In this course, you will be responsible for completing a number of programming-based assignments by filling in the missing pieces of code. Learning to program in C++ requires developing an understanding of general programming concepts and learning the syntax of the C++ programming language. These exercises will build on each other and help you cultivate you programming knowledge. It is recommended that students do not limit their practice to just that which is graded. The more you write your own code, the more proficient you will become with the tools and techniques availableto you in C++. Prompt: Your submission should include your completed source code. The following critical elements should be addressed in your project submission: Code Description: A brief explanation of the code and a brief discussion of any issues that you encountered while completing the exercise. - Functioning Code: A source code must meet its specifications and behave as desired. To develop proper code, you should produoe fully functioning code {produces no errors] that aligns with accompanying annotations. You should write your code in such a way that the submitted filels} actually executes, even if it does not produce, the correct output. You will be given credit for partially correct output that can actually be viewed and seen to be partially correct. 0 Code Results: Properly generated results establishes that your source code: A. Generates accurate output B. Produces results that are streamlined, efficient, and error-free - Annotation} Documentation: All added code should also be well commented.This is a practiced "art" that requires striking a balance between commenting everything, which adds a great deal of unneeded noise to the code, and commenting nothing. Well-annotated code requires you to: A. Explain the purpose of lines or sections of your code detailing the approach and method the programmer took to achieve a specific task in the code B. Document any section of code that is producing errors or incorrect results. - Style and Structure: Part of the lesson to be learned in this course is how to write code that is clearly readable and formatted in an organized manner. To achieve this, you should: A. Develop logically organized code that can be modified and maintained; B. Utilize proper syntax, style, and language conventionslbest practices Guidelines for Submission: For each exercise, your submission is the completed source code le containing functioning code and should start with a header comment containing a title {name, course, date, project number} and your discussion of the code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions

Question

Please help with a and b

Answered: 1 week ago