SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
iPhone 3D
                         Programming
                         Chapter 02. Math and Metaphors



                                            2012. 01. 26.
                                            Sanghoon Lee


Sunday, December 9, 12
수학과 비유
                         Graphics Rendering Pipeline & Metaphor

                         Transforms

                         Matrix stack

                         Vector Beautification with C++

                         HelloCone



Sunday, December 9, 12
Sunday, December 9, 12
What we’re going to study!




Sunday, December 9, 12
Different kind of topology




Sunday, December 9, 12
Different kind of topology




                         The first argument specifies the topology




Sunday, December 9, 12
Drawing rectangle




Sunday, December 9, 12
Properties with Vertices




Sunday, December 9, 12
Setting vertex properties examples




Sunday, December 9, 12
Homogeneous coordinates

                    Internally, the OpenGL implementation always converts it
                   into a 4D floating-point number.

                   It’s an artificial construction that allows all transformations to
                   be represented with matrix multiplication.

                    These 4D coordinates are known as homogeneous
                   coordinates.


                   So, shortly after entering the assembly line, all vertex
                   positions become 4D; don’t they need to become 2D at some
                   point? The answer is yes.



Sunday, December 9, 12
The Life of a Vertex

                         Perspective transform   ( removal of w )




Sunday, December 9, 12
Vertex goes from 4D to 2D




                         Early life of a vertex. Top row is conceptual;
                         bottom row is OpenGL’s view

Sunday, December 9, 12
Vertex goes from 4D to 2D




Sunday, December 9, 12
The photography metaphor


                  1. Arrange the various dishes on the table.
                  2. Arrange one or more light sources.
                  3. Position the camera.
                  4. Aim the camera toward the food.
                  5. Adjust the zoom lens.
                  6. Snap the picture.


                                 1. Adjust the camera’s field-of-view angle. (projection matrix)
                                 2. Position the camera and aim it in the appropriate direction.
                                 (view matrix)
                                 3. For each object:
                                    a. Scale, rotate, and translate. (model matrix)
                                    b. Render the object.



Sunday, December 9, 12
ES 1.1




                         ES 2.0




Sunday, December 9, 12
Matrix Multiplication




Sunday, December 9, 12
Model Matrix
                         The three most common operations when
                              positioning an object in a scene

                            Scale

                            Translation

                            Rotation




Sunday, December 9, 12
Setting the Model Matrix (Scale)




Sunday, December 9, 12
Setting the Model Matrix (Scale)




Sunday, December 9, 12
Setting the Model Matrix (Translation)




Sunday, December 9, 12
Setting the Model Matrix (Translation)




Sunday, December 9, 12
Setting the Model Matrix (Rotation ES 1.1)




                            glRotatef(m_currentAngle, 0, 0, 1);


                         counter-clockwise rotation about the Z-axis
                                      angle in degrees
       the latter three arguments define the axis of rotation


Sunday, December 9, 12
Setting the Model Matrix (Rotation ES 2.0)




Sunday, December 9, 12
Setting the Model Matrix (Rotation)

                arbitrary axis rotation
                     * ES 1.1
                       glRotatef generates the matrix for you
                       glRotatef only rotates about the origin




Sunday, December 9, 12
Setting the Model Matrix (Rotation)

                arbitrary axis rotation
                     * ES 2.0




Sunday, December 9, 12
What we have been through




Sunday, December 9, 12
Setting the View Transform




Sunday, December 9, 12
Setting the View Transform

                   The simplest way to create a view matrix




Sunday, December 9, 12
Setting the Projection Transform




                   think of the projection as being the camera's
                                    "zoom lens"




Sunday, December 9, 12
Setting the Projection Transform




                                          ES 1.1

Sunday, December 9, 12
Setting the Projection Transform

            Perspective                                 Orthographic




                                          ES 2.0

Sunday, December 9, 12
Matrix stacks


Sunday, December 9, 12
Matrix stacks




Sunday, December 9, 12
Matrix stacks




                                  Only ES 1.1 supports
                         You need to create by yourself in ES 2.0

Sunday, December 9, 12
Interpolations




Sunday, December 9, 12
Example of
                         easing equations




Sunday, December 9, 12
Quaternions

                         For position keyframes and color keyframes

                                      It's easy

                         What if interpolating between two
                         orientations?



