SlideShare a Scribd company logo
1 of 17
SER332
Introduction to Graphics and
Game Development
Lecture 12:
Fonts, 3D Objects, and Review
Javier Gonzalez-Sanchez
javiergs@asu.edu
PERALTA 230U
Office Hours: By appointment
Part 8:
Fonts
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 3
Example 4
// https://github.com/javiergs/SER332/blob/master/L12
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 4
Fonts Rendering
§ GLUT supports two type of font rendering.
§ Stroke fonts: each character is rendered as a set of line segments, a
geometrical thing can be scaled or translated, rendered; it requires a
3D environment set up.
§ Bitmap fonts: each character is a bitmap generated. Rendered as
bitmaps, but faster.
§ Fonts supported by bitmap:
§ GLUT_BITMAP_8_BY_13
§ GLUT_BITMAP_TIMES_ROMAN_10
§ ... ... ...
§ Fonts supported by stroke
§ GLUT_STROKE_ROMAN
§ GLUT_STROKE_MONO_ROMAN
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 5
Stroke Fonts
void renderStrokeString
(float x, float y, float z, float scale, void *font, char *string) {
char *c;
glPushMatrix();
glTranslatef(x, y, z); // fonts position
glScalef(scale, scale, scale);
for(c=string; *c != ‘0’; c++)
glutStrokeCharacter(font, *c);
glPopMatrix();
}
Example:
int font = GLUT_STROKE_ROMAN;
renderStrokeString(20.0,30.0,0.0,0.1,font,”start”);
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 6
Bitmap Fonts
void renderBitmapString
(float x, float y, float z, void *font, char *string){
char *c;
glRasterPos3f(x, y, z); // fonts position
for(c=string; *c != ‘0’; c++)
glutBitmapCharacter(font, *c);
}
Example:
int font = GLUT_BITMAP_9_BY_13;
renderBitmapString(20.0,30.0,0.0,font,”start”);
Part 9:
OBJ Files
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 8
OBJ
v 0.0 2.0 0.0
v 0.0 -2.0 0.0
v -1.0 0.0 -1.0
v 1.0 0.0 -1.0
v 1.0 0.0 1.0
v -1.0 0.0 1.0
f 1 4 3
f 1 3 6
f 1 6 5
f 1 5 4
f 2 3 4
f 2 6 3
f 2 5 6
f 2 4 5
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 9
Mesh Orientation
• Ability to distinguish ‘front’ and ‘back’ faces
o Efficient rendering
o Many rendering effects treat front and back faces separately
• Vertex order
o Counterclockwise or clockwise
o Adjacent triangles should be correctly oriented
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 10
Mesh Orientation
• Remember the back face culling
• glFrontFace(GL_CCW) // right-hand rule
Pass Discard
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 11
Tools
Preview | MacOSX 3D Builder | Windows 10
Part 10:
Midterm Review
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 13
Review
The following is a summary of the most relevant ideas.
But, the exam is not limited to these,
i.e.,
The following IS NOT a comprehensive list
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 14
Review
• Lecture 1
concepts: rendering, rasterization, transformation,
C/C++, draw basic shapes (math), matrix
multiplication, line equation.
• Lecture 2
Frame buffer (size), color (RGB, RGBA), resolution, depth, GPU
architecture, pixel, aspect-ratio.
• Lecture 3
OpenGL: (begin, end, vertex, color), (gl, glut, glu), instructions
in main, init, display, 2D drawing, double buffering
• Lecture 4
callback functions (mouse, keyboard, idle, display)
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 15
Review
• Lecture 5
Geometric primitives (points, lines, triangles, quads,
polygon), shading
• Lecture 6
Model-View transformation (rotate, translate, scale), local and world
coordinates.
• Lecture 7
Viewport, reshapeWindow
• Lecture 8
Lab 1
Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 16
Review
• Lecture 9
Display lists, pop-up menus
• Lecture 10
Z-buffering, Projection transformation, perspective setup, gluLookAt,
glMatrixMode.
• Lecture 11
Lab 2
• Lecture 12
Fonts, Vertex vs Faces, OBJ file format
SER332 Introduction to Graphics
Javier Gonzalez-Sanchez
javiergs@asu.edu
Spring 2017
Disclaimer. These slides can only be used as study material for the class SER332 at ASU. They cannot be distributed or used for another purpose.

More Related Content

Similar to 201707 SER332 Lecture 12

Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I💻 Anton Gerdelan
 
WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...
WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...
WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...AMD Developer Central
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
Introduction To Geometry Shaders
Introduction To Geometry ShadersIntroduction To Geometry Shaders
Introduction To Geometry Shaderspjcozzi
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading LanguageJungsoo Nam
 
thu-blake-gdc-2014-final
thu-blake-gdc-2014-finalthu-blake-gdc-2014-final
thu-blake-gdc-2014-finalRobert Taylor
 
The Dynamic Language is not Enough
The Dynamic Language is not EnoughThe Dynamic Language is not Enough
The Dynamic Language is not EnoughLukas Renggli
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable ShadingMark Kilgard
 
