CS130, Computer Graphics Lab
CS130 , Lectures |
Quiz 2: Thursday, May 3, on Chapter 5
Quiz Solutions
CS130 , Lab Schedule |
TA | Labs | Office Hours |
Yong Cao | W: 6-9, A255 | Bourns A261 M: 4-5:30, W: 2-3 |
Dimitris Papadopoulos | W: 6-9 , A265 | Bourns A261, M,T,R: 1-2 |
Michalis Vlachos | T, R: 8-11, A255 | Bourns B230, T,R: 11-12:30 |
Compilation |
Under Windows
- download opengl (silicon graphics) and/or glut
- follow these instructions
Under Linux
- download glut.h and put it in the same
directory with your opengl file
- type at the prompt:
export LD_LIBRARY_PATH=/usr/local/pkgs/mesagl/lib
export
LD_LIBRARY_PATH=/usr/X11R6/lib
- compile with:
gcc -lGL -lGLU -lglut [filename.c]
Note:
The above settings have been
tested on hill only, so if they don't work on your computer logon to hill (ssh
hill)
and do the compilation there.
If you also need to execute it from hill, you need to export the display to your
computer. You can do this like:
>> export DISPLAY=name_of_your_computer:0
Under Cygwin
- Install
Cygwin. Also install
"OpenGL" under Category->Graphics package list, as well as "gcc" and "make" in
Category->Development.
- After installation, at cygwin shell, issue the following commands:
cd /usr/X11R6/lib/
mkdir old
mv libGL.a libGLU.a old
ln -s /lib/w32api/libopengl32.a libGL.a
ln -s /lib/w32api/libglu32.a libGLU.a
ln -s /lib/w32api/libglut32.a libGLUT.a
When there is a problem compiling, make sure the location of glut.h is specified properly.
Assigments |
Assignment 1 & 2 (ps and pdf), updated-check it... (part 1 Sol.)
Sample Programs |
Tutors for Opengl (experiment with lights, projection etc)
Using Lights & Textures Example (opengl lights tutorial)
Glui (creating control windows)
Putting Text in your Window
Creating SubWindows in Opengl
Catching multiple Pressed buttons
!new!
1. You will need the new glut 3.7 libraries. Get them from here.
2. Use glutKeyboardUpFunc & glutSpecialUpFunc functions to capture when the keys are released.
3. You can find a simple example here.
Ideas for Final Project |
Using Sound Effects (under
windows only)
1. #include <windows.h>
2. Use the command: PlaySound(char *filename, NULL, SND_FILENAME &&
SND_ASYNC)
e.g. PlaySound("start.wav",NULL,
SND_FILENAME && SND_ASYNC)
Using 3D Object Models
1. You can convert 3d models into opengl cpp code (polygons)
2. There are several utilities to do so. One is "3D
Exploration".
3. Possibly you need to reduce the number of polygons of your 3D model in
order to achieve better speed in your opengl program.
One such program is "ProgMesh".
Useful Links |