DOC PREVIEW
UMD CMSC 427 - Installing/Using OpenGL

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CMSC 427:Fall 2009 Dave MountInstalling/Using OpenGLIntroduction: This document describes a bit about compiling and running OpenGL programs for C/C++on the various platforms around campus. In particular we will consider the following platforms.CSIC Linux Lab: (Located on the third floor of the CSIC building.) If you have your own Linuxsystem, these instructions are applicable, but adjustments may be needed depending on whereyou install the X11, OpenGL, GLU, and GLUT libraries.)PC Windows: Your own PC running Microsoft Windows.OpenGL is a widely used graphics library standard, that is, it is just a specification for a graphicslibrary, which has been implemented by a number of vendors. OpenGL consists of two principalcomponents: GL (basic OpenGL) and GLU (OpenGL utilities). GL is responsible for the basic low-level rendering tasks, and GLU provides support for some higher-level operations, such as drawingcurved surfaces. In addition, it is necessary to use a toolkit for creating windows and handling userinteraction. For C/C++ programming, we will use GLUT (OpenGL utility toolkit).Installing OpenGL/Glut with Visual Studio.NET: The following description assumes that you runningon a PC running Microsoft Windows and have Microsoft Visual Studio.NET. (This does not apply toLinux or Mac’s.) You first need to know the names of the following two directories on your system:hWinDiri : This is your Windows system directory (e.g., C:\WINDOWS).hVCppi : Your visual C++ root directory. For, example,C:\Program Files\Microsoft Visual Studio 2005\VC\PlatformSDKOpenGL is automatically installed on Windows machines. (To verify this, search for opengl32.dlland glu32.dll in your systems directory. You will probably need to install Glut, however. The easiestway to do this is to visit the following two web pages.http://www.xmission.com/˜nate/glut.htmlhttp://pixel.cs.vt.edu/courses/4204/openglsetup.htmlThe first contains precompiled GLUT libraries. (Download the “GLUT for Win32 dll, lib and headerfile” not the “source code distribution”.) The second explains where to put the essential files (glut32.dll,glut32.lib, and glut.h).glut32.dll =⇒ hWinDiri\system32 (or wherever opengl32.dll is)glut32.lib =⇒ hVCppi\libglut.h =⇒ hVCppi\include\GL.The exact directory in which these files are installed is less important than the fact that the system canlocate them. As long as these files are stored in directories that lie on the appropriate environmentvariables, e.g., PATH or INCLUDE, your system should be able to locate them.Now, you should be ready to go. To check that you got it right, download the OpenGL sampleprogram from the class web page, go to the directory VisualStudioNET, double click the solutionfile Sample1.sln, compile, and run it.1Please read the “Readme” files carefully for more detailed instructions on how to construct your ownprograms.CSIC Linux Lab: Compiling the programs involves a bewildering number of options, in order to specifythe location of the OpenGL and GLUT include files, libraries, and the runtime library directories. Theeasiest way to get started is the use the “Makefile” given in the Sample OpenGL program, mentionedabove. Edit the file to see which options can be adjusted. Enter “make” to compile the sampleprogram, after which you should be able to run the resulting executable.Unfortunately, there is no widespread agreement on how the various directories should be configuredon Unix/Linux platforms, and each system administrator makes his/her own choices when installingthings. Commands like “locate” can often be used to help you locate where these files are on anyparticular Unix/Linux system. In case you are interested, in the CSIC Linux Labs the library fileslibGL, libGLU, and libglut are located in /usr/lib. The include files gl.h, glu.h, and glut.h are locatedin /usr/include/GL.Remote Execution: If you have an X-server on your PC at home (e.g., XFree86 or Reflection) you canremotely log into the CSIC labs, compile your program, and run it. The graphics should appearon your PC display. (Hint: before trying this with an untested OpenGL program, try a known X11application (for example, try “gimp”). If that works, then try running your program. If everything isconfigured properly, the graphics should appear on your screen. Beware, it may be quite slow becausethe graphics is being shipped over the network, but it is an option for your initial development anddebugging.2CMSC 427:Fall 2009 Dave MountProgramming Assignment 1: Single-User PongHanded out Thu, Sep 10. The program must be submitted by Tue, Sep 22 (any time up to midnight).Submission instructions will be forthcoming. Here is the late policy: up to six hours late: 5% of the total;up to 24 hours late: 10%, and then 20% for every additional day late.Overview: The goal of this assignment is to learn the basics of OpenGL and GLUT and (hopefully) generatea simple and fun application. The game is a single-user variant of the famous, and now embarrassinglyprimitive, Atari arcade game “Pong”. There is a ball, which bounces around within the window, anda paddle, which the user can move. Your program must implement the following elements.Rotating Ball: The ball should be rendered as a colored object of your choice (square, circle, triangle,etc.) which rotates as it moves. When the ball hits a wall or the paddle it should respond in a“believable” manner. This response will involve both a change of velocity and a change inrotation. (It goes without saying that the ball must be drawn or colored in a manner that makesclear that it is rotating.) Whenever it hits another object obliquely, it will spin in an appropriatemanner—the faster and more oblique the collision, the greater the spin.Paddle: The paddle should be movable, under the user’s control. For example, the paddle can moveup or down when the user hits ‘↑’ or ‘↓’, respectively. You may render it however you like,e.g., as a rectangle. (Putting the paddle under mouse control is also allowable.) It should not bepossible for the user to move the paddle outside the boundary of the playing area.Collision response: The response of your ball to collisions should be reasonably realistic. (It is notnecessary to simulate physics, but the behavior of the ball on collision should not be “unex-pected” or “unbelievable”.)Smooth animation: Use glutIdleFunc() to continuously update the state of your game.Playability: Assuming a


View Full Document

UMD CMSC 427 - Installing/Using OpenGL

Download Installing/Using OpenGL
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Installing/Using OpenGL and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Installing/Using OpenGL 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?