Sunday, December 9, 12
Quaternions

                         Storing an angle for each joint would be
                         insufficient

                         you'd also need the axis of rotation

                         This is known as Axis-Angle notation

                         requires a total of four floating-point values for
                         each joint



Sunday, December 9, 12
Quaternions

                         Storing an angle for each joint would be
                         insufficient

                         you'd also need the axis of rotation
                                Quaternions
                         This is known as Axis-Angle notation

                         requires a total of four floating-point values for
                         each joint



Sunday, December 9, 12
Quaternions

                         Storing an angle for each joint would be
                         insufficient
                                    Study of rotation
                         you'd also need the axis
                                                  and
                         This is understand it!!
                                 known as Axis-Angle notation

                         requires a total of four floating-point values for
                         each joint



Sunday, December 9, 12
Vector Beautification
                   template <typename T>                                             Vector3 Cross(const Vector3& v) const
                   struct Vector3 {                                                  {
                                                                                         return Vector3(y * v.z - z * v.y,
                         Vector3() {}                                                    z * v.x - x * v.z,
                         Vector3(T x, T y, T z) : x(x), y(y), z(z) {}                    x * v.y - y * v.x);
                         void Normalize()                                            }
                         {                                                           T Dot(const Vector3& v) const
                              float length = std::sqrt(x * x + y * y + z * z);        {
                              x /= length;                                               return x * v.x + y * v.y + z * v.z;
                              y /= length;                                           }
                              z /= length;                                           Vector3 operator-() const
                         }                                                           {
                                                                                         return Vector3(-x, -y, -z);
                         Vector3 Normalized() const                                  }
                         {
                             Vector3 v = *this;                                      bool operator==(const Vector3& v) const
                             v.Normalize();                                          {
                             return v;                                                    return x == v.x && y == v.y && z == v.z;
                         }                                                           }

                                                                                     T x;
                                                                                     T y;
                                                                                     T z;
                                                                                };


Sunday, December 9, 12
Vector Beautification
                  vec3 z;
                  normalize(&z, &(eye-target));

                  vec3 cross;
                                                  vec3 z = (eye - target).Normalized();
                  cross(&cross, &up, &z);
                  vec3 x;
                                                  vec3 x = up.Cross(z).Normalized();
                  normalize(&x, &cross);

                                                  vec3 y = z.Cross(x).Normalized();
                  cross(&cross, &up, &z);
                  vec3 y;
                  normalize(&y, &cross);




Sunday, December 9, 12
Hello Cone
                         Fixed Function




Sunday, December 9, 12
Hello Cone
                          Shaders




Sunday, December 9, 12
Further study


                         Graphics Rendering pipeline



                         Quaternion



Sunday, December 9, 12
Q/A




Sunday, December 9, 12

Más contenido relacionado

