This document contains lecture notes on computer graphics. It covers topics such as raster displays, curves, transformations, 3D objects, camera models, visibility, lighting and reflection. The notes are from a computer graphics course at the University of Toronto and are copyrighted.
This document is a user's guide for version 1.21 of the cvx modeling tool for convex optimization problems. Cvx allows users to specify convex problems in a simple way and solves them using solvers like SeDuMi and SDPT3. The guide explains what cvx is, how to get started using it, the rules it follows to ensure problems are convex, and how to model different types of convex problems. It also covers advanced topics like semidefinite and geometric programming.
This document provides an overview and outline of computer graphics lecture notes. It covers topics such as raster displays, basic line drawing, curves, transformations, 3D objects, camera models, visibility, lighting and reflection. The document was created by the Computer Science Department at the University of Toronto for a computer graphics course and is copyrighted.
This document provides an introduction to using R, an open-source programming language and software environment for statistical analysis and graphics. It covers basic R operations like vectors, arrays, matrices, data frames, reading data, probability distributions, and writing functions. The document contains copyright information and a table of contents describing its 10 chapters on getting started with R and its core functionality.
The document discusses spherical harmonics and their properties and applications. Spherical harmonics are orthogonal functions defined on the surface of a sphere that can be used to represent functions defined over the spherical domain, similar to how Fourier series represent functions over a 1D or 2D domain. The document first reviews mathematical fundamentals including orthogonal functions and spherical coordinates. It then defines spherical harmonics and describes some of their key properties such as rotational invariance. Finally, it discusses two applications of spherical harmonics in computer graphics: representing environment maps and performing real-time spherical harmonic lighting calculations for dynamic scenes.
This document is a draft of a textbook titled "Applied Calculus" written by Karl Heinz Dovermann, a professor of mathematics at the University of Hawaii. It is dedicated to his wife and sons. The textbook covers topics in calculus including definitions of derivatives, integrals, and applications of calculus through 12 chapters with sections on background concepts, derivatives, applications of derivatives, integration, and prerequisites from precalculus.
This document is a book about programming in CSharp that was written by Willi-Hans Steeb and E.J. Dembskey. It covers many topics related to CSharp including basics, object-oriented programming concepts, streams, files, graphics, events, and processes/threads. The table of contents lists over 20 chapters that delve into these various aspects of the CSharp programming language.
This document describes a project to create a realistic car driving simulation using rigid body dynamics and physics modeling. It outlines the objectives to physically simulate driving a car using a 3D OpenGL environment. The simulation will include realistic graphics rendering, as well as modeling forces like braking, acceleration and tire traction. It discusses prior work in flight and racing simulations and the techniques that will be implemented, such as bump mapping, environment mapping, lighting effects and motion blur. The document also covers integrating controls, sound and developing a racing game interface. Overall goals are to achieve high simulation accuracy and stability for a realistic driving experience.
This document provides an introduction and overview of data structures and algorithms. It discusses linked lists, binary search trees, heaps, sets, queues, and the AVL tree data structure. It also covers sorting algorithms like merge sort, quicksort, and insertion sort as well as numeric algorithms for primality testing, base conversions, finding greatest common denominators, and more. The goal is to provide annotated references and examples of how to implement and use various common data structures and algorithms.
This document is a user's guide for version 1.21 of the cvx modeling tool for convex optimization problems. Cvx allows users to specify convex problems in a simple way and solves them using solvers like SeDuMi and SDPT3. The guide explains what cvx is, how to get started using it, the rules it follows to ensure problems are convex, and how to model different types of convex problems. It also covers advanced topics like semidefinite and geometric programming.
This document provides an overview and outline of computer graphics lecture notes. It covers topics such as raster displays, basic line drawing, curves, transformations, 3D objects, camera models, visibility, lighting and reflection. The document was created by the Computer Science Department at the University of Toronto for a computer graphics course and is copyrighted.
This document provides an introduction to using R, an open-source programming language and software environment for statistical analysis and graphics. It covers basic R operations like vectors, arrays, matrices, data frames, reading data, probability distributions, and writing functions. The document contains copyright information and a table of contents describing its 10 chapters on getting started with R and its core functionality.
The document discusses spherical harmonics and their properties and applications. Spherical harmonics are orthogonal functions defined on the surface of a sphere that can be used to represent functions defined over the spherical domain, similar to how Fourier series represent functions over a 1D or 2D domain. The document first reviews mathematical fundamentals including orthogonal functions and spherical coordinates. It then defines spherical harmonics and describes some of their key properties such as rotational invariance. Finally, it discusses two applications of spherical harmonics in computer graphics: representing environment maps and performing real-time spherical harmonic lighting calculations for dynamic scenes.
This document is a draft of a textbook titled "Applied Calculus" written by Karl Heinz Dovermann, a professor of mathematics at the University of Hawaii. It is dedicated to his wife and sons. The textbook covers topics in calculus including definitions of derivatives, integrals, and applications of calculus through 12 chapters with sections on background concepts, derivatives, applications of derivatives, integration, and prerequisites from precalculus.
This document is a book about programming in CSharp that was written by Willi-Hans Steeb and E.J. Dembskey. It covers many topics related to CSharp including basics, object-oriented programming concepts, streams, files, graphics, events, and processes/threads. The table of contents lists over 20 chapters that delve into these various aspects of the CSharp programming language.
This document describes a project to create a realistic car driving simulation using rigid body dynamics and physics modeling. It outlines the objectives to physically simulate driving a car using a 3D OpenGL environment. The simulation will include realistic graphics rendering, as well as modeling forces like braking, acceleration and tire traction. It discusses prior work in flight and racing simulations and the techniques that will be implemented, such as bump mapping, environment mapping, lighting effects and motion blur. The document also covers integrating controls, sound and developing a racing game interface. Overall goals are to achieve high simulation accuracy and stability for a realistic driving experience.
This document provides an introduction and overview of data structures and algorithms. It discusses linked lists, binary search trees, heaps, sets, queues, and the AVL tree data structure. It also covers sorting algorithms like merge sort, quicksort, and insertion sort as well as numeric algorithms for primality testing, base conversions, finding greatest common denominators, and more. The goal is to provide annotated references and examples of how to implement and use various common data structures and algorithms.
Reconstruction of Surfaces from Three-Dimensional Unorganized Point Sets / Ro...Robert Mencl
This document is a dissertation written by Robert Mencl to earn a Doctor of Natural Sciences degree from the University of Dortmund. The dissertation proposes a new algorithm for reconstructing surfaces from unorganized 3D point clouds. The algorithm uses the Euclidean minimum spanning tree to create an environment graph, then incrementally constructs the surface by adding triangles while ensuring the resulting triangles satisfy necessary conditions to approximate the underlying surface. The dissertation provides detailed descriptions of the algorithm's components and theoretical analysis to prove properties like the triangles constructed will have bounded edge lengths and converge to the natural neighbor embedding of the surface.
The report discusses my version of the arcade game Arcanoid. My version of
Arcanoid is developed as the project for the Computer Graphics course. The
report presents the logic and concepts for building the geometries, navigation,
collision detection and reflection techniques used to build my version of the
game. It also lists the features available in my version of the game.
This document is a reference manual for Pajek, a program for analyzing and visualizing large networks. Pajek was developed in 1996 and is implemented in Delphi. It allows users to load, analyze, visualize and export large networks with thousands or millions of nodes. The manual describes Pajek's commands and functions for network analysis, visualization and exporting network images.
This document presents the preliminary design of a floating offshore wind turbine (FOWT) structure. It includes calculations for buoyancy, statics, and damage stability in intact and damage conditions. Structural members such as cylinders, stringers, decks, bulkheads, and crossbeams are designed and sized. Mooring line and ballasting systems are also analyzed. The design aims to develop a stable FOWT structure that meets classification society rules for safety in various operating conditions.
This document provides an introduction and overview to R, a programming environment for statistical analysis and graphics. It covers basic R syntax and functions for working with vectors, arrays, matrices, factors, lists and data frames. The document also discusses getting help, executing commands interactively or from files, and setting and removing objects in the R environment. It serves as a starting point for learning the core functionality of R.
This document provides an introduction to using the R programming environment for data analysis and graphics. It covers basic R concepts like vectors, matrices, arrays, factors, lists and data frames. It also describes how to perform common data manipulations and access help documentation. The document is copyrighted by the R Development Core Team and permission is granted to distribute verbatim or modified copies.
This document provides an introduction to using the R programming environment. It covers basic topics like vectors, factors, arrays, matrices, lists and data frames. The document is copyrighted by multiple individuals and development teams between 1990-2010. Permission is granted to distribute verbatim or modified copies of the manual under certain conditions.
This document provides an introduction to object-oriented programming concepts like classes, objects, inheritance and polymorphism. It also introduces the C++ programming language, starting from the C language basics and expanding on object-oriented features in C++ like classes, objects, constructors and destructors. The document uses a case study of implementing a generic singly linked list in C++ to demonstrate templates, iterators and other OOP concepts.
This document provides an introduction to using the R programming environment. It covers basic topics like vectors, arrays, matrices, factors, lists and data frames. It also discusses R's interactive features and how to get help. The document is copyrighted by W.N. Venables, D.M. Smith and others involved in the R Development Core Team between 1990-2010. Permission is granted to distribute copies of the manual.
This document provides an outline for a seminar on computer graphics. It begins with basics of computer graphics including definitions, classifications, and principles. It then covers topics like computer-aided design, presentation graphics, computer art, entertainment, education and training, and visualization. Graphics devices, output primitives, displays, and input devices are discussed. Drawing points, lines, polygons, and transformations are explained. 3D concepts like parallel projection, perspective projection, and object representations are introduced. The document also covers color models, animations, graphics processing units, and the OpenGL graphics library. It provides examples of functions for initializing and creating windows in OpenGL.
This document provides an overview of HTML, CSS, and JavaScript. It discusses how HTML is used to define the structure and layout of web pages using markup tags, how CSS is used to style web pages, and how JavaScript can be used to add interactive elements. It also covers common HTML tags for headings, paragraphs, lists, and other content sections. Key elements like <head> and <body> are explained along with common tags used in each section.
This document provides an overview of computer graphics hardware and software. It discusses what computer graphics are, common applications like movies, games and scientific visualization, and hardware like CRT, LCD and plasma displays. It also covers computer graphics software topics such as rendering primitives, algorithms for transformations and rasterization, and application programming interfaces. The graphics rendering pipeline that converts 3D scenes to 2D images is also summarized.
This document provides an overview of computer graphics and its applications. It discusses interactive graphics, where the user can control the image, versus passive graphics which produce images automatically. Interactive graphics allow for advantages like motion dynamics and update dynamics. The document then covers how interactive graphics displays work, using a frame buffer, monitor, and display controller. It concludes with a discussion of various applications of computer graphics, such as cartography, user interfaces, scientific visualization, CAD/CAM, simulation, art, process control and more.
This document provides an introduction to computer graphics. It defines computer graphics as the creation, storage, and manipulation of pictures and drawings using digital computers. Computer graphics is used across diverse fields such as engineering, medicine, education, entertainment, and more. The document discusses basic terms related to display devices such as pixels, resolution, color depth, and frame buffers. It also describes different types of display devices including raster scan displays, random scan displays, direct view storage tubes, flat panel displays, and stereoscopic displays. Applications of computer graphics such as design, image processing, animation, simulation, and medical imaging are also summarized.
This document contains lecture notes for a computer graphics course. It covers topics such as raster displays, basic line drawing, curves, transformations, 3D objects, camera models, visibility, lighting, reflection, texture mapping, and distribution ray tracing. The notes are copyrighted and provide an overview and explanations of fundamental computer graphics algorithms and concepts.
Bresenham's line algorithm is an efficient method for drawing lines on a discrete grid such as a display. It works by calculating the next pixel to plot along the line based on the difference between the true and discrete slopes. It starts at the initial point and calculates a decision variable di to determine whether to plot the next point horizontally or diagonally. This variable is updated using the slope to continually track the closest path to the true line.
COMPUTER APPLICATIONS IN EDUCATION,GRAPHICS & MULTIMEDIASelf employed
download it first because it contains .gif images and videos.
Works well with microsoft office 13
Catchy slides will help you to score marks at the best ..
This document discusses various 3D geometric transformations including translation, scaling, rotation, and coordinate transformations. It provides details on:
1) How translation, uniform scaling, and relative scaling transformations work in 3D space.
2) How rotations around the x, y, z axes as well as general 3D rotations around arbitrary axes are performed.
3) How quaternions can be used to represent rotations and how rotation matrices are derived from quaternions.
4) How reflections, shears, and different coordinate systems require coordinate transformations between systems.
This document provides an overview of animation, including its definition, categories, techniques, principles, and file formats. It defines animation as bringing images to life by varying visual properties over time. There are two main categories: cell animation involving hand-drawn frames, and computer animation which can be 2D or 3D. Basic animation techniques include drawn, cut-out, model, and computer animation. Principles like squash and stretch, anticipation, and timing are described. Common file formats and animation software are also listed.
Do Not just learn computer graphics an close your computer tab and go away..
APPLY them in real business,
Visit Daroko blog for real IT skills applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More IT related subject.
-simply google:Daroko blog(professionalbloggertricks.com)
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer realate courses.ly
• Be practically real, not just academic reader
Computer graphics can be used in many fields such as design, presentations, entertainment, education, scientific visualization, and more. It allows users to visualize and interact with digital information through graphical interfaces and simulations. Some key applications of computer graphics include computer-aided design for engineering projects, creating presentation slides and illustrations, generating animations and movies for entertainment, developing simulations for training and education, and performing image processing and scientific visualization to analyze large datasets. Computer graphics technologies revolutionized how professionals work and how the general public accesses information through graphical user interfaces.
The document describes a course on computer graphics. It provides an overview of the course, stating that it aims to teach students how to generate and render realistic 3D objects through techniques like modeling, animation and simulation. The course progresses from basic fundamentals to more complex topics. It also provides a strong foundation for students interested in image processing research. The document then provides unit-wise details of the topics that will be covered in the course, including introduction to graphics systems, 2D and 3D transformations, viewing, visible surface detection, and computer animation.
Reconstruction of Surfaces from Three-Dimensional Unorganized Point Sets / Ro...Robert Mencl
This document is a dissertation written by Robert Mencl to earn a Doctor of Natural Sciences degree from the University of Dortmund. The dissertation proposes a new algorithm for reconstructing surfaces from unorganized 3D point clouds. The algorithm uses the Euclidean minimum spanning tree to create an environment graph, then incrementally constructs the surface by adding triangles while ensuring the resulting triangles satisfy necessary conditions to approximate the underlying surface. The dissertation provides detailed descriptions of the algorithm's components and theoretical analysis to prove properties like the triangles constructed will have bounded edge lengths and converge to the natural neighbor embedding of the surface.
The report discusses my version of the arcade game Arcanoid. My version of
Arcanoid is developed as the project for the Computer Graphics course. The
report presents the logic and concepts for building the geometries, navigation,
collision detection and reflection techniques used to build my version of the
game. It also lists the features available in my version of the game.
This document is a reference manual for Pajek, a program for analyzing and visualizing large networks. Pajek was developed in 1996 and is implemented in Delphi. It allows users to load, analyze, visualize and export large networks with thousands or millions of nodes. The manual describes Pajek's commands and functions for network analysis, visualization and exporting network images.
This document presents the preliminary design of a floating offshore wind turbine (FOWT) structure. It includes calculations for buoyancy, statics, and damage stability in intact and damage conditions. Structural members such as cylinders, stringers, decks, bulkheads, and crossbeams are designed and sized. Mooring line and ballasting systems are also analyzed. The design aims to develop a stable FOWT structure that meets classification society rules for safety in various operating conditions.
This document provides an introduction and overview to R, a programming environment for statistical analysis and graphics. It covers basic R syntax and functions for working with vectors, arrays, matrices, factors, lists and data frames. The document also discusses getting help, executing commands interactively or from files, and setting and removing objects in the R environment. It serves as a starting point for learning the core functionality of R.
This document provides an introduction to using the R programming environment for data analysis and graphics. It covers basic R concepts like vectors, matrices, arrays, factors, lists and data frames. It also describes how to perform common data manipulations and access help documentation. The document is copyrighted by the R Development Core Team and permission is granted to distribute verbatim or modified copies.
This document provides an introduction to using the R programming environment. It covers basic topics like vectors, factors, arrays, matrices, lists and data frames. The document is copyrighted by multiple individuals and development teams between 1990-2010. Permission is granted to distribute verbatim or modified copies of the manual under certain conditions.
This document provides an introduction to object-oriented programming concepts like classes, objects, inheritance and polymorphism. It also introduces the C++ programming language, starting from the C language basics and expanding on object-oriented features in C++ like classes, objects, constructors and destructors. The document uses a case study of implementing a generic singly linked list in C++ to demonstrate templates, iterators and other OOP concepts.
This document provides an introduction to using the R programming environment. It covers basic topics like vectors, arrays, matrices, factors, lists and data frames. It also discusses R's interactive features and how to get help. The document is copyrighted by W.N. Venables, D.M. Smith and others involved in the R Development Core Team between 1990-2010. Permission is granted to distribute copies of the manual.
This document provides an outline for a seminar on computer graphics. It begins with basics of computer graphics including definitions, classifications, and principles. It then covers topics like computer-aided design, presentation graphics, computer art, entertainment, education and training, and visualization. Graphics devices, output primitives, displays, and input devices are discussed. Drawing points, lines, polygons, and transformations are explained. 3D concepts like parallel projection, perspective projection, and object representations are introduced. The document also covers color models, animations, graphics processing units, and the OpenGL graphics library. It provides examples of functions for initializing and creating windows in OpenGL.
This document provides an overview of HTML, CSS, and JavaScript. It discusses how HTML is used to define the structure and layout of web pages using markup tags, how CSS is used to style web pages, and how JavaScript can be used to add interactive elements. It also covers common HTML tags for headings, paragraphs, lists, and other content sections. Key elements like <head> and <body> are explained along with common tags used in each section.
This document provides an overview of computer graphics hardware and software. It discusses what computer graphics are, common applications like movies, games and scientific visualization, and hardware like CRT, LCD and plasma displays. It also covers computer graphics software topics such as rendering primitives, algorithms for transformations and rasterization, and application programming interfaces. The graphics rendering pipeline that converts 3D scenes to 2D images is also summarized.
This document provides an overview of computer graphics and its applications. It discusses interactive graphics, where the user can control the image, versus passive graphics which produce images automatically. Interactive graphics allow for advantages like motion dynamics and update dynamics. The document then covers how interactive graphics displays work, using a frame buffer, monitor, and display controller. It concludes with a discussion of various applications of computer graphics, such as cartography, user interfaces, scientific visualization, CAD/CAM, simulation, art, process control and more.
This document provides an introduction to computer graphics. It defines computer graphics as the creation, storage, and manipulation of pictures and drawings using digital computers. Computer graphics is used across diverse fields such as engineering, medicine, education, entertainment, and more. The document discusses basic terms related to display devices such as pixels, resolution, color depth, and frame buffers. It also describes different types of display devices including raster scan displays, random scan displays, direct view storage tubes, flat panel displays, and stereoscopic displays. Applications of computer graphics such as design, image processing, animation, simulation, and medical imaging are also summarized.
This document contains lecture notes for a computer graphics course. It covers topics such as raster displays, basic line drawing, curves, transformations, 3D objects, camera models, visibility, lighting, reflection, texture mapping, and distribution ray tracing. The notes are copyrighted and provide an overview and explanations of fundamental computer graphics algorithms and concepts.
Bresenham's line algorithm is an efficient method for drawing lines on a discrete grid such as a display. It works by calculating the next pixel to plot along the line based on the difference between the true and discrete slopes. It starts at the initial point and calculates a decision variable di to determine whether to plot the next point horizontally or diagonally. This variable is updated using the slope to continually track the closest path to the true line.
COMPUTER APPLICATIONS IN EDUCATION,GRAPHICS & MULTIMEDIASelf employed
download it first because it contains .gif images and videos.
Works well with microsoft office 13
Catchy slides will help you to score marks at the best ..
This document discusses various 3D geometric transformations including translation, scaling, rotation, and coordinate transformations. It provides details on:
1) How translation, uniform scaling, and relative scaling transformations work in 3D space.
2) How rotations around the x, y, z axes as well as general 3D rotations around arbitrary axes are performed.
3) How quaternions can be used to represent rotations and how rotation matrices are derived from quaternions.
4) How reflections, shears, and different coordinate systems require coordinate transformations between systems.
This document provides an overview of animation, including its definition, categories, techniques, principles, and file formats. It defines animation as bringing images to life by varying visual properties over time. There are two main categories: cell animation involving hand-drawn frames, and computer animation which can be 2D or 3D. Basic animation techniques include drawn, cut-out, model, and computer animation. Principles like squash and stretch, anticipation, and timing are described. Common file formats and animation software are also listed.
Do Not just learn computer graphics an close your computer tab and go away..
APPLY them in real business,
Visit Daroko blog for real IT skills applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More IT related subject.
-simply google:Daroko blog(professionalbloggertricks.com)
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer realate courses.ly
• Be practically real, not just academic reader
Computer graphics can be used in many fields such as design, presentations, entertainment, education, scientific visualization, and more. It allows users to visualize and interact with digital information through graphical interfaces and simulations. Some key applications of computer graphics include computer-aided design for engineering projects, creating presentation slides and illustrations, generating animations and movies for entertainment, developing simulations for training and education, and performing image processing and scientific visualization to analyze large datasets. Computer graphics technologies revolutionized how professionals work and how the general public accesses information through graphical user interfaces.
The document describes a course on computer graphics. It provides an overview of the course, stating that it aims to teach students how to generate and render realistic 3D objects through techniques like modeling, animation and simulation. The course progresses from basic fundamentals to more complex topics. It also provides a strong foundation for students interested in image processing research. The document then provides unit-wise details of the topics that will be covered in the course, including introduction to graphics systems, 2D and 3D transformations, viewing, visible surface detection, and computer animation.
This document discusses the Daroko blog, which provides real-world applications of various IT skills. It encourages readers to not just learn computer graphics and other topics but to apply them in business contexts. The blog covers topics like computer graphics, networking, programming, IT jobs, technology news, blogging, website building, and IT companies. It aims to help readers gain practical experience applying their IT knowledge. Readers are instructed to search "Daroko blog" online to access resources on various IT subjects and their business applications.
The midpoint circle algorithm is similar to Bresenham's circle algorithm and uses the midpoint between pixels to determine whether the pixel is inside or outside a circle. It defines a decision parameter pi based on the midpoint and updates pi by integer amounts at each step to determine the next pixel along the circle. The initial value of pi is set to 5/4 - r when r is an integer to determine the first pixel.
The document discusses line drawing algorithms in computer graphics. It defines a line segment and provides equations to determine the slope and y-intercept of a line given two endpoints. It then introduces the Digital Differential Analyzer (DDA) algorithm, an incremental scan conversion method that calculates the next point on the line based on the previous point's coordinates and the line's slope. The algorithm involves less floating point computation than directly using the line equation at each step. An example demonstrates applying DDA to scan convert a line between two points. Limitations of DDA include the processing costs of rounding and floating point arithmetic as well as accumulated round-off error over long line segments.
The document discusses the history and development of chocolate over centuries. It details how cocoa beans were first used as currency by the Maya and Aztecs before being introduced to Europe in the 16th century. The document then explains how chocolate became popularized as a drink in Europe in the 17th century and how its production and consumption expanded globally over subsequent centuries.
The document discusses various topics related to computer graphics and video display devices. It begins with definitions of key terms like scan conversion and rasterization. It then discusses properties of video display devices like persistence and resolution. Various input and output devices are mentioned along with color display techniques. Concepts related to CRTs like beam retrace and frame buffers are explained. The document also covers graphics transformations, projections, animation, and algorithms like Bresenham's line drawing and Cohen-Sutherland line clipping.
This document is a lecture outline for an introduction to computer graphics course. It outlines the course information and administrative details, provides an overview of topics to be covered including graphics systems, techniques, operations and a mathematical review. It also defines computer graphics, discusses image processing and analysis, and explains why computer graphics is an important field due to advances in computing power, visualization, and interaction capabilities.
2 d transformations by amit kumar (maimt)Amit Kapoor
Transformations are operations that change the position, orientation, or size of an object in computer graphics. The main 2D transformations are translation, rotation, scaling, reflection, shear, and combinations of these. Transformations allow objects to be manipulated and displayed in modified forms without needing to redraw them from scratch.
This document provides an overview and introduction to computer graphics. It discusses graphics systems, common graphics primitives like lines, circles and filled areas, as well as techniques for clipping and geometric transformations. The document is divided into chapters that cover these topics at a high level, with sections and subsections that go into more technical details. It is intended to teach the fundamental concepts and algorithms in computer graphics.
He was a very compassionate and was very courageous. He
always remained ready to work for the cause of humanity. His
family was spiritually inclined and he had inherited this
inclination .This spiritual environment throw a deep impact on
his upbringing. From the very beginning he was a man of
ethics and values.
This document contains lecture notes for a computer graphics course. It covers topics such as raster displays, basic line drawing, curves, transformations, 3D objects, camera models, visibility, lighting, shading, texture mapping, ray tracing, and radiometry. The notes are copyrighted and were written by David Fleet and Aaron Hertzmann for students at the University of Toronto.
This document is an introduction to plasma physics that covers several key topics:
1. It defines plasma as a gas of charged particles and discusses the conditions needed for a plasma state, including debye shielding and plasma parameters.
2. It describes different models for plasma description including fluid, MHD, and two-fluid models. It also covers continuity, Euler, and state equations.
3. It discusses MHD equilibria and waves, including Alfven and magnetosonic modes.
4. It examines MHD discontinuities and shocks.
5. It presents the two-fluid description and generalized Ohm's law.
6. It explores waves in dispers
This document is the master's thesis of Tamás Martinec titled "Real-Time Non-Photorealistic Shadow Rendering". The thesis discusses non-photorealistic rendering (NPR) techniques, real-time shadow rendering algorithms, and presents an example of combining hatching-based NPR with shadow mapping to generate stylized shadows in real-time. The thesis is divided into chapters covering NPR techniques and styles, real-time shadow rendering methods, graphics hardware and shaders, and a demonstration implementing hatching and shadowed hatching shaders.
This document is a textbook on elementary linear algebra by K.R. Matthews from the University of Queensland. It contains 8 chapters that cover topics in linear equations, matrices, subspaces, determinants, complex numbers, eigenvalues and eigenvectors, identifying second degree equations, and three-dimensional geometry. Each chapter includes examples and problems related to the covered material.
This document provides an overview of vehicle dynamics and the key components involved, including the driver, vehicle, load, environment, tires, drive train, and road conditions. It discusses topics such as modeling aspects, reference frames, deterministic and random road profiles, tire forces and contact geometry, steady state forces and torques, tire dynamics, drive train components, wheel and tire eigen-dynamics, and performance of the drive train. The overall focus is on modeling and understanding the interaction between these various elements that influence vehicle motion.
This document provides an introduction to queueing theory, covering basic concepts from probability theory used in queueing models like random variables, generating functions, and common probability distributions. It then discusses fundamental queueing models and relations, including Kendall's notation for describing queueing systems and Little's Law relating average queue length and waiting time. Specific queueing models are analyzed like the M/M/1, M/M/c, M/Er/1, M/G/1, and G/M/1 queues.
This document provides an introduction to queueing theory. It discusses key concepts such as random variables, probability distributions, performance measures, Little's law and the PASTA property. It then examines several common queueing models including the M/M/1, M/M/c, M/Er/1, M/G/1 and G/M/1 queues. For each model it derives the equilibrium distribution and discusses measures like mean queue length and waiting time. The goal is to give an overview of basic queueing theory concepts and common single-server and multi-server queues.
This document provides an introduction to queueing theory. It discusses key concepts such as random variables, probability distributions, performance measures, Little's law and the PASTA property. It then examines several common queueing models including the M/M/1, M/M/c, M/Er/1, M/G/1 and G/M/1 queues. For each model it derives the equilibrium distribution and discusses measures like mean queue length and waiting time. The goal is to provide the fundamental mathematical techniques for analyzing queueing systems.
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFDmouhamedakremmouffouk
This document describes the aerodynamic development of an F1 racing car prototype using computational fluid dynamics (CFD). It discusses preprocessing such as surface repair, domain creation, meshing and setting boundary conditions. It also covers the solver settings including turbulence models and judging convergence. Finally, it discusses postprocessing including the importance of the front wing and analyzing the initial front wing design.
This document provides an entity relationship diagram (ERD) for Openbravo ERP. It separates the diagram into chapters for each of the main functional modules. Common tables and columns are identified. The tables follow a standard naming convention and include common fields like created date, updated date, active status, client and organization IDs. The document aims to provide a complete view of the underlying database structure of Openbravo ERP.
This document provides documentation for the NetworkX Python package for working with network graphs. It covers how to install NetworkX via quick install, from source, or pre-built packages. It describes requirements like Python and optional packages. It then provides a tutorial on NetworkX basics, examples, input/output, directed/undirected graphs, and interfacing with other tools.
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zinggRohit Bapat
This document provides an overview of computational fluid dynamics (CFD) and summarizes its key steps and concepts. It discusses the fundamentals of CFD, including conservation laws, governing equations, finite difference approximations, semi-discrete and finite volume methods, and time-marching algorithms. The document is intended to introduce readers to the basic theory and methods in CFD for modeling fluid flow and transport phenomena.
This document provides a summary of useful equations, conversion factors, color codes, and reference tables for electric circuits. It includes equations for DC circuits, capacitors, inductors, time constants, AC circuits, and decibels. It also includes tables on resistor and wire color codes, conductor properties, and algebra, trigonometry, and calculus references. The document was last updated on April 19, 2007 and is part of an open source textbook on electric circuits.
This document appears to be a course textbook that covers topics related to linear algebra including vectors, geometry, linear systems, matrices, and determinants. It includes sections on course goals, the subject matter, notes, computer labs, vectors and geometry, solving linear systems, matrices and determinants, and more. Subsections provide details on specific mathematical concepts and include examples and problems.
This document provides a detailed overview of the internals of the GNU debugger (GDB), including its overall structure, key algorithms, user interface, symbol handling, and other components. It describes GDB's symbol side for accessing program symbols and debugging information, target side for communicating with the debugged process, and configurations for different operating systems and architectures. The document also examines GDB's algorithms for tasks like breakpoint handling, single stepping, watchpoints, and unwinds stack frames to locate values. It provides details on GDB's UI, use of libgdb for CLI support, handling of values and types, and support for various object file and debugging formats.
This document provides a tutorial on learning C++. It introduces fundamental C++ concepts like objects, data types, functions, classes and pointers. It is divided into chapters that cover getting started, decision making, loops, functions, structs, references, classes and pointers. Each chapter defines and provides examples for the core elements of C++ programming in that topic area.
A buffer overflow study attacks and defenses (2002)Aiim Charinthip
This document provides an overview of buffer overflow attacks and defenses. It discusses stack and heap overflows, and how programs can be exploited by overwriting memory buffers. It then summarizes various protection solutions, including Libsafe and the Grsecurity kernel patch, which make the stack and heap non-executable to prevent execution of injected code. The document serves as an introduction to buffer overflows and techniques for mitigating these vulnerabilities.
This document provides an introduction to using the R programming environment. It covers basic topics like vectors, factors, arrays, matrices, lists and data frames. The document is copyrighted by multiple individuals and development teams between 1990-2010. Permission is granted to distribute copies of the manual if the copyright notice is preserved.
Similar to Computer graphics lecturenotes_torontouniv (20)
1. Computer Graphics Lecture Notes
CSC418 / CSCD18 / CSC2504
Computer Science Department
University of Toronto
Version: November 24, 2006
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG
6. CSC418 / CSCD18 / CSC2504 Acknowledgements
Conventions and Notation
Vectors have an arrow over their variable name: v. Points are denoted with a bar instead: p.
¯
Matrices are represented by an uppercase letter.
When written with parentheses and commas separating elements, consider a vector to be a column
x
vector. That is, (x, y) = . Row vectors are denoted with square braces and no commas:
y
T
x
x y = (x, y)T = .
y
The set of real numbers is represented by R. The real Euclidean plane is R2 , and similarly Eu-
clidean three-dimensional space is R3 . The set of natural numbers (non-negative integers) is rep-
resented by N.
There are some notable differences between the conventions used in these notes and those found
in the course text. Here, coordinates of a point p are written as px , py , and so on, where the book
¯
uses the notation xp , yp , etc. The same is true for vectors.
Aside:
Text in “aside” boxes provide extra background or information that you are not re-
quired to know for this course.
Acknowledgements
Thanks to Tina Nicholl for feedback on these notes. Alex Kolliopoulos assisted with electronic
preparation of the notes, with additional help from Patrick Coleman.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG v
7. CSC418 / CSCD18 / CSC2504 Introduction to Graphics
1 Introduction to Graphics
1.1 Raster Displays
The screen is represented by a 2D array of locations called pixels.
Zooming in on an image made up of pixels
The convention in these notes will follow that of OpenGL, placing the origin in the lower left
corner, with that pixel being at location (0, 0). Be aware that placing the origin in the upper left is
another common convention.
One of 2N intensities or colors are associated with each pixel, where N is the number of bits per
pixel. Greyscale typically has one byte per pixel, for 28 = 256 intensities. Color often requires
one byte per channel, with three color channels per pixel: red, green, and blue.
Color data is stored in a frame buffer. This is sometimes called an image map or bitmap.
Primitive operations:
• setpixel(x, y, color)
Sets the pixel at position (x, y) to the given color.
• getpixel(x, y)
Gets the color at the pixel at position (x, y).
Scan conversion is the process of converting basic, low level objects into their corresponding
pixel map representations. This is often an approximation to the object, since the frame buffer is a
discrete grid.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 1
8. CSC418 / CSCD18 / CSC2504 Introduction to Graphics
Scan conversion of a circle
1.2 Basic Line Drawing
Set the color of pixels to approximate the appearance of a line from (x0 , y0 ) to (x1 , y1 ).
It should be
• “straight” and pass through the end points.
• independent of point order.
• uniformly bright, independent of slope.
The explicit equation for a line is y = mx + b.
Note:
Given two points (x0 , y0 ) and (x1 , y1 ) that lie on a line, we can solve for m and b for
the line. Consider y0 = mx0 + b and y1 = mx1 + b.
y −y
Subtract y0 from y1 to solve for m = x1 −x0 and b = y0 − mx0 .
1 0
Substituting in the value for b, this equation can be written as y = m(x − x0 ) + y0 .
Consider this simple line drawing algorithm:
int x
float m, y
m = (y1 - y0) / (x1 - x0)
for (x = x0; x <= x1; ++x) {
y = m * (x - x0) + y0
setpixel(x, round(y), linecolor)
}
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 2
9. CSC418 / CSCD18 / CSC2504 Introduction to Graphics
Problems with this algorithm:
• If x1 < x0 nothing is drawn.
Solution: Switch the order of the points if x1 < x0 .
• Consider the cases when m < 1 and m > 1:
(a) m < 1 (b) m > 1
A different number of pixels are on, which implies different brightness between the two.
1
Solution: When m > 1, loop over y = y0 . . . y1 instead of x, then x = m (y − y0 ) + x0 .
• Inefficient because of the number of operations and the use of floating point numbers.
Solution: A more advanced algorithm, called Bresenham’s Line Drawing Algorithm.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 3
10. CSC418 / CSCD18 / CSC2504 Curves
2 Curves
2.1 Parametric Curves
There are multiple ways to represent curves in two dimensions:
• Explicit: y = f (x), given x, find y.
Example:
The explicit form of a line is y = mx + b. There is a problem with this
representation–what about vertical lines?
• Implicit: f (x, y) = 0, or in vector form, f (¯) = 0.
p
Example:
The implicit equation of a line through p0 and p1 is
¯ ¯
(x − x0 )(y1 − y0 ) − (y − y0 )(x1 − x0 ) = 0.
Intuition:
– The direction of the line is the vector d = p1 − p0 .
¯ ¯
– So a vector from p0 to any point on the line must be parallel to d.
¯
– Equivalently, any point on the line must have direction from p0 perpendic-
¯
⊥
ular to d = (dy , −dx ) ≡ n.
This can be checked with d · d⊥ = (dx , dy ) · (dy , −dx ) = 0.
– So for any point p on the line, (¯ − p0 ) · n = 0.
¯ p ¯
Here n = (y1 − y0 , x0 − x1 ). This is called a normal.
– Finally, (¯ − p0 ) · n = (x − x0 , y − y0 ) · (y1 − y0 , x0 − x1 ) = 0. Hence, the
p ¯
line can also be written as:
(¯ − p0 ) · n = 0
p ¯
Example:
The implicit equation for a circle of radius r and center pc = (xc , yc ) is
¯
(x − xc )2 + (y − yc )2 = r2 ,
or in vector form,
2
p − pc
¯ ¯ = r2 .
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 4
11. CSC418 / CSCD18 / CSC2504 Curves
¯ ¯ ¯
• Parametric: p = f (λ) where f : R → R2 , may be written as p(λ) or (x(λ), y(λ)).
¯
Example:
A parametric line through p0 and p1 is
¯ ¯
p(λ) = p0 + λd,
¯ ¯
where d = p1 − p0 .
¯ ¯
Note that bounds on λ must be specified:
– Line segment from p0 to p1 : 0 ≤ λ ≤ 1.
¯ ¯
– Ray from p0 in the direction of p1 : 0 ≤ λ < ∞.
¯ ¯
– Line passing through p0 and p1 : −∞ < λ < ∞
¯ ¯
Example:
What’s the perpendicular bisector of the line segment between p0 and p1 ?
¯ ¯
– The midpoint is p(λ) where λ = 2 , that is, p0 + 1 d = p0 +¯1 .
¯ 1
¯ 2
¯ p
2
– The line perpendicular to p(λ) has direction parallel to the normal of p(λ),
¯ ¯
which is n = (y1 − y0 , −(x1 − x0 )).
Hence, the perpendicular bisector is the line ℓ(α) = p0 + 1 d + αn.
¯ 2
Example:
Find the intersection of the lines ¯ = p0 + λd0 and f (¯) = (¯ − p1 ) · n1 = 0.
l(λ) ¯ p p ¯
Substitute ¯ l(λ) into the implicit equation f (¯) to see what value of λ
p
satisfies it:
f ¯
l(λ) = p0 + λd0 − p1 · n1
¯ ¯
= λd0 · n1 − (¯1 − p0 ) · n1
p ¯
= 0
Therefore, if d0 · n1 = 0,
(¯1 − p0 ) · n1
p ¯
λ∗ = ,
d0 · n1
and the intersection point is ¯ ∗ ). If d0 · n1 = 0, then the two lines are parallel
l(λ
with no intersection or they are the same line.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 5
12. CSC418 / CSCD18 / CSC2504 Curves
Example:
The parametric form of a circle with radius r for 0 ≤ λ < 1 is
p(λ) = (r cos(2πλ), r sin(2πλ)).
¯
This is the polar coordinate representation of a circle. There are an infinite
number of parametric representations of most curves, such as circles. Can you
think of others?
An important property of parametric curves is that it is easy to generate points along a curve
by evaluating p(λ) at a sequence of λ values.
¯
2.1.1 Tangents and Normals
The tangent to a curve at a point is the instantaneous direction of the curve. The line containing
the tangent intersects the curve at a point. It is given by the derivative of the parametric form p(λ)
¯
with regard to λ. That is,
d¯(λ)
p dx(λ) dy(λ)
τ (λ) = = , .
dλ dλ dλ
The normal is perpendicular to the tangent direction. Often we normalize the normal to have unit
length. For closed curves we often talk about an inward-facing and an outward-facing normal.
When the type is unspecified, we are usually dealing with an outward-facing normal.
τ(λ)
n(λ) tangent
normal
p(λ)
curve
We can also derive the normal from the implicit form. The normal at a point p = (x, y) on a curve
¯
defined by f (¯) = f (x, y) = 0 is:
p
∂f (x, y) ∂f (x, y)
n(¯) = ∇f (¯)|p =
p p ¯ ,
∂x ∂y
Derivation:
For any curve in implicit form, there also exists a parametric representation p(λ) =
¯
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 6
13. CSC418 / CSCD18 / CSC2504 Curves
(x(λ), y(λ)). All points on the curve must satisfy f (¯) = 0. Therefore, for any
p
choice of λ, we have:
0 = f (x(λ), y(λ))
We can differentiate both side with respect to λ:
d
0 = f (x(λ), y(λ)) (1)
dλ
∂f dx(λ) ∂f dy(λ)
0 = + (2)
∂x dλ ∂y dλ
∂f ∂f dx(λ) dy(λ)
0 = , · , (3)
∂x ∂y dλ dλ
0 = ∇f (¯)|p · τ (λ)
p ¯ (4)
This last line states that the gradient is perpendicular to the curve tangent, which is
the definition of the normal vector.
Example:
The implicit form of a circle at the origin is: f (x, y) = x2 +y 2 −R2 = 0. The normal
at a point (x, y) on the circle is: ∇f = (2x, 2y).
Exercise: show that the normal computed for a line is the same, regardless of whether it is com-
puted using the parametric or implicit forms. Try it for another surface.
2.2 Ellipses
2 2
• Implicit: x2 + y2 = 1. This is only for the special case where the ellipse is centered at the
a b
origin with the major and minor axes aligned with y = 0 and x = 0.
b
a
• Parametric: x(λ) = a cos(2πλ), y(λ) = b sin(2πλ), or in vector form
a cos(2πλ)
p(λ) =
¯ .
b sin(2πλ)
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 7
14. CSC418 / CSCD18 / CSC2504 Curves
The implicit form of ellipses and circles is common because there is no explicit functional form.
This is because y is a multifunction of x.
2.3 Polygons
A polygon is a continuous, piecewise linear, closed planar curve.
• A simple polygon is non self-intersecting.
• A regular polygon is simple, equilateral, and equiangular.
• An n-gon is a regular polygon with n sides.
• A polygon is convex if, for any two points selected inside the polygon, the line segment
between them is completely contained within the polygon.
Example:
To find the vertices of an n-gon, find n equally spaced points on a circle.
r
θ
In polar coordinates, each vertex (xi , yi ) = (r cos(θi ), r sin(θi )), where θi = i 2π for
n
i = 0 . . . n − 1.
• To translate: Add (xc , yc ) to each point.
• To scale: Change r.
• To rotate: Add ∆θ to each θi .
2.4 Rendering Curves in OpenGL
OpenGL does not directly support rendering any curves other that lines and polylines. However,
you can sample a curve and draw it as a line strip, e.g.,:
float x, y;
glBegin(GL_LINE_STRIP);
for (int t=0 ; t <= 1 ; t += .01)
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 8
15. CSC418 / CSCD18 / CSC2504 Curves
computeCurve( t, &x, &y);
glVertex2f(x, y);
}
glEnd();
You can adjust the step-size to determine how many line segments to draw. Adding line segments
will increase the accuracy of the curve, but slow down the rendering.
The GLU does have some specialized libraries to assist with generating and rendering curves. For
example, the following code renders a disk with a hole in its center, centered about the z-axis.
GLUquadric q = gluNewQuadric();
gluDisk(q, innerRadius, outerRadius, sliceCount, 1);
gluDeleteQuadric(q);
See the OpenGL Reference Manual for more information on these routines.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 9
16. CSC418 / CSCD18 / CSC2504 Transformations
3 Transformations
3.1 2D Transformations
Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several
purposes:
1. Change coordinate frames (world, window, viewport, device, etc).
2. Compose objects of simple parts with local scale/position/orientation of one part defined
with regard to other parts. For example, for articulated objects.
3. Use deformation to create new shapes.
4. Useful for animation.
There are three basic classes of transformations:
1. Rigid body - Preserves distance and angles.
• Examples: translation and rotation.
2. Conformal - Preserves angles.
• Examples: translation, rotation, and uniform scaling.
3. Affine - Preserves parallelism. Lines remain lines.
• Examples: translation, rotation, scaling, shear, and reflection.
Examples of transformations:
• Translation by vector t: p1 = p0 + t.
¯ ¯
cos(θ) − sin(θ)
• Rotation counterclockwise by θ: p1 =
¯ p0 .
¯
sin(θ) cos(θ)
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 10
17. CSC418 / CSCD18 / CSC2504 Transformations
a 0
• Uniform scaling by scalar a: p1 =
¯ p.
¯
0 a 0
a 0
• Nonuniform scaling by a and b: p1 =
¯ p.
¯
0 b 0
1 h
• Shear by scalar h: p1 =
¯ p.
¯
0 1 0
−1 0
• Reflection about the y-axis: p1 =
¯ p.
¯
0 1 0
3.2 Affine Transformations
An affine transformation takes a point p to q according to q = F (¯) = A¯ + t, a linear transfor-
¯ ¯ ¯ p p
mation followed by a translation. You should understand the following proofs.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 11
18. CSC418 / CSCD18 / CSC2504 Transformations
• The inverse of an affine transformation is also affine, assuming it exists.
Proof:
Let q = A¯ + t and assume A−1 exists, i.e. det(A) = 0.
¯ p
Then A¯ = q − t, so p = A−1 q − A−1 t. This can be rewritten as p = B q + d,
p ¯ ¯ ¯ ¯ ¯
−1 −1
where B = A and d = −A t.
Note:
The inverse of a 2D linear transformation is
−1
a b 1 d −b
A−1 = = .
c d ad − bc −c a
• Lines and parallelism are preserved under affine transformations.
Proof:
To prove lines are preserved, we must show that q (λ) = F (¯
¯ l(λ)) is a line, where
p p ¯ = p0 + λd.
F (¯) = A¯ + t and l(λ) ¯
q (λ) = A¯ + t
¯ l(λ)
= A(¯0 + λd) + t
p
= (A¯0 + t) + λAd
p
This is a parametric form of a line through A¯0 + t with direction Ad.
p
• Given a closed region, the area under an affine transformation A¯ + t is scaled by det(A).
p
Note:
– Rotations and translations have det(A) = 1.
a 0
– Scaling A = has det(A) = ab.
0 b
– Singularities have det(A) = 0.
Example:
1 0
The matrix A = maps all points to the x-axis, so the area of any closed
0 0
region will become zero. We have det(A) = 0, which verifies that any closed
region’s area will be scaled by zero.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 12
19. CSC418 / CSCD18 / CSC2504 Transformations
• A composition of affine transformations is still affine.
Proof:
Let F1 (¯) = A1 p + t1 and F2 (¯) = A2 p + t2 .
p ¯ p ¯
Then,
F (¯) = F2 (F1 (¯))
p p
= A2 (A1 p + t1 ) + t2
¯
= A2 A1 p + (A2 t1 + t2 ).
¯
Letting A = A2 A1 and t = A2 t1 + t2 , we have F (¯) = A¯ + t, and this is an
p p
affine transformation.
3.3 Homogeneous Coordinates
Homogeneous coordinates are another way to represent points to simplify the way in which we
express affine transformations. Normally, bookkeeping would become tedious when affine trans-
formations of the form A¯ + t are composed. With homogeneous coordinates, affine transforma-
p
tions become matrices, and composition of transformations is as simple as matrix multiplication.
In future sections of the course we exploit this in much more powerful ways.
p
¯
With homogeneous coordinates, a point p is augmented with a 1, to form p =
¯ ˆ .
1
All points (α¯, α) represent the same point p for real α = 0.
p ¯
Given p in homogeneous coordinates, to get p, we divide p by its last component and discard the
ˆ ¯ ˆ
last component.
Example:
The homogeneous points (2, 4, 2) and (1, 2, 1) both represent the Cartesian point
(1, 2). It’s the orientation of p that matters, not its length.
ˆ
Many transformations become linear in homogeneous coordinates, including affine transforma-
tions:
qx a b px tx
= +
qy c d py ty
p
a b tx x
= py
c d ty
1
= A t p
ˆ
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 13
20. CSC418 / CSCD18 / CSC2504 Transformations
To produce q rather than q , we can add a row to the matrix:
ˆ ¯
a b tx
A t
q=
ˆ p = c d ty p.
ˆ ˆ
0T 1
0 0 1
This is linear! Bookkeeping becomes simple under composition.
Example:
F3 (F2 (F1 (¯))), where Fi (¯) = Ai (¯) + ti becomes M3 M2 M1 p, where Mi =
p p p ¯
Ai ti
.
0T 1
With homogeneous coordinates, the following properties of affine transformations become appar-
ent:
• Affine transformations are associative.
For affine transformations F1 , F2 , and F3 ,
(F3 ◦ F2 ) ◦ F1 = F3 ◦ (F2 ◦ F1 ).
• Affine transformations are not commutative.
For affine transformations F1 and F2 ,
F2 ◦ F1 = F1 ◦ F2 .
3.4 Uses and Abuses of Homogeneous Coordinates
Homogeneous coordinates provide a different representation for Cartesian coordinates, and cannot
be treated in quite the same way. For example, consider the midpoint between two points p1 = ¯
(1, 1) and p2 = (5, 5). The midpoint is (¯1 + p2 )/2 = (3, 3). We can represent these points
¯ p ¯
in homogeneous coordinates as p1 = (1, 1, 1) and p2 = (5, 5, 1). Directly applying the same
ˆ ˆ
computation as above gives the same resulting point: (3, 3, 1). However, we can also represent
these points as p′1 = (2, 2, 2) and p′2 = (5, 5, 1). We then have (ˆ′1 + p′2 )/2 = (7/2, 7/2, 3/2),
ˆ ˆ p ˆ
which cooresponds to the Cartesian point (7/3, 7/3). This is a different point, and illustrates that
we cannot blindly apply geometric operations to homogeneous coordinates. The simplest solution
is to always convert homogeneous coordinates to Cartesian coordinates. That said, there are
several important operations that can be performed correctly in terms of homogeneous coordinates,
as follows.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 14
21. CSC418 / CSCD18 / CSC2504 Transformations
Affine transformations. An important case in the previous section is applying an affine trans-
formation to a point in homogeneous coordinates:
q = F (¯) = A¯ + t
¯ p p (5)
ˆ ˆp
q = Aˆ = (x , y , 1)T
′ ′
(6)
It is easy to see that this operation is correct, since rescaling p does not change the result:
ˆ
ˆ p ˆp
A(αˆ) = α(Aˆ) = αˆ = (αx′ , αy ′ , α)T
q (7)
which is the same geometric point as q = (x′ , y ′ , 1)T
ˆ
Vectors. We can represent a vector v = (x, y) in homogeneous coordinates by setting the last
element of the vector to be zero: v = (x, y, 0). However, when adding a vector to a point, the point
ˆ
must have the third component be 1.
q = p+v
ˆ ˆ ˆ (8)
′ ′ T
(x , y , 1) = (xp , yp , 1) + (x, y, 0) (9)
The result is clearly incorrect if the third component of the vector is not 0.
Aside:
Homogeneous coordinates are a representation of points in projective geometry.
3.5 Hierarchical Transformations
It is often convenient to model objects as hierarchically connected parts. For example, a robot arm
might be made up of an upper arm, forearm, palm, and fingers. Rotating at the shoulder on the
upper arm would affect all of the rest of the arm, but rotating the forearm at the elbow would affect
the palm and fingers, but not the upper arm. A reasonable hierarchy, then, would have the upper
arm at the root, with the forearm as its only child, which in turn connects only to the palm, and the
palm would be the parent to all of the fingers.
Each part in the hierarchy can be modeled in its own local coordinates, independent of the other
parts. For a robot, a simple square might be used to model each of the upper arm, forearm, and
so on. Rigid body transformations are then applied to each part relative to its parent to achieve
the proper alignment and pose of the object. For example, the fingers are positioned to be in the
appropriate places in the palm coordinates, the fingers and palm together are positioned in forearm
coordinates, and the process continues up the hierarchy. Then a transformation applied to upper
arm coordinates is also applied to all parts down the hierarchy.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 15
22. CSC418 / CSCD18 / CSC2504 Transformations
3.6 Transformations in OpenGL
OpenGL manages two 4 × 4 transformation matrices: the modelview matrix, and the projection
matrix. Whenever you specify geometry (using glVertex), the vertices are transformed by the
current modelview matrix and then the current projection matrix. Hence, you don’t have to perform
these transformations yourself. You can modify the entries of these matrices at any time. OpenGL
provides several utilities for modifying these matrices. The modelview matrix is normally used to
represent geometric transformations of objects; the projection matrix is normally used to store the
camera transformation. For now, we’ll focus just on the modelview matrix, and discuss the camera
transformation later.
To modify the current matrix, first specify which matrix is going to be manipulated: use glMatrixMode(GL MODE
to modify the modelview matrix. The modelview matrix can then be initialized to the identity with
glLoadIdentity(). The matrix can be manipulated by directly filling its values, multiplying it
by an arbitrary matrix, or using the functions OpenGL provides to multiply the matrix by specific
transformation matrices (glRotate, glTranslate, and glScale). Note that these transforma-
tions right-multiply the current matrix; this can be confusing since it means that you specify
transformations in the reverse of the obvious order. Exercise: why does OpenGL right-multiply
the current matrix?
OpenGL provides a stacks to assist with hierarchical transformations. There is one stack for the
modelview matrix and one for the projection matrix. OpenGL provides routines for pushing and
popping matrices on the stack.
The following example draws an upper arm and forearm with shoulder and elbow joints. The
current modelview matrix is pushed onto the stack and popped at the end of the rendering, so,
for example, another arm could be rendered without the transformations from rendering this arm
affecting its modelview matrix. Since each OpenGL transformation is applied by multiplying a
matrix on the right-hand side of the modelview matrix, the transformations occur in reverse order.
Here, the upper arm is translated so that its shoulder position is at the origin, then it is rotated,
and finally it is translated so that the shoulder is in its appropriate world-space position. Similarly,
the forearm is translated to rotate about its elbow position, then it is translated so that the elbow
matches its position in upper arm coordinates.
glPushMatrix();
glTranslatef(worldShoulderX, worldShoulderY, 0.0f);
drawShoulderJoint();
glRotatef(shoulderRotation, 0.0f, 0.0f, 1.0f);
glTranslatef(-upperArmShoulderX, -upperArmShoulderY, 0.0f);
drawUpperArmShape();
glTranslatef(upperArmElbowX, upperArmElbowY, 0.0f);
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 16
23. CSC418 / CSCD18 / CSC2504 Transformations
drawElbowJoint();
glRotatef(elbowRotation, 0.0f, 0.0f, 1.0f);
glTranslatef(-forearmElbowX, -forearmElbowY, 0.0f);
drawForearmShape();
glPopMatrix();
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 17
24. CSC418 / CSCD18 / CSC2504 Coordinate Free Geometry
4 Coordinate Free Geometry
Coordinate free geometry (CFG) is a style of expressing geometric objects and relations that
avoids unnecessary reliance on any specific coordinate system. Representing geometric quantities
in terms of coordinates can frequently lead to confusion, and to derivations that rely on irrelevant
coordinate systems.
We first define the basic quantities:
1. A scalar is just a real number.
2. A point is a location in space. It does not have any intrinsic coordinates.
3. A vector is a direction and a magnitude. It does not have any intrinsic coordinates.
A point is not a vector: we cannot add two points together. We cannot compute the magnitude of
a point, or the location of a vector.
Coordinate free geometry defines a restricted class of operations on points and vectors, even though
both are represented as vectors in matrix algebra. The following operations are the only operations
allowed in CFG.
1. v : magnitude of a vector.
2. p1 + v1 = p2 , or v1 = p2 − p1 .: point-vector addition.
¯ ¯ ¯ ¯
3. v1 + v2 = v3 .: vector addition
4. αv1 = v2 : vector scaling. If α > 0, then v2 is a new vector with the same direction as v1 , but
magnitude α v1 . If α < 0, then the direction of the vector is reversed.
5. v1 · v2 : dot product = v1 v2 cos(θ), where θ is the angle between the vectors.
6. v1 × v2 : cross product, where v1 and v2 are 3D vectors. Produces a new vector perpedicular
to v1 and to v2 , with magnitude v1 v2 sin(θ). The orientation of the vector is determined
by the right-hand rule (see textbook).
7. i αi vi = v: Linear combination of vectors
8. i αi pi = p, if
¯ ¯ i αi = 1: affine combination of points.
9. i αi pi = v, if
¯ i αi = 0
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 18
25. CSC418 / CSCD18 / CSC2504 Coordinate Free Geometry
Example:
• p1 + (¯2 − p3 ) = p1 + v = p4 .
¯ p ¯ ¯ ¯
• α¯2 − α¯1 = αv1 = v2 .
p p
1
• (p
2 1
+ p2 ) = p1 + 1 (¯2 − p1 ) = p1 + 2 v = p3 .
2
p ¯ ¯ 1
¯
Note:
In order to understand these formulas, try drawing some pictures to illustrate different
cases (like the ones that were drawn in class).
Note that operations that are not in the list are undefined.
These operations have a number of basic properties, e.g., commutivity of dot product: v1 · v2 =
v2 · v1 , distributivity of dot product: v1 · (v2 + v3 ) = v1 · v2 + v1 · v3 .
CFG helps us reason about geometry in several ways:
1. When reasoning about geometric objects, we only care about the intrinsic geometric prop-
erties of the objects, not their coordinates. CFG prevents us from introducing irrelevant
concepts into our reasoning.
2. CFG derivations usually provide much more geometric intuition for the steps and for the
results. It is often easy to interpret the meaning of a CFG formula, whereas a coordinate-
based formula is usually quite opaque.
3. CFG derivations are usually simpler than using coordinates, since introducing coordinates
often creates many more variables.
4. CFG provides a sort of “type-checking” for geometric reasoning. For example, if you derive
a formula that includes a term p · v, that is, a “point dot vector,” then there may be a bug
¯
in your reasoning. In this way, CFG is analogous to type-checking in compilers. Although
you could do all programming in assembly language — which does not do type-checking
and will happily led you add, say, a floating point value to a function pointer — most people
would prefer to use a compiler which performs type-checking and can thus find many bugs.
In order to implement geometric algorithms we need to use coordinates. These coordinates are part
of the representation of geometry — they are not fundamental to reasoning about geometry itself.
Example:
CFG says that we cannot add two points; there is no meaning to this operation. But
what happens if we try to do so anyway, using coordinates?
Suppose we have two points: p0 = (0, 0) and p1 = (1, 1), and we add them together
¯ ¯
coordinate-wise: p2 = p0 + p1 = (1, 1). This is not a valid CFG operation, but
¯ ¯ ¯
we have done it anyway just to tempt fate and see what happens. We see that the
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 19
26. CSC418 / CSCD18 / CSC2504 Coordinate Free Geometry
resulting point is the same as one of the original points: p2 = p1 .
¯ ¯
Now, on the other hand, suppose the two points were represented in a different coor-
dinate frame: q0 = (1, 1) and q1 = (2, 2). The points q0 and q1 are the same points as
¯ ¯ ¯ ¯
p0 and p1 , with the same vector between them, but we have just represented them in
¯ ¯
a different coordinate frame, i.e., with a different origin. Adding together the points
we get q2 = q0 + q1 = (3, 3). This is a different point from q0 and q1 , whereas before
¯ ¯ ¯ ¯ ¯
we got the same point.
The geometric relationship of the result of adding two points depends on the coordi-
nate system. There is no clear geometric interpretation for adding two points.
Aside:
It is actually possible to define CFG with far fewer axioms than the ones listed above.
For example, the linear combination of vectors is simply addition and scaling of
vectors.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 20
27. CSC418 / CSCD18 / CSC2504 3D Objects
5 3D Objects
5.1 Surface Representations
As with 2D objects, we can represent 3D objects in parametric and implicit forms. (There are
also explicit forms for 3D surfaces — sometimes called “height fields” — but we will not cover
them here).
5.2 Planes
• Implicit: (¯ − p0 ) · n = 0, where p0 is a point in R3 on the plane, and n is a normal vector
p ¯ ¯
perpendicular to the plane.
n
p0
A plane can be defined uniquely by three non-colinear points p1 , p2 , p3 . Let a = p2 − p1 and
¯ ¯ ¯ ¯ ¯
b = p3 − p1 , so a and b are vectors in the plane. Then n = a × b. Since the points are not
¯ ¯
colinear, n = 0.
• Parametric: s(α, β) = p0 + αa + β b, for α, β ∈ R.
¯ ¯
Note:
This is similar to the parametric form of a line: ¯ = p0 + αa.
l(α) ¯
A planar patch is a parallelogram defined by bounds on α and β.
Example:
Let 0 ≤ α ≤ 1 and 0 ≤ β ≤ 1:
a
p0 b
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 21
28. CSC418 / CSCD18 / CSC2504 3D Objects
5.3 Surface Tangents and Normals
The tangent to a curve at p is the instantaneous direction of the curve at p.
¯ ¯
The tangent plane to a surface at p is analogous. It is defined as the plane containing tangent
¯
vectors to all curves on the surface that go through p.
¯
A surface normal at a point p is a vector perpendicular to a tangent plane.
¯
5.3.1 Curves on Surfaces
The parametric form p(α, β) of a surface defines a mapping from 2D points to 3D points: every
¯
2D point (α, β) in R2 corresponds to a 3D point p in R3 . Moreover, consider a curve ¯
¯ l(λ) =
¯∗ (λ) =
(α(λ), β(λ)) in 2D — there is a corresponding curve in 3D contained within the surface: l
p(¯
¯ l(λ)).
5.3.2 Parametric Form
For a curve c(λ) = (x(λ), y(λ), z(λ))T in 3D, the tangent is
¯
d¯(λ)
c dx(λ) dy(λ) dz(λ)
= , , . (10)
dλ dλ dλ dλ
For a surface point s(α, β), two tangent vectors can be computed:
¯
∂¯
s ∂¯
s
and . (11)
∂α ∂β
Derivation:
Consider a point (α0 , β0 ) in 2D which corresponds to a 3D point s(α0 , β0 ). Define
¯
two straight lines in 2D:
¯
d(λ1 ) = (λ1 , β0 )T (12)
e(λ2 ) = (α0 , λ2 )T
¯ (13)
These lines correspond to curves in 3D:
¯ ¯ ¯
d∗ (λ1 ) = s(d(λ1 )) (14)
¯ ¯ ¯
e∗ (λ2 ) = s(d(λ2 )) (15)
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 22
29. CSC418 / CSCD18 / CSC2504 3D Objects
Using the chain rule for vector functions, the tangents of these curves are:
¯
∂ d∗ s ¯
∂¯ ∂ dα s ¯
∂¯ ∂ dβ ∂¯
s
= + = (16)
∂λ1 ∂α ∂λ1 ∂β ∂λ1 ∂α
∗
∂¯e ∂¯ ∂¯α
s e ∂¯ ∂¯β
s e ∂¯
s
= + = (17)
∂λ2 ∂α ∂λ2 ∂β ∂λ2 ∂β
The normal of s at α = α0 , β = β0 is
¯
∂¯
s ∂¯
s
n(α0 , β0 ) = × . (18)
∂α α0 ,β0 ∂β α0 ,β0
The tangent plane is a plane containing the surface at s(α0 , β0 ) with normal vector equal to the
¯
surface normal. The equation for the tangent plane is:
n(α0 , β0 ) · (¯ − s(α0 , β0 )) = 0.
p ¯ (19)
What if we used different curves in 2D to define the tangent plane? It can be shown that we get the
same tangent plane; in other words, tangent vectors of all 2D curves through a given surface point
are contained within a single tangent plane. (Try this as an exercise).
Note:
The normal vector is not unique. If n is a normal vector, then any vector αn is also
normal to the surface, for α ∈ R. What this means is that the normal can be scaled,
and the direction can be reversed.
5.3.3 Implicit Form
In the implicit form, a surface is defined as the set of points p that satisfy f (¯) = 0 for some
¯ p
function f . A normal is given by the gradient of f ,
n(¯) = ∇f (¯)|p
p p ¯ (20)
∂f (¯) ∂f (¯) ∂f (¯)
p
where ∇f = ∂x
, ∂yp , ∂zp .
Derivation:
Consider a 3D curve c(λ) that is contained within the 3D surface, and that passes
¯
through p0 at λ0 . In other words, c(λ0 ) = p0 and
¯ ¯ ¯
f (¯(λ)) = 0
c (21)
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 23
30. CSC418 / CSCD18 / CSC2504 3D Objects
for all λ. Differentiating both sides gives:
∂f
= 0 (22)
∂λ
Expanding the left-hand side, we see:
∂f ∂f ∂¯x ∂f ∂¯y ∂f ∂¯z
c c c
= + + (23)
∂λ ∂x ∂λ ∂y ∂λ ∂z ∂λ
d¯
c
= ∇f (¯)|p ·
p ¯ =0 (24)
dλ
This last line states that the gradient is perpendicular to the curve tangent, which is
the definition of the normal vector.
Example:
2
The implicit form of a sphere is: f (¯) = p − c
p ¯ ¯ − R2 = 0. The normal at a point
p is: ∇f = 2(¯ − c).
¯ p ¯
Exercise: show that the normal computed for a plane is the same, regardless of whether it is
computed using the parametric or implicit forms. (This was done in class). Try it for another
surface.
5.4 Parametric Surfaces
5.4.1 Bilinear Patch
A bilinear patch is defined by four points, no three of which are colinear.
p01 l (α) p11
1
β
p10
p00 l0(α)
α
Given p00 , p01 , p10 , p11 , define
¯ ¯ ¯ ¯
¯0 (α) = (1 − α)¯00 + α¯10 ,
l p p
¯1 (α) = (1 − α)¯01 + α¯11 .
l p p
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 24
31. CSC418 / CSCD18 / CSC2504 3D Objects
Then connect ¯0 (α) and ¯1 (α) with a line:
l l
p(α, β) = (1 − β)¯0 (α) + β ¯1 (α),
¯ l l
for 0 ≤ α ≤ 1 and 0 ≤ β ≤ 1.
Question: when is a bilinear patch not equivalent to a planar patch? Hint: a planar patch is defined
by 3 points, but a bilinear patch is defined by 4.
5.4.2 Cylinder
A cylinder is constructed by moving a point on a line l along a planar curve p0 (α) such that the
direction of the line is held constant.
If the direction of the line l is d, the cylinder is defined as
p(α, β) = p0 (α) + β d.
¯
A right cylinder has d perpendicular to the plane containing p0 (α).
A circular cylinder is a cylinder where p0 (α) is a circle.
Example:
A right circular cylinder can be defined by p0 (α) = (r cos(α), r sin(α), 0), for 0 ≤
α < 2π, and d = (0, 0, 1).
So p0 (α, β) = (r cos(α), r sin(α), β), for 0 ≤ β ≤ 1.
To find the normal at a point on this cylinder, we can use the implicit form
f (x, y, z) = x2 + y 2 − r2 = 0 to find ∇f = 2(x, y, 0).
Using the parametric form directly to find the normal, we have
∂p
¯ ∂p
¯
= r(− sin(α), cos(α), 0), and = (0, 0, 1), so
∂α ∂β
∂p
¯ ∂p¯
× = (r cos(α)r sin(α), 0).
∂α ∂β
Note:
The cross product of two vectors a = (a1 , a2 , a3 ) and b = (b1 , b2 , b3 ) can
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 25
32. CSC418 / CSCD18 / CSC2504 3D Objects
be found by taking the determinant of the matrix,
i j k
a1 a2 a3 .
b1 b2 b3
5.4.3 Surface of Revolution
To form a surface of revolution, we revolve a curve in the x-z plane, c(β) = (x(β), 0, z(β)),
¯
about the z-axis.
Hence, each point on c traces out a circle parallel to the x-y plane with radius |x(β)|. Circles then
¯
have the form (r cos(α), r sin(α)), where α is the parameter of revolution. So the rotated surface
has the parametric form
s(α, β) = (x(β) cos(α), x(β) sin(α), z(β)).
¯
Example:
If c(β) is a line perpendicular to the x-axis, we have a right circular cylinder.
¯
A torus is a surface of revolution:
c(β) = (d + r cos(β), 0, r sin(β)).
¯
5.4.4 Quadric
A quadric is a generalization of a conic section to 3D. The implicit form of a quadric in the
standard position is
ax2 + by 2 + cz 2 + d = 0,
ax2 + by 2 + ez = 0,
for a, b, c, d, e ∈ R. There are six basic types of quadric surfaces, which depend on the signs of the
parameters.
They are the ellipsoid, hyperboloid of one sheet, hyperboloid of two sheets, elliptic cone, elliptic
paraboloid, and hyperbolic paraboloid (saddle). All but the hyperbolic paraboloid may be ex-
pressed as a surface of revolution.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 26
33. CSC418 / CSCD18 / CSC2504 3D Objects
Example:
An ellipsoid has the implicit form
x2 y 2 z 2
+ 2 + 2 − 1 = 0.
a2 b c
In parametric form, this is
s(α, β) = (a sin(β) cos(α), b sin(β) sin(α), c cos(β)),
¯
for β ∈ [0, π] and α ∈ (−π, π].
5.4.5 Polygonal Mesh
A polygonal mesh is a collection of polygons (vertices, edges, and faces). As polygons may be
used to approximate curves, a polygonal mesh may be used to approximate a surface.
edge
face
vertex
A polyhedron is a closed, connected polygonal mesh. Each edge must be shared by two faces.
A face refers to a planar polygonal patch within a mesh.
A mesh is simple when its topology is equivalent to that of a sphere. That is, it has no holes.
Given a parametric surface, s(α, β), we can sample values of α and β to generate a polygonal mesh
¯
approximating s.
¯
5.5 3D Affine Transformations
Three dimensional transformations are used for many different purposes, such as coordinate trans-
forms, shape modeling, animation, and camera modeling.
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 27
34. CSC418 / CSCD18 / CSC2504 3D Objects
An affine transform in 3D looks the same as in 2D: F (¯) = A¯ + t for A ∈ R3×3 , p, t ∈ R3 . A
p p ¯
homogeneous affine transformation is
ˆ p ˆˆ p
¯ ˆ A t
F (ˆ) = M p, where p =
ˆ ,M = .
1 0T 1
Translation: A = I, t = (tx , ty , tz ).
Scaling: A = diag(sx , sy , sz ), t = 0.
Rotation: A = R, t = 0, and det(R) = 1.
3D rotations are much more complex than 2D rotations, so we will consider only elementary
rotations about the x, y, and z axes.
For a rotation about the z-axis, the z coordinate remains unchanged, and the rotation occurs in the
x-y plane. So if q = R¯, then qz = pz . That is,
¯ p
qx cos(θ) − sin(θ) px
= .
qy sin(θ) cos(θ) py
Including the z coordinate, this becomes
cos(θ) − sin(θ) 0
Rz (θ) = sin(θ) cos(θ) 0 .
0 0 1
Similarly, rotation about the x-axis is
1 0 0
Rx (θ) = 0 cos(θ) − sin(θ) .
0 sin(θ) cos(θ)
For rotation about the y-axis,
cos(θ) 0 sin(θ)
Ry (θ) = 0 1 0 .
− sin(θ) 0 cos(θ)
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 28
35. CSC418 / CSCD18 / CSC2504 3D Objects
5.6 Spherical Coordinates
Any three dimensional vector u = (ux , uy , uz ) may be represented in spherical coordinates.
By computing a polar angle φ counterclockwise about the y-axis from the z-axis and an azimuthal
angle θ counterclockwise about the z-axis from the x-axis, we can define a vector in the appropriate
direction. Then it is only a matter of scaling this vector to the correct length (u2 + u2 + u2 )−1/2 to
x y z
match u.
z
u
φ
y
θ
x uxy
Given angles φ and θ, we can find a unit vector as u = (cos(θ) sin(φ), sin(θ) sin(φ), cos(φ)).
uy
Given a vector u, its azimuthal angle is given by θ = arctan ux
and its polar angle is φ =
(u2 +u2 )1/2
x y
arctan uz
. This formula does not require that u be a unit vector.
5.6.1 Rotation of a Point About a Line
Spherical coordinates are useful in finding the rotation of a point about an arbitrary line. Let
¯
l(λ) = λu with u = 1, and u having azimuthal angle θ and polar angle φ. We may compose
elementary rotations to get the effect of rotating a point p about ¯ by a counterclockwise angle
¯ l(λ)
ρ:
1. Align u with the z-axis.
• Rotate by −θ about the z-axis so u goes to the xz-plane.
• Rotate up to the z-axis by rotating by −φ about the y-axis.
Hence, q = Ry (−φ)Rz (−θ)¯
¯ p
2. Apply a rotation by ρ about the z-axis: Rz (ρ).
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 29
36. CSC418 / CSCD18 / CSC2504 3D Objects
3. Invert the first step to move the z-axis back to u: Rz (θ)Ry (φ) = (Ry (−φ)Rz (−θ))−1 .
Finally, our formula is q = Ru (ρ)¯ = Rz (θ)Ry (φ)Rz (ρ)Ry (−φ)Rz (−θ)¯.
¯ p p
5.7 Nonlinear Transformations
Affine transformations are a first-order model of shape deformation. With affine transformations,
scaling and shear are the simplest nonrigid deformations. Common higher-order deformations
include tapering, twisting, and bending.
Example:
To create a nonlinear taper, instead of constantly scaling in x and y for all z, as in
a 0 0
q = 0 b 0 p,
¯ ¯
0 0 1
let a and b be functions of z, so
a(¯z )
p 0 0
q= 0
¯ b(¯z ) 0 p.
p ¯
0 0 1
A linear taper looks like a(z) = α0 + α1 z.
A quadratic taper would be a(z) = α0 + α1 z + α2 z 2 .
x x
z z
y y
(c) Linear taper (d) Nonlinear taper
5.8 Representing Triangle Meshes
A triangle mesh is often represented with a list of vertices and a list of triangle faces. Each vertex
consists of three floating point values for the x, y, and z positions, and a face consists of three
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 30
37. CSC418 / CSCD18 / CSC2504 3D Objects
indices of vertices in the vertex list. Representing a mesh this way reduces memory use, since each
vertex needs to be stored once, rather than once for every face it is on; and this gives us connectivity
information, since it is possible to determine which faces share a common vertex. This can easily
be extended to represent polygons with an arbitrary number of vertices, but any polygon can be
decomposed into triangles. A tetrahedron can be represented with the following lists:
Vertex index x y z Face index Vertices
0 0 0 0 0 0, 1, 2
1 1 0 0 1 0, 3, 1
2 0 1 0 2 1, 3, 2
3 0 0 1 3 2, 3, 0
Notice that vertices are specified in a counter-clockwise order, so that the front of the face and
back can be distinguished. This is the default behavior for OpenGL, although it can also be set
to take face vertices in clockwise order. Lists of normals and texture coordinates can also be
specified, with each face then associated with a list of vertices and corresponding normals and
texture coordinates.
5.9 Generating Triangle Meshes
As stated earlier, a parametric surface can be sampled to generate a polygonal mesh. Consider the
surface of revolution
¯
S(α, β) = [x(α) cos β, x(α) sin β, z(α)]T
¯
with the profile C(α) = [x(α), 0, z(α)]T and β ∈ [0, 2π].
To take a uniform sampling, we can use
α1 − α0 2π
∆α = , and ∆β = ,
m n
where m is the number of patches to take along the z-axis, and n is the number of patches to take
around the z-axis.
Each patch would consist of four vertices as follows:
¯ ¯
S(i∆α, j∆β) Si,j
¯
S((i + 1)∆α, j∆β) ¯
Si+1,j i ∈ [0, m − 1],
Sij = ¯
S((i + 1)∆α, (j + 1)∆β) = Si+1,j+1 , for j ∈ [0, n − 1]
¯
¯
S(i∆α, (j + 1)∆β) ¯
Si,j+1
To render this as a triangle mesh, we must tesselate the sampled quads into triangles. This is
accomplished by defining triangles Pij and Qij given Sij as follows:
¯ ¯ ¯ ¯ ¯ ¯
Pij = (Si,j , Si+1,j , Si+1,j+1 ), and Qij = (Si,j , Si+1,j+1 , Si,j+1 )
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 31
38. CSC418 / CSCD18 / CSC2504 Camera Models
6 Camera Models
Goal: To model basic geometry of projection of 3D points, curves, and surfaces onto a 2D surface,
the view plane or image plane.
6.1 Thin Lens Model
Most modern cameras use a lens to focus light onto the view plane (i.e., the sensory surface). This
is done so that one can capture enough light in a sufficiently short period of time that the objects do
not move appreciably, and the image is bright enough to show significant detail over a wide range
of intensities and contrasts.
Aside:
In a conventional camera, the view plane contains either photoreactive chemicals;
in a digital camera, the view plane contains a charge-coupled device (CCD) array.
(Some cameras use a CMOS-based sensor instead of a CCD). In the human eye, the
view plane is a curved surface called the retina, and and contains a dense array of
cells with photoreactive molecules.
Lens models can be quite complex, especially for compound lens found in most cameras. Here we
consider perhaps the simplist case, known widely as the thin lens model. In the thin lens model,
rays of light emitted from a point travel along paths through the lens, convering at a point behind
the lens. The key quantity governing this behaviour is called the focal length of the lens. The
focal length,, |f |, can be defined as distance behind the lens to which rays from an infinitely distant
source converge in focus.
surface point
view plane
lens
optical axis
z0 z1
More generally, for the thin lens model, if z1 is the distance from the center of the lens (i.e., the
nodal point) to a surface point on an object, then for a focal length |f |, the rays from that surface
point will be in focus at a distance z0 behind the lens center, where z1 and z0 satisfy the thin lens
equation:
1 1 1
= + (25)
|f | z0 z1
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 32
39. CSC418 / CSCD18 / CSC2504 Camera Models
6.2 Pinhole Camera Model
A pinhole camera is an idealization of the thin lens as aperture shrinks to zero.
view plane
infinitesimal
pinhole
Light from a point travels along a single straight path through a pinhole onto the view plane. The
object is imaged upside-down on the image plane.
Note:
We use a right-handed coordinate system for the camera, with the x-axis as the hor-
izontal direction and the y-axis as the vertical direction. This means that the optical
axis (gaze direction) is the negative z-axis.
y
-z
x
z
Here is another way of thinking about the pinhole model. Suppose you view a scene with one eye
looking through a square window, and draw a picture of what you see through the window:
(Engraving by Albrecht D¨ rer, 1525).
u
Copyright c 2005 David Fleet and Aaron Hertzmann
NOTES.PMR-INSIGNIA.ORG 33