SlideShare a Scribd company logo
1 of 42
Introduction to OpenGL


     TA: Mani Thomas
      CISC 440/640
      mani@udel.edu
Acknowledgements
   Most of the material for the slides were
    adapted from
    •   E. Angel, “Interactive Computer Graphics”, 4th edition
   Some of the slides were taken from
    •   CISC 440/640 Computer Graphics (Spring 2005)
   Some of the images were taken from
    •   F.S.Hill, “Computer Graphics using OpenGL”
   Other resources
    •   http://www.lighthouse3d.com/opengl/glut/
    •   Jackie Neider, Tom Davis, and Mason Woo, “The
        OpenGL Programming Guide” (The Red Book)
The Programmer’s Interface
 Programmer  sees the graphics system
 through a software interface: the
 Application Programmer Interface (API)
API Contents
   Functions that specify what we need to form
    an image
    •   Objects
    •   Viewer
    •   Light Source(s)
    •   Materials
   Other information
    •   Input from devices such as mouse and keyboard
    •   Capabilities of system
History of OpenGL
 SiliconGraphics (SGI) revolutionized the
  graphics workstation by implementing
  the pipeline in hardware (1982)
 To access the system, application
  programmers used a library called GL
 With GL, it was relatively simple to
  program three dimensional interactive
  applications
OpenGL: What is It?
 Thesuccess of GL lead to OpenGL
 (1992), a platform-independent API that
 was
  • Easy to use
  • Close enough to the hardware to get excellent
      performance
  •   Focus on rendering
  •   Omitted windowing and input to avoid window
      system dependencies
OpenGL Evolution
 Controlled
          by an Architectural Review
 Board (ARB)
  • Members include SGI, Microsoft, Nvidia, HP,
      3DLabs, IBM,…….
  •   Relatively stable (present version 2.0)
       • Evolution reflects new hardware capabilities
          • 3D texture mapping and texture objects
          • Vertex programs
  • Allows for platform specific features through
      extensions
OpenGL Libraries
   GL (Graphics Library): Library of 2-D, 3-D
    drawing primitives and operations
    •   API for 3-D hardware acceleration
 GLU (GL Utilities): Miscellaneous functions
  dealing with camera set-up and higher-level
  shape descriptions
 GLUT (GL Utility Toolkit): Window-system
  independent toolkit with numerous utility
  functions, mostly dealing with user interface
Software Organization

                  application program

    OpenGL Motif
   widget or similar     GLUT
              GLX, AGL
               or WGL             GLU

  X, Win32, Mac O/S                     GL

              software and/or hardware
Lack of Object Orientation
 OpenGL   is not object oriented so that
 there are multiple functions for a given
 logical function
  •glVertex3f
  •glVertex2i
  •glVertex3dv
 Underlying storage mode is the same
 Easy to create overloaded functions in
  C++ but issue is efficiency
OpenGL function format
                        function name
                                           dimensions

                glVertex3f(x,y,z)

                                  x,y,z are floats
belongs to GL library



         glVertex3fv(p)

                              p is a pointer to an array
simple.c
#include <GL/glut.h>
void mydisplay(){
   glClear(GL_COLOR_BUFFER_BIT);
   glBegin(GL_POLYGON);
       glVertex2f(-0.5, -0.5);
       glVertex2f(-0.5, 0.5);
       glVertex2f(0.5, 0.5);
       glVertex2f(0.5, -0.5);
   glEnd();
   glFlush();
}
int main(int argc, char** argv){
   glutCreateWindow("simple");
   glutDisplayFunc(mydisplay);
   glutMainLoop();
}
Event Loop
 Note that the program defines a display
 callback function named mydisplay
  • Every glut program must have a display
      callback
  •   The display callback is executed whenever
      OpenGL decides the display must be
      refreshed, for example when the window is
      opened
  •   The main function ends with the program
      entering an event loop
Default parameters
 simple.c    is too simple
 Makes heavy use of state variable
  default values for
  • Viewing
  • Colors
  • Window parameters
OpenGL Camera
   Right-handed system
   From point of view of
    camera looking out into
    scene:
    •   OpenGL places a camera at
        the origin in object space
        pointing in the negative z
        direction
   Positive rotations are
    counterclockwise around
    axis of rotation
