This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lab assignment | |
// Triangles Pattern | |
// Also included is Varying Sizes. | |
#include <windows.h> // for MS Windows | |
#include <GL/glut.h> // GLUT, include glu.h and gl.h | |
#include <GL/gl.h> | |
/* Initialize OpenGL Graphics */ | |
void initGL(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lab assignment | |
// f (x) = e ^ -x cos (2 pi x) | |
#include <windows.h> // for MS Windows | |
#include <GL/glut.h> // GLUT, include glu.h and gl.h | |
#include <GL/gl.h> | |
#include <cmath> | |
#include <math.h> | |
/* Initialize OpenGL Graphics */ | |
GLdouble special (GLdouble x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Drawing the curve y = x ^ 2 in OpenGL | |
* x ranges from (-10) to 10 | |
* It's made to fit the entire Viewport | |
*/ | |
#include <windows.h> // for MS Windows | |
#include <GL/glut.h> // GLUT, include glu.h and gl.h | |
#include <GL/gl.h> | |
/* Initialize OpenGL Graphics */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Code Below is used to develop a Diamond Pattern. | |
1. Start with Identifying the First Diamond | |
2. Put in the coordinates for the First Diamind | |
3. Create a for-loop to to create diamonds at the same time | |
4. Introduce an outer for-loop to cater for the y - axis. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Code Below is used to develop a Checker Board Pattern. | |
1. Start with Identifying the First Square | |
2. Put in the coordinates for the First Square | |
3. Create a for-loop to to create squares at the same time | |
4. Introduce a variable to help keep track of the color. Using an IF Statement. | |
5. Introduce an outer for-loop to cater for the y - axis. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i,n; | |
//float arr[100]; | |
cout << "Enter total number of elements (1 to 100)"<< endl; | |
cin >> n; |
NewerOlder