Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Just to make a decision and a lot to learn to do the, Essays (university) of Computer System Design and Architecture

Us a good weekend I can you give a lot for you guys I was 7

Typology: Essays (university)

2018/2019

Uploaded on 05/18/2019

Gowtham1111111
Gowtham1111111 🇮🇳

6 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
GLfloat vertices[ ]={ -1.0,-1.0,-1.0,
1.0,-1.0,-1.0,
1.0, 1.0,-1.0,
1.0, 1.0,-1.0,
-1.0,-1.0, 1.0,
1.0,-1.0, 1.0,
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0 };
GLfloat normals[ ]={ -1.0,-1.0,-1.0,
1.0,-1.0,-1.0,
1.0, 1.0,-1.0,
-1.0, 1.0,-1.0,
-1.0,-1.0, 1.0,
pf3
pf4
pf5

Partial preview of the text

Download Just to make a decision and a lot to learn to do the and more Essays (university) Computer System Design and Architecture in PDF only on Docsity!

#include <GL/glut.h>#include <stdio.h>

#include <stdlib.h> GLfloat vertices[ ]={ -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0, 1.0,-1.0,1.0, 1.0,-1.0, -1.0,-1.0, 1.0, 1.0,-1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0 }; GLfloat normals[ ]={ -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0, 1.0,-1.0, -1.0, 1.0,-1.0, -1.0,-1.0, 1.0,

GLfloat colors[ ]={0.0,0.0,0.0, 1.0,0.0,0.0, 1.0,1.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0, 1.0,0.0,1.0, 1.0,1.0,1.0, 0.0,1.0,1.0}; GLubyte cubeIndices[]={0,3,2,1, 2,3,7,6, 0,4,7,3,

glutSwapBuffers(); }

void mouse(int btn,int state,int x,int y) { if(btn==GLUT_LEFT_BUTTON && state==GLUT_DOWN)axis=0;if(btn==GLUT_RIGHT_BUTTON && state==GLUT_DOWN) axis=1;if(btn==GLUT_MIDDLE_BUTTON && state==GLUT_DOWN) axis=2;

} void spincube() { theta[axis]+=2.0; if(theta[axis]>360.0) theta[axis]-=360.0; glutPostRedisplay();

void myReshape(int w,int h) { glViewport(0,0,w,h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); if(w<=h) glOrtho(-2.0,2.0,-2.0(GLfloat)h/(GLfloat)w,2.0(GLfloat)h/(GLfloat)w,10.0,10.0); else glMatrixMode(GL_MODELVIEW);glOrtho(-2.0(GLfloat)w/(GLfloat)h,2.0(GLfloat)w/(GLfloat)h,-2.0,2.0,-10.0,10.0); }int main(int argc,char **argv)

{ glutInit(&argc,argv); glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);

glutMainLoop(); }