The document provides an introduction to OpenGL programming. It discusses that OpenGL is a hardware-independent API for 3D graphics. It originated from SGI's GL library and was developed as the cross-platform OpenGL standard. The document outlines OpenGL's core functionality and architecture, as well as common libraries like GLUT and GLU. It provides examples of basic OpenGL programs and concepts like the rendering pipeline, coordinate systems, and event handling.
Open Graphics Library (OpenGL) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.
Open Graphics Library (OpenGL) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.
It gives the detailed information about Three Dimensional Display Methods, Three dimensional Graphics Package, Interactive Input Methods and Graphical User Interface, Input of Graphical Data, Graphical Data: Input Functions, Interactive Picture-Construction
An illumination model, also called a lighting model and sometimes referred to as a shading model, is used to calculate the intensity of light that we should see at a given point on the surface of an object.
It gives the detailed information about Three Dimensional Display Methods, Three dimensional Graphics Package, Interactive Input Methods and Graphical User Interface, Input of Graphical Data, Graphical Data: Input Functions, Interactive Picture-Construction
An illumination model, also called a lighting model and sometimes referred to as a shading model, is used to calculate the intensity of light that we should see at a given point on the surface of an object.
Flying Machine
Flying Machine is a Aviation consulting company established in year 2009 with charter and short term lease of fixed and rotor wings.
We provide a range of support and services in the areas of Asset Sales& Remarketing, Asset Lease, Asset Financing and Engines & Spare parts trading.
We also provide Technical Services Support and Solutions for Pre Purchase Inspection, Technical Records Audit & Analysis, Aircraft Delivery & Redelivery, and Technical Project Management.
Part of the WGK 2014 conference proceedings: http://wgk.gd/eng/
The lecture contained some live demos which are missing from this slide deck for obvious reasons.
An overview of practical techniques for debugging OpenGL rendering applications, focusing on the vendor- and version-independent debug extensions rather than IHV-supplied tools.
Video replay: http://nvidia.fullviewmedia.com/siggraph2012/ondemand/SS104.html
Date: Wednesday, August 8, 2012
Time: 11:50 AM - 12:50 PM
Location: SIGGRAPH 2012, Los Angeles
Attend this session to get the most out of OpenGL on NVIDIA Quadro and GeForce GPUs. Learn about the new features in OpenGL 4.3, particularly Compute Shaders. Other topics include bindless graphics; Linux improvements; and how to best use the modern OpenGL graphics pipeline. Learn how your application can benefit from NVIDIA's leadership driving OpenGL as a cross-platform, open industry standard.
Get OpenGL 4.3 beta drivers for NVIDIA GPUs from http://www.nvidia.com/content/devzone/opengl-driver-4.3.html
This presentation made at TI Developer Conference 2008, introduces the options available for developers to create User Interfaces on TI SGX based platforms.
Convert Your Legacy OpenGL Code to Modern OpenGL with QtICS
See the full Video here: http://bit.ly/modern-open-gl-qt
Back by popular demand, we invite you to another informative webinar on OpenGL, a powerful, low-level graphics toolkit allowing access to accelerated GPU and hardware. Learn the many aspects of OpenGL development where Qt provides advanced interfaces to let developers focus on tasks instead of dealing with repetitive and error-prone, platform dependent issues.
This revised version the OpenGL webinar from last summer, will present information on the differences and the upgrade possibilities available for Qt-OpenGL applications converting from Qt 4x to Qt 5. In addition, we will touch upon best practices when converting legacy, fixed pipeline applications to modern OpenGL using Qt5.
Driven by the recent resurgence of 3D cinema, depth cameras and stereoscopic displays are becoming commonplace in the consumer market. Introduced last October, Microsoft Kinect has already fostered gesture-based interaction for applications well beyond the intended Xbox 360 platform. Similarly, consumer electronics manufacturers have begun selling stereoscopic displays and inexpensive stereoscopic cameras. Most commercial 3D displays continue to require cumbersome eyewear, but inexpensive, glasses-free 3D displays are imminent with the release of the Nintendo 3DS.
At SIGGRAPH 2010, the Build Your Own 3D Display course demonstrated how to construct both LCD shutter glasses and glasses-free lenticular screens, providing Matlab-based code for batch encoding of 3D imagery. This follow-up course focuses more narrowly on glasses-free displays, describing in greater detail the practical aspects of real-time, OpenGL-based encoding for such multi-view, spatially multiplexed displays.
The course reviews historical and perceptual aspects, emphasizing the goal of achieving disparity, motion parallax, accommodation, and convergence cues without glasses. It summarizes state-of-the-art methods and areas of active research. And it provides a step-by-step tutorial on how to construct a lenticular display. The course concludes with an extended question-and-answer session, during which prototype hardware is available for inspection.
Porting the Source Engine to Linux: Valve's Lessons Learnedbasisspace
These slides discuss the techniques applied to porting a large, commercial AAA engine from Windows to Linux. It includes the lessons learned along the way, and pitfalls we ran into to help serve as a warning to other developers.
Lab Practices and Works Documentation / Report on Computer GraphicsRup Chowdhury
This is a report that I have prepared during my Computer Graphics Lab course. This contains the theoretical information that we learned in our introduction class. It also contains information on different computer graphics tools and software. It contains codes to create different and also the procedure.
1. Information on GLUT
2. Flag drawing with GLUT
3. DDA Algorithm
4. Midpoint Line Drawing Algorithm
5. Tansformation
Takes the reader through the various components of windowing systems, and how to develop and benchmark various Graphics applications using OpenGL and other toolsets. Also includes a Cheatsheet that covers various terminologies used in the Graphics world.
OpenGL is a powerful, low-level graphics toolkit with a steep learning curve that allows access to accelerated GPU hardware. Using OpenGL, developers achieve high fidelity, animated graphics ubiquitous in games, screen productions and scientific software.
Join us for a one-hour webinar and we will give a comprehensive overview of the many aspects of OpenGL development where Qt provides advanced interfaces that let the developer focus on the tasks instead of dealing with repetitive and error-prone, platform dependent issues.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
2. What is OpenGL
OpenGL is a software API to graphics hardware.
designed as a streamlined, hardware-independent
interface to be implemented on many different hardware
platforms
Intuitive, procedural interface with c binding
No windowing commands !
No high-level commands for describing models of three-
dimensional objects
The OpenGL Utility Library (GLU) provides many of the
modeling features, such as quadric surfaces and NURBS
curves and surfaces
3. SGI and GL
Silicon Graphics (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
4. OpenGL
The success 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
5. 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 and fragment programs
Allows for platform specific features through
extensions
6. OpenGL Libraries
OpenGL core library
OpenGL32 on Windows
GL on most unix/linux systems (libGL.a)
OpenGL Utility Library (GLU)
Provides functionality in OpenGL core but avoids
having to rewrite code
Links with window system
GLX for X window systems, WGL for Windows
Cross-platform GUI libraries: GLUT, SDL, FLTK, QT,
…
7. Windowing with OpenGL
OpenGL is independent of any specific
window system
OpenGL can be used with different window
systems
X windows (GLX)
MFC
…
GLUTprovide a portable API for creating
window and interacting with I/O devices
8. GLUT
OpenGL Utility Toolkit (GLUT)
Provides functionality common to all window systems
Open a window
Get input from mouse and keyboard
Menus
Event-driven
Code is portable but GLUT lacks the functionality of a
good toolkit for a specific platform
No slide bars, buttons, …
9. Software Organization
application program
OpenGL Motif
widget or similar GLUT
GLX, AGL
or WGL GLU
X, Win32, Mac O/S OpenGL
software and/or hardware
10. OpenGL Architecture
Immediate Mode geometry
pipeline
Per Vertex
Polynomial Operations &
Evaluator Primitive
Assembly
Display Per Fragment Frame
CPU List
Rasterization
Operations Buffer
Texture
Memory
Pixel
Operations
11. OpenGL as a state machine
GL State Variables- can be set and queried by OpenGL. Remains
unchanged until the next change.
Projection and viewing matrix
Color and material properties
Lights and shading
Line and polygon drawing modes
…
OpenGL functions are of two types
Primitive generating
Can cause output if primitive is visible
How vertices are processed and appearance of primitive are controlled by the
state
State changing
Transformation functions
Attribute functions
12. OpenGL Syntax
Functions have prefix gl and initial capital letters for each word
glClearColor(), glEnable(), glPushMatrix() …
glu for GLU functions
gluLookAt(), gluPerspective() …
Constants begin with GL_, use all capital letters
GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW …
Extra letters in some commands indicate the number and type of
variables
glColor3f(), glVertex3f() …
OpenGL data types
GLfloat, GLdouble, GLint, GLenum, …
Underlying storage mode is the same
Easy to create overloaded functions in C++ but issue is efficiency
13. 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
14. OpenGL #defines
Most
constants are defined in the include files
gl.h, glu.h and glut.h
Note #include <GL/glut.h> should
automatically include the others
Examples
glBegin(GL_POLYGON)
glClear(GL_COLOR_BUFFER_BIT)
include
files also define OpenGL data types:
GLfloat, GLdouble,….
15. GLUT
Developed by Mark Kilgard
Hides the complexities of differing window
system APIs
Default user interface for class projects
Glut routines have prefix glut
glutCreateWindow() …
Has very limited GUI interface
Glui is the C++ extension of glut
16. Glut Routines
Initialization: glutInit() processes (and removes) command-line
arguments that may be of interest to glut and the window system and
does general initialization of Glut and OpenGL
Must be called before any other glut routines
Display Mode: The next procedure, glutInitDisplayMode(),
performs initializations informing OpenGL how to set up the frame
buffer.
Display Mode Meaning
GLUT_RGB Use RGB colors
GLUT_RGBA Use RGB plus alpha (for transparency)
GLUT_INDEX Use indexed colors (not recommended)
GLUT_DOUBLE Use double buffering (recommended)
GLUT_SINGLE Use single buffering (not recommended)
GLUT_DEPTH Use depth-buffer (for hidden surface removal.)
17. Glut Routines
Window Setup
glutInitWindowSize(int width, int height)
glutInitWindowPosition(int x, int y)
glutCreateWindow(char* title)
20. Closer Look at the main()
#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");
glutDisplayFunc(mydisplay); define window properties
init(); display callback
set OpenGL state
glutMainLoop();
}
enter event loop
21. init.c
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
22. Event Handling
Virtually all interactive graphics programs are even
driven
GLUT uses callbacks to handle events
Windows system invokes a particular procedure when an
event of particular type occurs.
MOST IMPORTANT: display event
Signaled when window first displays and whenever portions
of the window reveals from blocking window
glutDisplayFunc(void (*func)(void)) registers
the display callback function
Running the program: glutMainLoop()
Main event loop. Never exit()
23. More Callbacks
glutReshapeFunc(void (*func)(int w, int h)) indicates
what action should be taken when the window is resized.
glutKeyboardFunc(void (*func)(unsigned char key, int
x, int y)) and glutMouseFunc(void (*func)(int button,
int state, int x, int y)) allow you to link a keyboard key or a
mouse button with a routine that's invoked when the key or mouse
button is pressed or released.
glutMotionFunc(void (*func)(int x, int y)) registers a
routine to call back when the mouse is moved while a mouse button is
also pressed.
glutIdleFunc(void (*func)(void)) registers a function that's to
be executed if no other events are pending - for example, when the
event loop would otherwise be idle
24. Compilation on Windows
See class web site on how to set up a project
with OpenGL
Visual C++
Get glut.h, glut32.lib and glut32.dll from web
Create a console application
Add opengl32.lib, glut32.lib, glut32.lib to project
settings (under link tab)
25. Simple Animation
Animation
Redraw + swap buffers
What looks like if using single buffer
Example program
More on the glut documentation
Chapter 2 of textbook
OpenGL redbook
Links in the class resources page
26. OpenGL Drawing
We have learned how to create a window
Steps in the display function
Clear the window
Set drawing attributes
Send drawing commands
Swap the buffers
OpenGL coordinate system has different origin from
the window system
Uses lower left corner instead of upper left corner as origin
27. Clear the Window
glClear(GL_COLOR_BUFFER_BIT)
clears the frame buffer by overwriting it with the
background color.
Background color is a state set by
glClearColor(GLfloat r, GLfloat g,
GLfloat b, GLfloat a) in the init().
28. Drawing Attributes: Color
glColor3f(GLfloat r, GLfloat g, GLfloat b) sets the
drawing color
glColor3d(), glColor3ui() can also be used
Remember OpenGL is a state machine
Once set, the attribute applies to all subsequent defined
objects until it is set to some other value
glColor3fv() takes a flat array as input
There are more drawing attributes than color
Point size: glPointSize()
Line width: glLinewidth()
Dash or dotted line: glLineStipple()
Polygon pattern: glPolygonStipple()
…
29. Drawing Commands
Simple Objects glRectf()
Complex Objects
Use construct
glBegin(mode) and
glEnd() and a list of
vertices in between
glBegin(mode)
glVertex(v0);
glVertex(v1);
...
glEnd();
Some other commands can
also be used between
glBegin() and glEnd(), e.g.
glColor3f().
Example
31. Orthographic projection
Orthographic View
glOrtho(left,
right, bottom,
top, front, back)
Specifies the
coordinates of 3D
region to be projected
z=0
into the image space.
Any drawing outside the
region will be
automatically clipped
away.
32. Viewports
Do not have use the entire window for the
image: glViewport(x,y,w,h)
Values in pixels (screen coordinates)
33. Window to Viewport mapping
Aspect Ratio: Height/Width
If the aspect ratio of the window
Is different from that of the
viewport, the picture will be
distorted.
34. Sierpinski Gasket (2D)
Start with a triangle
Connect bisectors of sides and remove central
triangle
Repeat
36. Gasket Program
#include <GL/glut.h>
/* initial triangle */
GLfloat v[3][2]={{-1.0, -0.58},
{1.0, -0.58}, {0.0, 1.15}};
int n; /* number of recursive steps */
void triangle( GLfloat *a, GLfloat *b, GLfloat *c)
/* display one triangle */
{
glVertex2fv(a);
glVertex2fv(b);
glVertex2fv(c);
}
37. Triangle Subdivision
void divide_triangle(GLfloat *a, GLfloat *b, GLfloat *c, int
m)
{
/* triangle subdivision using vertex numbers */
point2 v0, v1, v2;
int j;
if(m>0)
{
for(j=0; j<2; j++) v0[j]=(a[j]+b[j])/2;
for(j=0; j<2; j++) v1[j]=(a[j]+c[j])/2;
for(j=0; j<2; j++) v2[j]=(b[j]+c[j])/2;
divide_triangle(a, v0, v1, m-1);
divide_triangle(c, v1, v2, m-1);
divide_triangle(b, v2, v0, m-1);
}
else(triangle(a,b,c));
/* draw triangle at end of recursion */
}
38. Gasket Display Functions
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
divide_triangle(v[0], v[1], v[2], n);
glEnd();
glFlush();
}
• By having the glBegin and glEnd in the display callback rather
than in the function triangle and using GL_TRIANGLES rather
than GL_POLYGON in glBegin, we call glBegin and glEnd
only once for the entire gasket rather than once for each triangle