Coordinate Systems
   The units in glVertex are
    determined by the application and
    are called object or problem
    coordinates
   The viewing specifications are
    also in object coordinates and it is
    the size of the viewing volume
    that determines what will appear
    in the image
   Internally, OpenGL will convert to
    camera (eye) coordinates and
    later to screen coordinates
Transformations in OpenGl
 Modeling   transformation
  • Refer to the transformation of models (i.e., the
    scenes, or objects)
 Viewing   transformation
  • Refer to the transformation on the camera
 Projection   transformation
  • Refer to the transformation from scene to
    image
Model/View Transformations
   Model-view transformations are usually
    visualized as a single entity
    •   Before applying modeling or viewing transformations,
        need to set     glMatrixMode(GL_MODELVIEW)
    •   Modeling transforms the object
         • Translation:         glTranslate(x,y,z)
         • Scale:               glScale(sx,sy,sz)
         • Rotation:            glRotate(theta, x,y,z)
    •   Viewing transfers the object into camera coordinates
         • gluLookAt (eyeX, eyeY, eyeZ, centerX, centerY,
           centerZ, upX, upY, upZ)
Model/View transformation




          Courtesy: Neider, Davis and Woo, “The OpenGL Programming Guide”
Projection Transformation
 Transformation
               of the 3D scene into the
 2D rendered image plane
  • Before applying projection transformations,
      need to set glMatrixMode(GL_PROJECTION)
  •   Orthographic projection
       • glOrtho(left, right, bottom, top, near, far)
  • Perspective projection
       • glFrustum (left, right, bottom, top, near, far)
Projection Transformation

                               Orthographic projection




Perspective projection




                         F.S.Hill, “Computer Graphics using OpenGL”
Program Structure
   Most OpenGL programs have the following
    structure
    • main():
         • defines the callback functions
         • opens one or more windows with the required properties
         • enters event loop (last executable statement)
    • init(): sets the state variables
         • Viewing
         • Attributes
    •   callbacks
         • Display function
         • Input and window functions
simple.c revisited
#include <GL/glut.h>             includes gl.h
int main(int argc, char** argv)
{
   glutInit(&argc,argv);
   glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
   glutInitWindowSize(500,500);
   glutInitWindowPosition(0,0);
   glutCreateWindow("simple");     define window     properties
   glutDisplayFunc(mydisplay);

    init();                               display callback
    glutMainLoop();    set OpenGL state
}
                             enter event loop
GLUT functions
   glutInit allows application to get command line
    arguments and initializes system
   gluInitDisplayMode requests properties for the
    window (the rendering context)
    •   RGB color
    •   Single buffering
    •   Properties logically ORed together
   glutWindowSize in pixels
   glutWindowPosition from top-left corner of display
   glutCreateWindow create window with title “simple”
   glutDisplayFunc display callback
   glutMainLoop enter infinite event loop
Window Initialization
                                black clear color
void init()
{                                           opaque window
   glClearColor (0.0, 0.0, 0.0, 1.0);
    glColor3f(1.0, 1.0, 1.0);         fill/draw with white
    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
}


                                viewing volume
Display callback function
void mydisplay()
{
   glClear(GL_COLOR_BUFFER_BIT);

    glBegin(GL_POLYGON);
        glVertex2f(-0.5, -0.5);
        glVertex2f(-0.5, 0.5);
        glVertex2f(0.5, 0.5);
        glVertex2f(0.5, -0.5);
    glEnd();

    glFlush();
}
Input and Interaction
   Multiple input devices, each of which can send a
    trigger to the operating system at an arbitrary time by a
    user
    •   Button on mouse
    •   Pressing or releasing a key
   Each trigger generates an event whose measure is put
    in an event queue which can be examined by the user
    program
Callbacks
 Programming   interface for event-driven
  input
 Define a callback function for each type
  of event the graphics system recognizes
 This user-supplied function is executed
  when the event occurs
                             mouse callback function
  • GLUT example: glutMouseFunc(mymouse)
