1 / 11

LAB #1: Computer Graphics Framework

LAB #1: Computer Graphics Framework.

nelson
Télécharger la présentation

LAB #1: Computer Graphics Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. calls libraries written in C/C++

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

  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. Drawing reference grid is done for you. You only need to write your labs by creating some additional code.Only the required mini-projectinvolves more programming.

  8. OpenGL – Low-level Graphics API library for rendering commands Specifies a color Draws 3 lines, each /w different color, in 3D This is mainly what you will be learning to write.Calling low-level graphics command which draw images. 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: - Vectors Vector3DF, Vector4DF - Matrices MatrixF, Matrix4F - 3D Cameras - Images - Meshes - CG Graphics Shaders Example: Camera3D my_camera; // Create a 3D CameraVector3DF camera_vec; // Create a vectorcamera_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?

More Related