Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

3D Object and Industry Standard Code Formatting Practices Project

3D Object and Industry Standard Code Formatting Practices Project

Question Description

I’m working on a Computer Science exercise and need support.

Create a complex 3D object using at least two primitive shapes. The object you create should be reflective of one object from your 2D scene. At this stage of your object’s creation, you should add different colors to each vertex of the object. This will help you better visualize the variance between the different parts of the shapes you are creating. Note that the code you already have uses rainbow colors on the shapes that are provided; if you use this code you may keep that rainbow format. Remember, the shapes you may wish to use are as follows:CubeCylinderPlanePyramidSphereTorus

Apply transformations so shapes are scaled, rotated, and translated (placed) correctly. This work should be relevant for the 2D reference image. For example, if you are working with a cylinder, should it be standing up or lying on its side, based on the image you are referencing? If you are also creating a cube, where should it be placed relative to the cylinder? What sizes are the two objects when compared to each other? It will be easier if you complete these transformations in the right order for your specific object. In general, you will wish to first scale, then rotate, and then translate. While this is not always the case, that is the most likely order for your process to follow.Create code that follows a logical flow without syntax errors. The code you create needs to be executable and all the code that is included will have 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 source code is briefly and clearly explained using descriptive comments.

3D OBJECT TO RECREATE IS A SALT SHAKER (CUBE WITH CYLINDER ON TOP). I included the code to create a cube to help.

Ensure proper libraries (glew.lib and glfw3.lib) are used. Do not use FreeGlut.

Needed ASAP!!

#include <iostream> // cout, cerr#include <cstdlib> // EXIT_FAILURE#include <GL/glew.h> // GLEW library#include <GLFW/glfw3.h> // GLFW library // GLM Math Header inclusions#include <glm/glm.hpp>#include <glm/gtx/transform.hpp>#include <glm/gtc/type_ptr.hpp> using namespace std; // Standard namespace /*Shader program Macro*/#ifndef GLSL#define GLSL(Version, Source) “#version ” #Version ” core n” #Source#endif // Unnamed namespacenamespace{const char* const WINDOW_TITLE = “Tutorial 3.5”; // Macro for window title // Variables for window width and heightconst int WINDOW_WIDTH = 800;const int WINDOW_HEIGHT = 600; // Stores the GL data relative to a given meshstruct GLMesh{ GLuint vao; // Handle for the vertex array object GLuint vbos[2]; // Handles for the vertex buffer objects GLuint nIndices; // Number of indices of the mesh}; // Main GLFW windowGLFWwindow* gWindow = nullptr;// Triangle mesh dataGLMesh gMesh;// Shader programGLuint gProgramId;} /* User-defined Function prototypes to: * initialize the program, set the window size, * redraw graphics on the window when resized, * and render graphics on the screen */bool UInitialize(int, char*[], GLFWwindow** window);void UResizeWindow(GLFWwindow* window, int width, int height);void UProcessInput(GLFWwindow* window);void UCreateMesh(GLMesh &mesh);void UDestroyMesh(GLMesh &mesh);void URender();bool UCreateShaderProgram(const char* vtxShaderSource, const char* fragShaderSource, GLuint &programId);void UDestroyShaderProgram(GLuint programId); /* Vertex Shader Source Code*/const GLchar * vertexShaderSource = GLSL(440, layout (location = 0) in vec3 position; // Vertex data from Vertex Attrib Pointer 0 layout (location = 1) in vec4 color; // Color data from Vertex Attrib Pointer 1 out vec4 vertexColor; // variable to transfer color data to the fragment shader //Global variables for the transform matrices uniform mat4 model; uniform mat4 view; uniform mat4 projection; void main() { gl_Position = projection * view * model * vec4(position, 1.0f); // transforms vertices to clip coordinates vertexColor = color; // references incoming color data }); /* Fragment Shader Source Code*/const GLchar * fragmentShaderSource = GLSL(440, in vec4 vertexColor; // Variable to hold incoming color data from vertex shader out vec4 fragmentColor; void main() { fragmentColor = vec4(vertexColor); }); int main(int argc, char* argv[]){ if (!UInitialize(argc, argv, &gWindow)) return EXIT_FAILURE; // Create the mesh UCreateMesh(gMesh); // Calls the function to create the Vertex Buffer Object // Create the shader program if (!UCreateShaderProgram(vertexShaderSource, fragmentShaderSource, gProgramId)) return EXIT_FAILURE; // Sets the background color of the window to black (it will be implicitely used by glClear) glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // render loop // ———– while (!glfwWindowShouldClose(gWindow)) { // input // —– UProcessInput(gWindow); // Render this frame URender();

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Class Pro only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Class Pro are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Class Pro is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Class Pro, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.