GLUT event loop
   Last line in main.c for a program using GLUT is the
    infinite event loop
     glutMainLoop();
   In each pass through the event loop, GLUT
    •   looks at the events in the queue
    •   for each event in the queue, GLUT executes the
        appropriate callback function if one is defined
    •   if no callback is defined for the event, the event is ignored
   In main.c
    • glutDisplayFunc(mydisplay) identifies the function to
        be executed
    •   Every GLUT program must have a display callback
Posting redisplays
   Many events may invoke the display callback
    function
    •   Can lead to multiple executions of the display callback on a
        single pass through the event loop
 We can avoid this problem by instead using
     glutPostRedisplay();
 which sets a flag.
 GLUT checks to see if the flag is set at the end of the
  event loop
    •   If set then the display callback function is executed
Double Buffering
   Instead of one color buffer, we use two
    •   Front Buffer: one that is displayed but not written to
    •   Back Buffer: one that is written to but not displayed
   Program then requests a double buffer in main.c
    • glutInitDisplayMode(GL_RGB | GL_DOUBLE)
    • At the end of the display callback buffers are swapped
    void mydisplay()
    {
       glClear(GL_COLOR_BUFFER_BIT|….)
    .
    /* draw graphics here */
    .
       glutSwapBuffers()
    }
Using the idle callback
   The idle callback is executed whenever there are no events in the event queue
     • glutIdleFunc(myidle)
     • Useful for animations
     void myidle() {
     /* change something */
        t += dt
        glutPostRedisplay();
     }

     Void mydisplay() {
        glClear();
     /* draw something that depends on t */
        glutSwapBuffers();
     }
