Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


CS602 Computer Graphics Assignment No 03 Fall 2020 Solution & Discussion

Views: 497

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

CS602-Assignment-3-Solution-Fall-2020

Click on the below link to download the file

CS602-Assignment-3-Solution-Fall-2020.pdf

CS602 Computer Graphics Assignment No 03 Fall 2020 Solution links files

Click on the below link to download the file

CS602-Assignment-No-3-Solution-2021-idea-no-2.pdf

CS602-Assignment-No-3-Solution-2021-idea-no-3.docx

CS602-Assignment-2-Solution-Fall-2020-cpp-file.cpp

Click on the below link to download the file

CS602-Assignment-2-Solution-Fall-2020-cpp-file.cpp

CS602 Assignment 3 Fall 2020 solution idea:

 

Question No: 01

Solution: -

Source Code:-

#include <GL/glew.h> #include <GLFW/glfw3.h> int main()

{

GLFWwindow* window; if (!glfwInit())

{

return -1;

}

window = glfwCreateWindow(400, 300, "BC123456789 Name", NULL, NULL); if (!window)

{

glfwTerminate(); return -1;

}

glfwMakeContextCurrent(window); glViewport(0, 0, 800, 800);

glClearColor(30, 20, 40, 0); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(window);

while (!glfwWindowShouldClose(window))

{

glClearColor(30, 40, 0, 0); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(window); glfwPollEvents();

}

glfwTerminate();

}

Question 01

Source Code (2)

#include<windows.h>

#include <GL/glut.h>

#include<math.h>

#include<stdlib.h>

 

void draw(){

     glClear(GL_COLOR_BUFFER_BIT);

     glColor3f(1.0,1.0,0.0);

     glFlush();

     }

void initialize(){

     glClearColor(1.0, 0.0, 0.0, 1.0); // RED COLOR

     glMatrixMode(GL_PROJECTION);

     glLoadIdentity();

     glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);

     }

int main(int iArgc,char** cppArgv){

     glutInit(&iArgc, cppArgv);

     glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);

     glutInitWindowSize(600, 400);       // WINDOW SIZE

     glutInitWindowPosition(200, 200);

     glutCreateWindow("BC123456789  Nabeel");

     initialize();

     glutDisplayFunc(draw);

     glutMainLoop();

     return EXIT_SUCCESS;

     }

Output Screen Shot

Question No: 02 Solution: -

Nearly everything you may ever do with OpenGL will involve buffers full of data. Buffers in OpenGL are depicted as buffer objects. As with several things in OpenGL, buffer objects are named using GLuint values. Values are stored using the glGenBuffers () command.

Example: void glGenBuffers(GLsizei n, GLuint *buffers);

After calling glGenBuffers(),you will have an array of buffer object names in buffers, but at this time, they’re simply placeholders. They’re not really buffer objects yet. The buffer objects themselves don't seem to be really created till the name is first sure to one of the buffer binding points on the context. this can be important as a result of OpenGL could build choices regarding the most effective way to assign memory for the buffer object based on where it's bound.

Yhi mila mujhy bhi O_o (informit.com)
Jazak Allah Khair <3

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service