SlideShare une entreprise Scribd logo
1  sur  12
Display List Texture Mapping CS3241 Lab 8
Objective Display List Understanding the benefit & limitation Setup Display List Texturing Understanding basic texture mapping Specify a texture image  Generated by program, e.g. checkerboard Loaded from file Using texture object Supply texture co-ordinate
Display List vs Immediate Mode Faster  As geometries are cached See the difference (sample program loading dino) Once setup, cannot be changed
Display List Generating empty display list (init) baseId = glGenLists(range); Setup the list (init) glNewList(id, GL_COMPILE);  		// your draw code  glEndList();  Using the list (display) glCallList(id);
Task 1 Task 1.1 Use display list to draw a teapot Task 1.2 Use display list to draw 4 wheels attaching the teapot So we have the body and wheels. What’s next? Animation Loading Mesh Texturing Material…..
Texture Enabling /Disabling Texture Mapping glEnable/glDisable(GL_TEXTURE_1D); glEnable/glDisable(GL_TEXTURE_2D);
Texture Object Better texture management Generate texture name (init) GLuinttexObj;           // global glGenTextures(1, &texObj);// init() Bind texture Object to texture data (init) glBindTexture(GL_TEXTURE_2D, texObj); glTexParameter*(); 	// setup parameter 		glTexImage2D(…..);	// alloc space & copy texture map Using texture Object (display) glBindTexture(GL_TEXTURE_2D, texObj); glutSolidTeapot(1); TextureName (Gluint) Parameter Texture Data Texture Object
Texture Parameters Repeating / Clamping Direction – s/t Repeating Clamping
Texture Parameters Filtering
Texture Coordinate To supply texture coordinate to a vertex Add glTexCoord2f(s, t); before specifying the vertex E.g. glBegin(GL_QUADS);  glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); ….. glEnd(); 5,5 5,0 0,0 0,5
Task 2 Task 2.1 Load a texture from program generated source / file Apply to Teapot Task 2.2 Supply texture co-ordinate to a plane  Apply the texture in 2.1 to the plane
Example Modeling a car Separating different part of the mesh For animating the front wheel can move according to key in:P All the wheels will rotate according to its speed For having different texture/material Try to extend it by putting better mesh :P

Contenu connexe

Tendances