Using globals
   The form of all GLUT callbacks is fixed
    •   void mydisplay()
    •   void mymouse(GLint button, GLint state, GLint
        x, GLint y)
   Must use globals to pass information to callbacks

    float t; /*global */

    void mydisplay()
    {
    /* draw something that depends on t
    }
Other important functions
   glPushMatrix() / glPopMatrix()
    •   Pushes/pops the transformation matrix onto the matrix
        stack
   glLoadIdentity(), glLoadMatrix(), glMultMatrix()
    •   Pushes the matrix onto the matrix stack
   Chapter 3 of the “Red Book” gives a detailed
    explanation of transformations
    •   Jackie Neider, Tom Davis, and Mason Woo, “The
        OpenGL Programming Guide” (The Red Book)
Assignment policy
 How  to submit
 What to submit

 On late submission
How to submit
   Submit as a tar/zip file
    •   Unix:
         > tar -cf username_projectNum_(440|640).tar
    projectDir
         > gzip username_projectNum_(440|640).tar
    •   Windows:
         •   Use a zip utility
   Naming convention
    •   username_projectNum_(440|640).(tar.gz|zip)
   Submit the tar/zip file through the course web (More
    details will be announced later)
What to submit
 Must   contain
  • Readme
  • Makefile
  • Source codes
  • Output figures (if any)
 Must   NOT contain
  • obj intermediate files
  • obj data files
What to submit: Readme
 % My name
 % My email: myemail@udel.edu
 % Project Num

 % Part 1: description of this project
        This project is to apply xxx algorithm to plot xxx, …

 % Part 2: what I did and what I didn't do
        I completed all/most/some functionalities required in this project.
        The system is robust and the rendering is fairly efficient, …

         I didn't do …. The reason is ….

 % Part 3: What files contained

 % Part 4: How to compile and how to run
        The project is developed in windows system and tested in stimpy (strauss) unix system
On late submission
 N * 10 percent of the points you got will be
  deducted if there are N (<=5) late days (not
  counting weekends).
 No acceptance for the submission more than
  5-day late
 Each student has three free (i.e. without any
  penalty) late days for entire semester.
    •   You should notify the TA the use of free late days
        ahead
OpenGL: Setup in Unix
Steps to compile the code on Strauss
1.  run following command
2.  setenv LD_LIBRARY_PATH /home/base/usrb/chandrak/640/OpenGL/Mesa-
    2.6/lib:/usr/openwin/lib:/opt/gcc/lib (This is present as a comment in the Makefile)
3.  download Makefile and hello.c
4.  compile and run hello.c:
             strauss> gmake -f Makefile_composor
5.  run your code (Use ./hello if path not set properly)
             strauss> hello

Steps to compile the code on stimpy
1.  run following command
2.  setenv LD_LIBRARY_PATH /usr/local/mesa/lib:/usr/openwin/lib
3.  download Makefile_stimpy and hello.c
4.  compile and run hello.c:
            stimpy> gmake -f Makefile_stimpy
5.  run your code (Use ./hello if path not set properly)
            stimpy> hello
OpenGL: Setup in Windows
   Go to the GLUT webpage
    •   http://www.opengl.org/resources/libraries/glut.html
   From the bottom of the page, download the
    following
    •   Pre-compiled Win32 for Intel GLUT 3.7 DLLs for
        Windows 95 & NT
   Follow the instructions in
    •   http://www.lighthouse3d.com/opengl/glut/
   When creating the Visual C/C++ project, use
    the console based setup
Office Hours
 Tuesday 5:30 – 7:30 pm
 Pearson Hall 115B

 Webpage

  • vims.cis.udel.edu/~mani/TA%20Courses/Fall05/grap
 Email   - mani@udel.edu

More Related Content

What's hot

Data mining and data warehouse lab manual updated
Data mining and data warehouse lab manual updatedData mining and data warehouse lab manual updated
Data mining and data warehouse lab manual updatedYugal Kumar
 
Motivation for image fusion
Motivation for image fusionMotivation for image fusion
Motivation for image fusionVIVEKANAND BONAL
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glutsimpleok
 
Transfer Learning and Fine-tuning Deep Neural Networks
 Transfer Learning and Fine-tuning Deep Neural Networks Transfer Learning and Fine-tuning Deep Neural Networks
Transfer Learning and Fine-tuning Deep Neural NetworksPyData
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceMaryamRehman6
 
Image classification with Deep Neural Networks
Image classification with Deep Neural NetworksImage classification with Deep Neural Networks
Image classification with Deep Neural NetworksYogendra Tamang
 
IMAGE FUSION IN IMAGE PROCESSING
IMAGE FUSION IN IMAGE PROCESSINGIMAGE FUSION IN IMAGE PROCESSING
IMAGE FUSION IN IMAGE PROCESSINGgarima0690
 
Wavelet based image fusion
Wavelet based image fusionWavelet based image fusion
Wavelet based image fusionUmed Paliwal
 
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis taeseon ryu
 
Parallel processing using image processing
Parallel processing using image processingParallel processing using image processing
Parallel processing using image processingvishali bairam
 
IRJET - Disease Detection in Plant using Machine Learning
IRJET -  	  Disease Detection in Plant using Machine LearningIRJET -  	  Disease Detection in Plant using Machine Learning
IRJET - Disease Detection in Plant using Machine LearningIRJET Journal
 
BTech Pattern Recognition Notes
BTech Pattern Recognition NotesBTech Pattern Recognition Notes
BTech Pattern Recognition NotesAshutosh Agrahari
 
Applications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldApplications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldAshwani Srivastava
 
Comparison of image fusion methods
Comparison of image fusion methodsComparison of image fusion methods
Comparison of image fusion methodsAmr Nasr
 
Fundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processingFundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processingKarthicaMarasamy
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extractionRushin Shah
 
Content Based Image Retrieval
Content Based Image Retrieval Content Based Image Retrieval
Content Based Image Retrieval Swati Chauhan
 

What's hot (20)

Data mining and data warehouse lab manual updated
Data mining and data warehouse lab manual updatedData mining and data warehouse lab manual updated
Data mining and data warehouse lab manual updated
 
Motivation for image fusion
Motivation for image fusionMotivation for image fusion
Motivation for image fusion
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glut
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Transfer Learning and Fine-tuning Deep Neural Networks
 Transfer Learning and Fine-tuning Deep Neural Networks Transfer Learning and Fine-tuning Deep Neural Networks
Transfer Learning and Fine-tuning Deep Neural Networks
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data science
 
Image classification with Deep Neural Networks
Image classification with Deep Neural NetworksImage classification with Deep Neural Networks
Image classification with Deep Neural Networks
 
IMAGE FUSION IN IMAGE PROCESSING
IMAGE FUSION IN IMAGE PROCESSINGIMAGE FUSION IN IMAGE PROCESSING
IMAGE FUSION IN IMAGE PROCESSING
 
Wavelet based image fusion
Wavelet based image fusionWavelet based image fusion
Wavelet based image fusion
 
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
 
Parallel processing using image processing
Parallel processing using image processingParallel processing using image processing
Parallel processing using image processing
 
IRJET - Disease Detection in Plant using Machine Learning
IRJET -  	  Disease Detection in Plant using Machine LearningIRJET -  	  Disease Detection in Plant using Machine Learning
IRJET - Disease Detection in Plant using Machine Learning
 
BTech Pattern Recognition Notes
BTech Pattern Recognition NotesBTech Pattern Recognition Notes
BTech Pattern Recognition Notes
 
Applications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldApplications of Digital image processing in Medical Field
Applications of Digital image processing in Medical Field
 
Comparison of image fusion methods
Comparison of image fusion methodsComparison of image fusion methods
Comparison of image fusion methods
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
Fundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processingFundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processing
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
 
Content Based Image Retrieval
Content Based Image Retrieval Content Based Image Retrieval
Content Based Image Retrieval
 
Web content mining
Web content miningWeb content mining
Web content mining
 

Similar to Opengl (1)

Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxAnandM62785
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
Intro to Computer Graphics.ppt
Intro to Computer Graphics.pptIntro to Computer Graphics.ppt
Intro to Computer Graphics.pptadil104135
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.pptEngrZamaan
 
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtConvert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtICS
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsRup Chowdhury
 
Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Sharath Raj
 
Richard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleRichard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleAxway Appcelerator
 

Similar to Opengl (1) (20)

Open gl
Open glOpen gl
Open gl
 
Bai 1
Bai 1Bai 1
Bai 1
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptx
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
opengl.ppt
opengl.pptopengl.ppt
opengl.ppt
 
Intro to Computer Graphics.ppt
Intro to Computer Graphics.pptIntro to Computer Graphics.ppt
Intro to Computer Graphics.ppt
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
 
BYO3D 2011: Rendering
BYO3D 2011: RenderingBYO3D 2011: Rendering
BYO3D 2011: Rendering
 
Programming with OpenGL
Programming with OpenGLProgramming with OpenGL
Programming with OpenGL
 
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtConvert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
 
OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
Open gles
Open glesOpen gles
Open gles
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
Lab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer GraphicsLab Practices and Works Documentation / Report on Computer Graphics
Lab Practices and Works Documentation / Report on Computer Graphics
 
Introduction to OpenGL.ppt
Introduction to OpenGL.pptIntroduction to OpenGL.ppt
Introduction to OpenGL.ppt
 
Input and Interaction
Input and InteractionInput and Interaction
Input and Interaction
 
Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL Computer Graphics Project Report on Sinking Ship using OpenGL
Computer Graphics Project Report on Sinking Ship using OpenGL
 
Richard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleRichard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL Module
 

More from ch samaram

Syllabus r10-ecm-42-network security and cryptography
 Syllabus r10-ecm-42-network security and cryptography Syllabus r10-ecm-42-network security and cryptography
Syllabus r10-ecm-42-network security and cryptographych samaram
 
Restaurant billing application
Restaurant billing applicationRestaurant billing application
Restaurant billing applicationch samaram
 
Spintronics (1)
Spintronics (1)Spintronics (1)
Spintronics (1)ch samaram
 
Computer forensics law and privacy
Computer forensics   law and privacyComputer forensics   law and privacy
Computer forensics law and privacych samaram
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoftch samaram
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scriptsch samaram
 

More from ch samaram (17)

Syllabus r10-ecm-42-network security and cryptography
 Syllabus r10-ecm-42-network security and cryptography Syllabus r10-ecm-42-network security and cryptography
Syllabus r10-ecm-42-network security and cryptography
 
Restaurant billing application
Restaurant billing applicationRestaurant billing application
Restaurant billing application
 
Spintronics
SpintronicsSpintronics
Spintronics
 
Spintronics (1)
Spintronics (1)Spintronics (1)
Spintronics (1)
 
Shore
ShoreShore
Shore
 
Presentation
PresentationPresentation
Presentation
 
Computer forensics law and privacy
Computer forensics   law and privacyComputer forensics   law and privacy
Computer forensics law and privacy
 
Blue gene
Blue geneBlue gene
Blue gene
 
Blue gene
Blue geneBlue gene
Blue gene
 
Wearable (1)
Wearable (1)Wearable (1)
Wearable (1)
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
Html siva
Html sivaHtml siva
Html siva
 
Css siva
Css sivaCss siva
Css siva
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
 
Ajax
AjaxAjax
Ajax
 
Html 5
Html 5Html 5
Html 5
 
Css siva
Css sivaCss siva
Css siva
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Opengl (1)

  • 1. Introduction to OpenGL TA: Mani Thomas CISC 440/640 mani@udel.edu
  • 2. Acknowledgements  Most of the material for the slides were adapted from • E. Angel, “Interactive Computer Graphics”, 4th edition  Some of the slides were taken from • CISC 440/640 Computer Graphics (Spring 2005)  Some of the images were taken from • F.S.Hill, “Computer Graphics using OpenGL”  Other resources • http://www.lighthouse3d.com/opengl/glut/ • Jackie Neider, Tom Davis, and Mason Woo, “The OpenGL Programming Guide” (The Red Book)
  • 3. The Programmer’s Interface  Programmer sees the graphics system through a software interface: the Application Programmer Interface (API)
  • 4. API Contents  Functions that specify what we need to form an image • Objects • Viewer • Light Source(s) • Materials  Other information • Input from devices such as mouse and keyboard • Capabilities of system
  • 5. History of OpenGL  SiliconGraphics (SGI) revolutionized the graphics workstation by implementing the pipeline in hardware (1982)  To access the system, application programmers used a library called GL  With GL, it was relatively simple to program three dimensional interactive applications
  • 6. OpenGL: What is It?  Thesuccess of GL lead to OpenGL (1992), a platform-independent API that was • Easy to use • Close enough to the hardware to get excellent performance • Focus on rendering • Omitted windowing and input to avoid window system dependencies
  • 7. OpenGL Evolution  Controlled by an Architectural Review Board (ARB) • Members include SGI, Microsoft, Nvidia, HP, 3DLabs, IBM,……. • Relatively stable (present version 2.0) • Evolution reflects new hardware capabilities • 3D texture mapping and texture objects • Vertex programs • Allows for platform specific features through extensions
  • 8. OpenGL Libraries  GL (Graphics Library): Library of 2-D, 3-D drawing primitives and operations • API for 3-D hardware acceleration  GLU (GL Utilities): Miscellaneous functions dealing with camera set-up and higher-level shape descriptions  GLUT (GL Utility Toolkit): Window-system independent toolkit with numerous utility functions, mostly dealing with user interface
  • 9. Software Organization application program OpenGL Motif widget or similar GLUT GLX, AGL or WGL GLU X, Win32, Mac O/S GL software and/or hardware
  • 10. Lack of Object Orientation  OpenGL is not object oriented so that there are multiple functions for a given logical function •glVertex3f •glVertex2i •glVertex3dv  Underlying storage mode is the same  Easy to create overloaded functions in C++ but issue is efficiency
  • 11. OpenGL function format function name dimensions glVertex3f(x,y,z) x,y,z are floats belongs to GL library glVertex3fv(p) p is a pointer to an array
  • 12. simple.c #include <GL/glut.h> void mydisplay(){ glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); } int main(int argc, char** argv){ glutCreateWindow("simple"); glutDisplayFunc(mydisplay); glutMainLoop(); }
  • 13. Event Loop  Note that the program defines a display callback function named mydisplay • Every glut program must have a display callback • The display callback is executed whenever OpenGL decides the display must be refreshed, for example when the window is opened • The main function ends with the program entering an event loop
  • 14. Default parameters  simple.c is too simple  Makes heavy use of state variable default values for • Viewing • Colors • Window parameters
  • 15. OpenGL Camera  Right-handed system  From point of view of camera looking out into scene: • OpenGL places a camera at the origin in object space pointing in the negative z direction  Positive rotations are counterclockwise around axis of rotation
  • 16. Coordinate Systems  The units in glVertex are determined by the application and are called object or problem coordinates  The viewing specifications are also in object coordinates and it is the size of the viewing volume that determines what will appear in the image  Internally, OpenGL will convert to camera (eye) coordinates and later to screen coordinates
  • 17. Transformations in OpenGl  Modeling transformation • Refer to the transformation of models (i.e., the scenes, or objects)  Viewing transformation • Refer to the transformation on the camera  Projection transformation • Refer to the transformation from scene to image
  • 18. Model/View Transformations  Model-view transformations are usually visualized as a single entity • Before applying modeling or viewing transformations, need to set glMatrixMode(GL_MODELVIEW) • Modeling transforms the object • Translation: glTranslate(x,y,z) • Scale: glScale(sx,sy,sz) • Rotation: glRotate(theta, x,y,z) • Viewing transfers the object into camera coordinates • gluLookAt (eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ)
  • 19. Model/View transformation Courtesy: Neider, Davis and Woo, “The OpenGL Programming Guide”
  • 20. Projection Transformation  Transformation of the 3D scene into the 2D rendered image plane • Before applying projection transformations, need to set glMatrixMode(GL_PROJECTION) • Orthographic projection • glOrtho(left, right, bottom, top, near, far) • Perspective projection • glFrustum (left, right, bottom, top, near, far)
  • 21. Projection Transformation Orthographic projection Perspective projection F.S.Hill, “Computer Graphics using OpenGL”
  • 22. Program Structure  Most OpenGL programs have the following structure • main(): • defines the callback functions • opens one or more windows with the required properties • enters event loop (last executable statement) • init(): sets the state variables • Viewing • Attributes • callbacks • Display function • Input and window functions
  • 23. simple.c revisited #include <GL/glut.h> includes gl.h int main(int argc, char** argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); glutInitWindowSize(500,500); glutInitWindowPosition(0,0); glutCreateWindow("simple"); define window properties glutDisplayFunc(mydisplay); init(); display callback glutMainLoop(); set OpenGL state } enter event loop
  • 24. GLUT functions  glutInit allows application to get command line arguments and initializes system  gluInitDisplayMode requests properties for the window (the rendering context) • RGB color • Single buffering • Properties logically ORed together  glutWindowSize in pixels  glutWindowPosition from top-left corner of display  glutCreateWindow create window with title “simple”  glutDisplayFunc display callback  glutMainLoop enter infinite event loop
  • 25. Window Initialization black clear color void init() { opaque window glClearColor (0.0, 0.0, 0.0, 1.0); glColor3f(1.0, 1.0, 1.0); fill/draw with white glMatrixMode (GL_PROJECTION); glLoadIdentity (); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); } viewing volume
  • 26. Display callback function void mydisplay() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); }
  • 27. Input and Interaction  Multiple input devices, each of which can send a trigger to the operating system at an arbitrary time by a user • Button on mouse • Pressing or releasing a key  Each trigger generates an event whose measure is put in an event queue which can be examined by the user program
  • 28. Callbacks  Programming interface for event-driven input  Define a callback function for each type of event the graphics system recognizes  This user-supplied function is executed when the event occurs mouse callback function • GLUT example: glutMouseFunc(mymouse)
  • 29. GLUT event loop  Last line in main.c for a program using GLUT is the infinite event loop glutMainLoop();  In each pass through the event loop, GLUT • looks at the events in the queue • for each event in the queue, GLUT executes the appropriate callback function if one is defined • if no callback is defined for the event, the event is ignored  In main.c • glutDisplayFunc(mydisplay) identifies the function to be executed • Every GLUT program must have a display callback
  • 30. Posting redisplays  Many events may invoke the display callback function • Can lead to multiple executions of the display callback on a single pass through the event loop  We can avoid this problem by instead using glutPostRedisplay(); which sets a flag.  GLUT checks to see if the flag is set at the end of the event loop • If set then the display callback function is executed
  • 31. Double Buffering  Instead of one color buffer, we use two • Front Buffer: one that is displayed but not written to • Back Buffer: one that is written to but not displayed  Program then requests a double buffer in main.c • glutInitDisplayMode(GL_RGB | GL_DOUBLE) • At the end of the display callback buffers are swapped void mydisplay() { glClear(GL_COLOR_BUFFER_BIT|….) . /* draw graphics here */ . glutSwapBuffers() }
  • 32. Using the idle callback  The idle callback is executed whenever there are no events in the event queue • glutIdleFunc(myidle) • Useful for animations void myidle() { /* change something */ t += dt glutPostRedisplay(); } Void mydisplay() { glClear(); /* draw something that depends on t */ glutSwapBuffers(); }
  • 33. Using globals  The form of all GLUT callbacks is fixed • void mydisplay() • void mymouse(GLint button, GLint state, GLint x, GLint y)  Must use globals to pass information to callbacks float t; /*global */ void mydisplay() { /* draw something that depends on t }
  • 34. Other important functions  glPushMatrix() / glPopMatrix() • Pushes/pops the transformation matrix onto the matrix stack  glLoadIdentity(), glLoadMatrix(), glMultMatrix() • Pushes the matrix onto the matrix stack  Chapter 3 of the “Red Book” gives a detailed explanation of transformations • Jackie Neider, Tom Davis, and Mason Woo, “The OpenGL Programming Guide” (The Red Book)
  • 35. Assignment policy  How to submit  What to submit  On late submission
  • 36. How to submit  Submit as a tar/zip file • Unix: > tar -cf username_projectNum_(440|640).tar projectDir > gzip username_projectNum_(440|640).tar • Windows: • Use a zip utility  Naming convention • username_projectNum_(440|640).(tar.gz|zip)  Submit the tar/zip file through the course web (More details will be announced later)
  • 37. What to submit  Must contain • Readme • Makefile • Source codes • Output figures (if any)  Must NOT contain • obj intermediate files • obj data files
  • 38. What to submit: Readme % My name % My email: myemail@udel.edu % Project Num % Part 1: description of this project This project is to apply xxx algorithm to plot xxx, … % Part 2: what I did and what I didn't do I completed all/most/some functionalities required in this project. The system is robust and the rendering is fairly efficient, … I didn't do …. The reason is …. % Part 3: What files contained % Part 4: How to compile and how to run The project is developed in windows system and tested in stimpy (strauss) unix system
  • 39. On late submission  N * 10 percent of the points you got will be deducted if there are N (<=5) late days (not counting weekends).  No acceptance for the submission more than 5-day late  Each student has three free (i.e. without any penalty) late days for entire semester. • You should notify the TA the use of free late days ahead
  • 40. OpenGL: Setup in Unix Steps to compile the code on Strauss 1. run following command 2. setenv LD_LIBRARY_PATH /home/base/usrb/chandrak/640/OpenGL/Mesa- 2.6/lib:/usr/openwin/lib:/opt/gcc/lib (This is present as a comment in the Makefile) 3. download Makefile and hello.c 4. compile and run hello.c: strauss> gmake -f Makefile_composor 5. run your code (Use ./hello if path not set properly) strauss> hello Steps to compile the code on stimpy 1. run following command 2. setenv LD_LIBRARY_PATH /usr/local/mesa/lib:/usr/openwin/lib 3. download Makefile_stimpy and hello.c 4. compile and run hello.c: stimpy> gmake -f Makefile_stimpy 5. run your code (Use ./hello if path not set properly) stimpy> hello
  • 41. OpenGL: Setup in Windows  Go to the GLUT webpage • http://www.opengl.org/resources/libraries/glut.html  From the bottom of the page, download the following • Pre-compiled Win32 for Intel GLUT 3.7 DLLs for Windows 95 & NT  Follow the instructions in • http://www.lighthouse3d.com/opengl/glut/  When creating the Visual C/C++ project, use the console based setup
  • 42. Office Hours  Tuesday 5:30 – 7:30 pm  Pearson Hall 115B  Webpage • vims.cis.udel.edu/~mani/TA%20Courses/Fall05/grap  Email - mani@udel.edu