Presentation is loading. Please wait.

Presentation is loading. Please wait.

LAB #1: Computer Graphics Framework IGX is a set of programs which allow you to write graphics programs in C/C++ from plain text files. Benefits: 1. You.

Similar presentations


Presentation on theme: "LAB #1: Computer Graphics Framework IGX is a set of programs which allow you to write graphics programs in C/C++ from plain text files. Benefits: 1. You."— Presentation transcript:

1 LAB #1: Computer Graphics Framework IGX is a set of programs which allow you to write graphics programs in C/C++ from plain text files. Benefits: 1. You do not need an IDE like visual studio. (Follows the tradition of early programmers) 2. You can write simple or complex programs. 3. You can write graphics program for modern hardware, including CG Shaders for direct GPU programming.

2 Example: void draw3D () { Vector3DF a;// Define a vector a.Set ( 5, 4, 2 );// Set the vector glColor3f ( 1, 0, 0 );// Specify a color to OpenGL glBegin ( GL_LINES );// Start drawing lines glVertex3f ( 0, 0, 0 );// Point A of line glVertex3f ( a.x, a.y, a.z );// Point B of line glEnd (); } This will draw a line from the point 0,0,0 to point 5,4,2.

3 What does the IGX Framework do? The underlying programming language is C/C++. This defines the syntax for variables, functions, and loop The Luna Sandbox is a part of IGX which provides additional objects such as vectors, cameras, and images. Not normally part of OpenGL OpenGL is a part of IGX which does the low-level work of rendering. Commands are sent to the graphics hardware to make an image appear.

4 written in C/C++ calls libraries

5 MinGW – Command line compiler for C/C++ Example of how to run lab02. Notice that IGX starts the ‘gcc’ compiler, which “builds” your program.” The only this you need to do is type “run.”

6 GLUT – Library for simple window management GLUT is a part of your program code which creates a display window for output. In this class, you do not need to change this.

7 GLUT – Library for simple window management GLUT gives you a function where you can write 3D code. You only need to write your labs by creating some additional code. Only the required mini-project involves more programming. Drawing reference grid is done for you.

8 OpenGL – Low-level Graphics API library for rendering commands This is mainly what you will be learning to write. Calling low-level graphics command which draw images. Specifies a color Draws 3 lines, each /w different color, in 3D Your textbook is the main reference for writing OpenGL.

9 LUNA Sandbox – A set of libraries for mathematical objects. OpenGL is primarily for rendering commands. LUNA Sandbox provides additional objects not found in OpenGL. These include: - VectorsVector3DF, Vector4DF - MatricesMatrixF, Matrix4F - 3D Cameras - Images - Meshes - CG Graphics Shaders Example: Camera3D my_camera;// Create a 3D Camera Vector3DF camera_vec;// Create a vector camera_vec = camera.getPos ();// Set the vector to the current position of camera.

10 After you type “run.” you should get this! …. Example from lab #2.

11 Next week.. Your first OpenGL program! Lab #2: How do we draw vectors in 3D? How might we interact with those vectors using the mouse?


Download ppt "LAB #1: Computer Graphics Framework IGX is a set of programs which allow you to write graphics programs in C/C++ from plain text files. Benefits: 1. You."

Similar presentations


Ads by Google