Objective C Primer (with ref to C#)
Objective C  Primer (with ref to C#)Objective C  Primer (with ref to C#)
Objective C Primer (with ref to C#)Hock Leng PUAH
 
Taming the browser with the YUI Dom Component
Taming the browser with the YUI Dom ComponentTaming the browser with the YUI Dom Component
Taming the browser with the YUI Dom ComponentChristian Heilmann
 
Object Oriented Programming Assignment 3
Object Oriented Programming Assignment 3Object Oriented Programming Assignment 3
Object Oriented Programming Assignment 3Kasun Ranga Wijeweera
 
Javascript - Array - Creating Array
Javascript - Array - Creating ArrayJavascript - Array - Creating Array
Javascript - Array - Creating ArraySamuel Santos
 
Object Oriented Programming Assignment 2
Object Oriented Programming Assignment 2Object Oriented Programming Assignment 2
Object Oriented Programming Assignment 2Kasun Ranga Wijeweera
 
Animasi di andengine
Animasi di andengineAnimasi di andengine
Animasi di andengineAi Jogja
 
Object Oriented Programming Assignment 4
Object Oriented Programming Assignment 4Object Oriented Programming Assignment 4
Object Oriented Programming Assignment 4Kasun Ranga Wijeweera
 
Heap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithmsHeap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithmssamairaakram
 
What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...
What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...
What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...Codemotion
 
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationThe Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationMongoDB
 
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Intro to ggplot2 - Sheffield R Users Group, Feb 2015Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Intro to ggplot2 - Sheffield R Users Group, Feb 2015Paul Richards
 
Javascript - Array - Writing
Javascript - Array - WritingJavascript - Array - Writing
Javascript - Array - WritingSamuel Santos
 
The Weather of the Century
The Weather of the CenturyThe Weather of the Century
The Weather of the CenturyMongoDB
 
Pandas Cheat Sheet
Pandas Cheat SheetPandas Cheat Sheet
Pandas Cheat SheetACASH1011
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascienceNishant Upadhyay
 
Weather scraper for your data warehouse
Weather scraper for your data warehouseWeather scraper for your data warehouse
Weather scraper for your data warehouseFru Louis
 
Weather of the Century: Visualization
Weather of the Century: VisualizationWeather of the Century: Visualization
Weather of the Century: VisualizationMongoDB
 
Do something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseDo something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseBruce McPherson
 
Application of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPsApplication of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPsNAP Events
 

Tendances (20)

130717666736980000
130717666736980000130717666736980000
130717666736980000
 
Objective C Primer (with ref to C#)
Objective C  Primer (with ref to C#)Objective C  Primer (with ref to C#)
Objective C Primer (with ref to C#)
 
Taming the browser with the YUI Dom Component
Taming the browser with the YUI Dom ComponentTaming the browser with the YUI Dom Component
Taming the browser with the YUI Dom Component
 
Object Oriented Programming Assignment 3
Object Oriented Programming Assignment 3Object Oriented Programming Assignment 3
Object Oriented Programming Assignment 3
 
Javascript - Array - Creating Array
Javascript - Array - Creating ArrayJavascript - Array - Creating Array
Javascript - Array - Creating Array
 
Object Oriented Programming Assignment 2
Object Oriented Programming Assignment 2Object Oriented Programming Assignment 2
Object Oriented Programming Assignment 2
 
Animasi di andengine
Animasi di andengineAnimasi di andengine
Animasi di andengine
 
Object Oriented Programming Assignment 4
Object Oriented Programming Assignment 4Object Oriented Programming Assignment 4
Object Oriented Programming Assignment 4
 
Heap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithmsHeap Sort in Design and Analysis of algorithms
Heap Sort in Design and Analysis of algorithms
 
What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...
What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...
What Haskell taught us when we were not looking! - Eric Torreborre - Codemoti...
 
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationThe Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
 
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Intro to ggplot2 - Sheffield R Users Group, Feb 2015Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
 
Javascript - Array - Writing
Javascript - Array - WritingJavascript - Array - Writing
Javascript - Array - Writing
 
The Weather of the Century
The Weather of the CenturyThe Weather of the Century
The Weather of the Century
 
Pandas Cheat Sheet
Pandas Cheat SheetPandas Cheat Sheet
Pandas Cheat Sheet
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascience
 
Weather scraper for your data warehouse
Weather scraper for your data warehouseWeather scraper for your data warehouse
Weather scraper for your data warehouse
 
Weather of the Century: Visualization
Weather of the Century: VisualizationWeather of the Century: Visualization
Weather of the Century: Visualization
 
Do something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseDo something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as database
 
Application of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPsApplication of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPs
 

Similaire à Cs3241 Lab 8

Opensource gis development - part 3
Opensource gis development - part 3Opensource gis development - part 3
Opensource gis development - part 3Andrea Antonello
 
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdfAbstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdfkarymadelaneyrenne19
 
Opengl texturing
Opengl texturingOpengl texturing
Opengl texturingSardar Alam
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184Mahmoud Samir Fayed
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxAbhishek Tirkey
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxGauravPandey43518
 
Data Mining Lab Manual.docx
Data Mining Lab Manual.docxData Mining Lab Manual.docx
Data Mining Lab Manual.docxpadmavathi95
 
The Ring programming language version 1.5.4 book - Part 10 of 185
The Ring programming language version 1.5.4 book - Part 10 of 185The Ring programming language version 1.5.4 book - Part 10 of 185
The Ring programming language version 1.5.4 book - Part 10 of 185Mahmoud Samir Fayed
 
1 introduction computer graphics
1 introduction computer graphics1 introduction computer graphics
1 introduction computer graphicscairo university
 
The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88Mahmoud Samir Fayed
 
Publishing geoprocessing-services-tutorial
Publishing geoprocessing-services-tutorialPublishing geoprocessing-services-tutorial
Publishing geoprocessing-services-tutorialSebastian Correa Gimenez
 

Similaire à Cs3241 Lab 8 (20)

Opensource gis development - part 3
Opensource gis development - part 3Opensource gis development - part 3
Opensource gis development - part 3
 
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdfAbstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
 
Opengl texturing
Opengl texturingOpengl texturing
Opengl texturing
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184
 
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184
 
Xgboost
XgboostXgboost
Xgboost
 
OpenGL Texture Mapping
OpenGL Texture MappingOpenGL Texture Mapping
OpenGL Texture Mapping
 
Visual basic bt0082
Visual basic  bt0082Visual basic  bt0082
Visual basic bt0082
 
The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184The Ring programming language version 1.5.3 book - Part 10 of 184
The Ring programming language version 1.5.3 book - Part 10 of 184
 
Collections
CollectionsCollections
Collections
 
Data Exploration in R.pptx
Data Exploration in R.pptxData Exploration in R.pptx
Data Exploration in R.pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
Compose camp 2.pptx
Compose camp 2.pptxCompose camp 2.pptx
Compose camp 2.pptx
 
Data Mining Lab Manual.docx
Data Mining Lab Manual.docxData Mining Lab Manual.docx
Data Mining Lab Manual.docx
 
The Ring programming language version 1.5.4 book - Part 10 of 185
The Ring programming language version 1.5.4 book - Part 10 of 185The Ring programming language version 1.5.4 book - Part 10 of 185
The Ring programming language version 1.5.4 book - Part 10 of 185
 
1 introduction computer graphics
1 introduction computer graphics1 introduction computer graphics
1 introduction computer graphics
 
Learn Java 3D
Learn Java 3D Learn Java 3D
Learn Java 3D
 
The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88
 
Publishing geoprocessing-services-tutorial
Publishing geoprocessing-services-tutorialPublishing geoprocessing-services-tutorial
Publishing geoprocessing-services-tutorial
 

Dernier

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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled 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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Dernier (20)

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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
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...
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
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)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Cs3241 Lab 8

  • 1. Display List Texture Mapping CS3241 Lab 8
  • 2. Objective Display List Understanding the benefit & limitation Setup Display List Texturing Understanding basic texture mapping Specify a texture image Generated by program, e.g. checkerboard Loaded from file Using texture object Supply texture co-ordinate
  • 3. Display List vs Immediate Mode Faster As geometries are cached See the difference (sample program loading dino) Once setup, cannot be changed
  • 4. Display List Generating empty display list (init) baseId = glGenLists(range); Setup the list (init) glNewList(id, GL_COMPILE); // your draw code glEndList(); Using the list (display) glCallList(id);
  • 5. Task 1 Task 1.1 Use display list to draw a teapot Task 1.2 Use display list to draw 4 wheels attaching the teapot So we have the body and wheels. What’s next? Animation Loading Mesh Texturing Material…..
  • 6. Texture Enabling /Disabling Texture Mapping glEnable/glDisable(GL_TEXTURE_1D); glEnable/glDisable(GL_TEXTURE_2D);
  • 7. Texture Object Better texture management Generate texture name (init) GLuinttexObj; // global glGenTextures(1, &texObj);// init() Bind texture Object to texture data (init) glBindTexture(GL_TEXTURE_2D, texObj); glTexParameter*(); // setup parameter glTexImage2D(…..); // alloc space & copy texture map Using texture Object (display) glBindTexture(GL_TEXTURE_2D, texObj); glutSolidTeapot(1); TextureName (Gluint) Parameter Texture Data Texture Object
  • 8. Texture Parameters Repeating / Clamping Direction – s/t Repeating Clamping
  • 10. Texture Coordinate To supply texture coordinate to a vertex Add glTexCoord2f(s, t); before specifying the vertex E.g. glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); ….. glEnd(); 5,5 5,0 0,0 0,5
  • 11. Task 2 Task 2.1 Load a texture from program generated source / file Apply to Teapot Task 2.2 Supply texture co-ordinate to a plane Apply the texture in 2.1 to the plane
  • 12. Example Modeling a car Separating different part of the mesh For animating the front wheel can move according to key in:P All the wheels will rotate according to its speed For having different texture/material Try to extend it by putting better mesh :P