3D Graphics
3D Graphics3D Graphics
3D GraphicsViTAly
 
Using Rhino With Solidedge.pdf
Using Rhino With Solidedge.pdfUsing Rhino With Solidedge.pdf
Using Rhino With Solidedge.pdfHelbertS3
 
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio [Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio Owen Wu
 
Lesson6IntroductionToGraphs.pdf
Lesson6IntroductionToGraphs.pdfLesson6IntroductionToGraphs.pdf
Lesson6IntroductionToGraphs.pdfcifoxo
 
IDC 2010 Conference Presentation
IDC 2010 Conference PresentationIDC 2010 Conference Presentation
IDC 2010 Conference PresentationGonçalo Amador
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdfmraaaaa
 

Similar to 201707 SER332 Lecture 12 (20)

Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
 
WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...
WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...
WT-4072, Rendering Web Content at 60fps, by Vangelis Kokkevis, Antoine Labour...
 
201801 CSE240 Lecture 16
201801 CSE240 Lecture 16201801 CSE240 Lecture 16
201801 CSE240 Lecture 16
 
201804 SER332 Lecture 01
201804 SER332 Lecture 01201804 SER332 Lecture 01
201804 SER332 Lecture 01
 
201801 SER332 Lecture 02
201801 SER332 Lecture 02201801 SER332 Lecture 02
201801 SER332 Lecture 02
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
Introduction To Geometry Shaders
Introduction To Geometry ShadersIntroduction To Geometry Shaders
Introduction To Geometry Shaders
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
thu-blake-gdc-2014-final
thu-blake-gdc-2014-finalthu-blake-gdc-2014-final
thu-blake-gdc-2014-final
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
The Dynamic Language is not Enough
The Dynamic Language is not EnoughThe Dynamic Language is not Enough
The Dynamic Language is not Enough
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable Shading
 
3D Graphics
3D Graphics3D Graphics
3D Graphics
 
Using Rhino With Solidedge.pdf
Using Rhino With Solidedge.pdfUsing Rhino With Solidedge.pdf
Using Rhino With Solidedge.pdf
 
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio [Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
 
Lesson6IntroductionToGraphs.pdf
Lesson6IntroductionToGraphs.pdfLesson6IntroductionToGraphs.pdf
Lesson6IntroductionToGraphs.pdf
 
201801 SER332 Lecture 03
201801 SER332 Lecture 03201801 SER332 Lecture 03
201801 SER332 Lecture 03
 
IDC 2010 Conference Presentation
IDC 2010 Conference PresentationIDC 2010 Conference Presentation
IDC 2010 Conference Presentation
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdf
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 

More from Javier Gonzalez-Sanchez (20)

201801 SER332 Lecture 04
201801 SER332 Lecture 04201801 SER332 Lecture 04
201801 SER332 Lecture 04
 
201801 CSE240 Lecture 26
201801 CSE240 Lecture 26201801 CSE240 Lecture 26
201801 CSE240 Lecture 26
 
201801 CSE240 Lecture 25
201801 CSE240 Lecture 25201801 CSE240 Lecture 25
201801 CSE240 Lecture 25
 
201801 CSE240 Lecture 24
201801 CSE240 Lecture 24201801 CSE240 Lecture 24
201801 CSE240 Lecture 24
 
201801 CSE240 Lecture 23
201801 CSE240 Lecture 23201801 CSE240 Lecture 23
201801 CSE240 Lecture 23
 
201801 CSE240 Lecture 22
201801 CSE240 Lecture 22201801 CSE240 Lecture 22
201801 CSE240 Lecture 22
 
201801 CSE240 Lecture 21
201801 CSE240 Lecture 21201801 CSE240 Lecture 21
201801 CSE240 Lecture 21
 
201801 CSE240 Lecture 20
201801 CSE240 Lecture 20201801 CSE240 Lecture 20
201801 CSE240 Lecture 20
 
201801 CSE240 Lecture 19
201801 CSE240 Lecture 19201801 CSE240 Lecture 19
201801 CSE240 Lecture 19
 
201801 CSE240 Lecture 18
201801 CSE240 Lecture 18201801 CSE240 Lecture 18
201801 CSE240 Lecture 18
 
201801 CSE240 Lecture 17
201801 CSE240 Lecture 17201801 CSE240 Lecture 17
201801 CSE240 Lecture 17
 
201801 CSE240 Lecture 15
201801 CSE240 Lecture 15201801 CSE240 Lecture 15
201801 CSE240 Lecture 15
 
201801 CSE240 Lecture 14
201801 CSE240 Lecture 14201801 CSE240 Lecture 14
201801 CSE240 Lecture 14
 
201801 CSE240 Lecture 13
201801 CSE240 Lecture 13201801 CSE240 Lecture 13
201801 CSE240 Lecture 13
 
201801 CSE240 Lecture 12
201801 CSE240 Lecture 12201801 CSE240 Lecture 12
201801 CSE240 Lecture 12
 
201801 CSE240 Lecture 11
201801 CSE240 Lecture 11201801 CSE240 Lecture 11
201801 CSE240 Lecture 11
 
201801 CSE240 Lecture 10
201801 CSE240 Lecture 10201801 CSE240 Lecture 10
201801 CSE240 Lecture 10
 
201801 CSE240 Lecture 09
201801 CSE240 Lecture 09201801 CSE240 Lecture 09
201801 CSE240 Lecture 09
 
201801 CSE240 Lecture 08
201801 CSE240 Lecture 08201801 CSE240 Lecture 08
201801 CSE240 Lecture 08
 
201801 CSE240 Lecture 07
201801 CSE240 Lecture 07201801 CSE240 Lecture 07
201801 CSE240 Lecture 07
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

201707 SER332 Lecture 12

  • 1. SER332 Introduction to Graphics and Game Development Lecture 12: Fonts, 3D Objects, and Review Javier Gonzalez-Sanchez javiergs@asu.edu PERALTA 230U Office Hours: By appointment
  • 3. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 3 Example 4 // https://github.com/javiergs/SER332/blob/master/L12
  • 4. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 4 Fonts Rendering § GLUT supports two type of font rendering. § Stroke fonts: each character is rendered as a set of line segments, a geometrical thing can be scaled or translated, rendered; it requires a 3D environment set up. § Bitmap fonts: each character is a bitmap generated. Rendered as bitmaps, but faster. § Fonts supported by bitmap: § GLUT_BITMAP_8_BY_13 § GLUT_BITMAP_TIMES_ROMAN_10 § ... ... ... § Fonts supported by stroke § GLUT_STROKE_ROMAN § GLUT_STROKE_MONO_ROMAN
  • 5. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 5 Stroke Fonts void renderStrokeString (float x, float y, float z, float scale, void *font, char *string) { char *c; glPushMatrix(); glTranslatef(x, y, z); // fonts position glScalef(scale, scale, scale); for(c=string; *c != ‘0’; c++) glutStrokeCharacter(font, *c); glPopMatrix(); } Example: int font = GLUT_STROKE_ROMAN; renderStrokeString(20.0,30.0,0.0,0.1,font,”start”);
  • 6. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 6 Bitmap Fonts void renderBitmapString (float x, float y, float z, void *font, char *string){ char *c; glRasterPos3f(x, y, z); // fonts position for(c=string; *c != ‘0’; c++) glutBitmapCharacter(font, *c); } Example: int font = GLUT_BITMAP_9_BY_13; renderBitmapString(20.0,30.0,0.0,font,”start”);
  • 8. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 8 OBJ v 0.0 2.0 0.0 v 0.0 -2.0 0.0 v -1.0 0.0 -1.0 v 1.0 0.0 -1.0 v 1.0 0.0 1.0 v -1.0 0.0 1.0 f 1 4 3 f 1 3 6 f 1 6 5 f 1 5 4 f 2 3 4 f 2 6 3 f 2 5 6 f 2 4 5
  • 9. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 9 Mesh Orientation • Ability to distinguish ‘front’ and ‘back’ faces o Efficient rendering o Many rendering effects treat front and back faces separately • Vertex order o Counterclockwise or clockwise o Adjacent triangles should be correctly oriented
  • 10. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 10 Mesh Orientation • Remember the back face culling • glFrontFace(GL_CCW) // right-hand rule Pass Discard
  • 11. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 11 Tools Preview | MacOSX 3D Builder | Windows 10
  • 13. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 13 Review The following is a summary of the most relevant ideas. But, the exam is not limited to these, i.e., The following IS NOT a comprehensive list
  • 14. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 14 Review • Lecture 1 concepts: rendering, rasterization, transformation, C/C++, draw basic shapes (math), matrix multiplication, line equation. • Lecture 2 Frame buffer (size), color (RGB, RGBA), resolution, depth, GPU architecture, pixel, aspect-ratio. • Lecture 3 OpenGL: (begin, end, vertex, color), (gl, glut, glu), instructions in main, init, display, 2D drawing, double buffering • Lecture 4 callback functions (mouse, keyboard, idle, display)
  • 15. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 15 Review • Lecture 5 Geometric primitives (points, lines, triangles, quads, polygon), shading • Lecture 6 Model-View transformation (rotate, translate, scale), local and world coordinates. • Lecture 7 Viewport, reshapeWindow • Lecture 8 Lab 1
  • 16. Javier Gonzalez-Sanchez | SER332 | Fall 2016 | 16 Review • Lecture 9 Display lists, pop-up menus • Lecture 10 Z-buffering, Projection transformation, perspective setup, gluLookAt, glMatrixMode. • Lecture 11 Lab 2 • Lecture 12 Fonts, Vertex vs Faces, OBJ file format
  • 17. SER332 Introduction to Graphics Javier Gonzalez-Sanchez javiergs@asu.edu Spring 2017 Disclaimer. These slides can only be used as study material for the class SER332 at ASU. They cannot be distributed or used for another purpose.