Lighting a Pyramid
Part 1: Lighting a Pyramid
Overview
In this course, many assignments are paired with tutorials to help you to learn OpenGL and build the computer graphics skills that you will need to successfully complete your coding and design work.
In this assignment, you will create commented code for lighting a 3D scene with a pyramid in modern OpenGL.
If you encounter any challenges while completing this assignment, be sure to post your questions or issues to the General Questions discussion. It is essential to ask for help when you need it and successfully complete each activity, as the course will continue to build on earlier learning as your skills progress.
Prompt
Before you begin, be sure to review the module resources for this week’s topics. Then, if you have not done so already, navigate to the CS 330 folderin GitHub. From there, download the ZIP file containing all of the items within this folder, including assignment tutorials for Module Two through Module Six. There are two essential parts to these tutorials: the markdown (MD) files that walk you through how to work with different OpenGL capabilities, and the solution (SLN) file that contains all the code for each section of the tutorials. On your own machine, open the solution (SLN) file in Visual Studio and navigate to the Module Six tutorial sections in the Solution Explorer. While you may open the markdown (MD) file using an external text-based program, we recommend you instead follow along with the Module Six Tutorial in GitHub so it is easier to review the different sections, code, and supporting images. Going through all the sections in the tutorial and attempting the embedded exercises will help you practice the skills you will need to demonstrate in this assignment.
Once you understand the content in the tutorial, you will begin this assignment by opening a new Visual Studio project that has all the libraries set up correctly (which you learned how to do in a previous module). The goal of this assignment is to write commented modern OpenGL code to light a 3D scene with a pyramid. You may begin by using the textured pyramid you created in the Module Five assignment as a base to which you can add light.
Create two lights and place them at different angles relative to your completed pyramid. Give the key light an intensity of 100% and the fill light an intensity of 10%. Then, apply a greenish color to the key light.
Specifically, you must address the following rubric criteria:
- Create code to address the required functionality. The work you complete in OpenGL must meet the required functionality and visual representation that are outlined for this particular topic. Achieving this result may require multiple attempts or the application of programming strategies, but that is okay! Working in iterations is an important part of any coding project. You may also wish to refer back to relevant sections of this week’s tutorial for further guidance or review.
- Apply logic and proper syntax to code. Source code should be free of logical or syntax errors that prevent the application from running as expected. You will be given credit for code that is well on its way to meeting specifications or solving the problem.
- Apply commenting and formatting standards to facilitate understanding of the code. All code should be well commented. This is a practiced art that requires clarity and concision. Your comments should explain the purpose of lines or sections of the code and may also include the method you used to achieve a specific task in the code. Be sure to document any sections of code that are producing errors or incorrect results. Also, all code should be organized to meet formatting standards.
Guidelines for Submission
Submit a completed ZIP folder with all of your code, which may include one or multiple CPP files along with Visual Studio project files. Also make sure the ZIP folder includes an EXE file, because without this your code will not be able to run. Checking for the EXE can be used as a quick reference on the functionality of your code before you submit.
__________________________________________________________________________________________________
Part 2: Lighting Complex Objects
Overview
This week you will be continuing to work on the 3D scene you already began to build, based on the 2D image you selected. Now it is time to incorporate lighting to create a more polished scene that includes all the necessary elements that will comprise your finalized world.
Prompt
You will complete your work in Visual Studio, being sure to work from the project file you already created in a previous milestone. This file already has the libraries set up correctly and contains the 3D object you built, the camera navigation you applied, and the texture you added. All of these components will be necessary for you to add to this week.
Specifically, you must address the following rubric criteria:
- Apply light to a 3D scene. Add a light source of any type and color of your choosing, being sure to select options that make sense with the world you are creating. Your objects need to be made clearly visible by how the light source is positioned in the scene. Incorporate a secondary light source if it is necessary to fully display the scene; nothing should be in complete shadow. Keep the Phong lighting model in mind as you work. It will also be useful to think about directional lights, point lights, and spotlights to determine what would be an appropriate inclusion for your scene. (Hint: Review the Light Casters section of this week’s reading for additional support).
- Apply shaders that reflect light off a plane. Adding shaders to the texture on the plane in your scene will enable you to reflect light off its surface. Note that it will be important to add texture to this object, if you have not done so already, so you can complete the lighting process.
- Apply shaders that display the texture of a complex object. Working with the object you created from two or more 3D shapes, apply the appropriate shader to each shape that comprises the object overall. It is not expected that you will be able to reflect light from these shapes, owing both to their complexity and the shaders we are working with. However, the overall display should still be aesthetically pleasing, even if it is not completely true to life in its accuracy of appearance.
- Create code that follows a logical flow without syntax errors. The code you create has to be executable and all the code that is included needs to be reached by the execution. Note that not everything should be written in a single function and your work should be well-modularized.
- Apply coding best practices in your creations. Pay particular attention to the way you format and comment your code. Program code should be easy to read and follow industry standard code formatting practices, such as indentation and spacing. Commenting best practices should be in place to ensure the code is briefly and clearly explained using descriptive comments.
Guidelines for Submission
Submit a completed ZIP folder with all of your code, which may include one or multiple CPP files along with Visual Studio project files. Also make sure the ZIP folder includes an EXE file, because without this your code will not be able to run. Checking for the EXE can be used as a quick reference on the functionality of your code before you submit.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.