Último

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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
[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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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
 
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
 

Último (20)

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?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
[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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
+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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

아이폰 3D 프로그래밍 챕터2

  • 1. iPhone 3D Programming Chapter 02. Math and Metaphors 2012. 01. 26. Sanghoon Lee Sunday, December 9, 12
  • 2. 수학과 비유 Graphics Rendering Pipeline & Metaphor Transforms Matrix stack Vector Beautification with C++ HelloCone Sunday, December 9, 12
  • 4. What we’re going to study! Sunday, December 9, 12
  • 5. Different kind of topology Sunday, December 9, 12
  • 6. Different kind of topology The first argument specifies the topology Sunday, December 9, 12
  • 9. Setting vertex properties examples Sunday, December 9, 12
  • 10. Homogeneous coordinates Internally, the OpenGL implementation always converts it into a 4D floating-point number. It’s an artificial construction that allows all transformations to be represented with matrix multiplication. These 4D coordinates are known as homogeneous coordinates. So, shortly after entering the assembly line, all vertex positions become 4D; don’t they need to become 2D at some point? The answer is yes. Sunday, December 9, 12
  • 11. The Life of a Vertex Perspective transform ( removal of w ) Sunday, December 9, 12
  • 12. Vertex goes from 4D to 2D Early life of a vertex. Top row is conceptual; bottom row is OpenGL’s view Sunday, December 9, 12
  • 13. Vertex goes from 4D to 2D Sunday, December 9, 12
  • 14. The photography metaphor 1. Arrange the various dishes on the table. 2. Arrange one or more light sources. 3. Position the camera. 4. Aim the camera toward the food. 5. Adjust the zoom lens. 6. Snap the picture. 1. Adjust the camera’s field-of-view angle. (projection matrix) 2. Position the camera and aim it in the appropriate direction. (view matrix) 3. For each object: a. Scale, rotate, and translate. (model matrix) b. Render the object. Sunday, December 9, 12
  • 15. ES 1.1 ES 2.0 Sunday, December 9, 12
  • 17. Model Matrix The three most common operations when positioning an object in a scene Scale Translation Rotation Sunday, December 9, 12
  • 18. Setting the Model Matrix (Scale) Sunday, December 9, 12
  • 19. Setting the Model Matrix (Scale) Sunday, December 9, 12
  • 20. Setting the Model Matrix (Translation) Sunday, December 9, 12
  • 21. Setting the Model Matrix (Translation) Sunday, December 9, 12
  • 22. Setting the Model Matrix (Rotation ES 1.1) glRotatef(m_currentAngle, 0, 0, 1); counter-clockwise rotation about the Z-axis angle in degrees the latter three arguments define the axis of rotation Sunday, December 9, 12
  • 23. Setting the Model Matrix (Rotation ES 2.0) Sunday, December 9, 12
  • 24. Setting the Model Matrix (Rotation) arbitrary axis rotation * ES 1.1 glRotatef generates the matrix for you glRotatef only rotates about the origin Sunday, December 9, 12
  • 25. Setting the Model Matrix (Rotation) arbitrary axis rotation * ES 2.0 Sunday, December 9, 12
  • 26. What we have been through Sunday, December 9, 12
  • 27. Setting the View Transform Sunday, December 9, 12
  • 28. Setting the View Transform The simplest way to create a view matrix Sunday, December 9, 12
  • 29. Setting the Projection Transform think of the projection as being the camera's "zoom lens" Sunday, December 9, 12
  • 30. Setting the Projection Transform ES 1.1 Sunday, December 9, 12
  • 31. Setting the Projection Transform Perspective Orthographic ES 2.0 Sunday, December 9, 12
  • 34. Matrix stacks Only ES 1.1 supports You need to create by yourself in ES 2.0 Sunday, December 9, 12
  • 36. Example of easing equations Sunday, December 9, 12
  • 37. Quaternions For position keyframes and color keyframes It's easy What if interpolating between two orientations? Sunday, December 9, 12
  • 38. Quaternions Storing an angle for each joint would be insufficient you'd also need the axis of rotation This is known as Axis-Angle notation requires a total of four floating-point values for each joint Sunday, December 9, 12
  • 39. Quaternions Storing an angle for each joint would be insufficient you'd also need the axis of rotation Quaternions This is known as Axis-Angle notation requires a total of four floating-point values for each joint Sunday, December 9, 12
  • 40. Quaternions Storing an angle for each joint would be insufficient Study of rotation you'd also need the axis and This is understand it!! known as Axis-Angle notation requires a total of four floating-point values for each joint Sunday, December 9, 12
  • 41. Vector Beautification template <typename T> Vector3 Cross(const Vector3& v) const struct Vector3 { { return Vector3(y * v.z - z * v.y, Vector3() {} z * v.x - x * v.z, Vector3(T x, T y, T z) : x(x), y(y), z(z) {} x * v.y - y * v.x); void Normalize() } { T Dot(const Vector3& v) const float length = std::sqrt(x * x + y * y + z * z); { x /= length; return x * v.x + y * v.y + z * v.z; y /= length; } z /= length; Vector3 operator-() const } { return Vector3(-x, -y, -z); Vector3 Normalized() const } { Vector3 v = *this; bool operator==(const Vector3& v) const v.Normalize(); { return v; return x == v.x && y == v.y && z == v.z; } } T x; T y; T z; }; Sunday, December 9, 12
  • 42. Vector Beautification vec3 z; normalize(&z, &(eye-target)); vec3 cross; vec3 z = (eye - target).Normalized(); cross(&cross, &up, &z); vec3 x; vec3 x = up.Cross(z).Normalized(); normalize(&x, &cross); vec3 y = z.Cross(x).Normalized(); cross(&cross, &up, &z); vec3 y; normalize(&y, &cross); Sunday, December 9, 12
  • 43. Hello Cone Fixed Function Sunday, December 9, 12
  • 44. Hello Cone Shaders Sunday, December 9, 12
  • 45. Further study Graphics Rendering pipeline Quaternion Sunday, December 9, 12