SIGGRAPH Asia Projective Geometry and Duality for Graphics, Games and Visualization. An Introductory Course. Singapore.

Similar documents
Eurographics Projective Geometry, Duality and Precision of Computation in Computer Graphics, Visualization and Games

Barycentric coordinates computation in homogeneous coordinates

Length, Area and Volume Computation in Homogeneous Coordinates

ALGORITHMS COMPLEXITY AND LINE CLIPPING PROBLEM SOLUTIONS

Computers & Graphics, Pergamon Press, Vol.21, No.2, pp , 1997

Robot Vision: Projective Geometry

Line Clipping in E 3 with Expected Complexity O(1)

Duality and Robust Computation

BS-Patch: Constrained Bezier Parametric Patch

Fast Algorithms for Line Segment and Line Clipping in E 2

Coordinate Free Perspective Projection of Points in the Conformal Model Using Transversions

A New Algorithm for Pyramidal Clipping of Line Segments in E 3

1 Affine and Projective Coordinate Notation

Surface Curvature Estimation for Edge Spinning Algorithm *

3D Computer Vision II. Reminder Projective Geometry, Transformations

APPENDIX A CLIFFORD ALGEBRA

New Hash Function Construction for Textual and Geometric Data Retrieval

Introduction to Geometric Algebra Lecture VI

A Comparative Study of LOWESS and RBF Approximations for Visualization

TECHNISCHE UNIVERSITÄT BERLIN WS2005 Fachbereich 3 - Mathematik Prof. Dr. U. Pinkall / Charles Gunn Abgabe:

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

PRIMITIVES INTERSECTION WITH CONFORMAL 5D GEOMETRY

RBF Interpolation with CSRBF of Large Data Sets

Multiple View Geometry in Computer Vision

Graphics and Interaction Transformation geometry and homogeneous coordinates

Introduction to Geometric Algebra Lecture V

UNIT 2. Translation/ Scaling/ Rotation. Unit-02/Lecture-01

DIMENSIONAL SYNTHESIS OF SPATIAL RR ROBOTS

Lesson 20: Exploiting the Connection to Cartesian Coordinates

Projective geometry for Computer Vision

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Computer Vision I - Appearance-based Matching and Projective Geometry

CS-9645 Introduction to Computer Vision Techniques Winter 2019

Epipolar Geometry Prof. D. Stricker. With slides from A. Zisserman, S. Lazebnik, Seitz

Image warping , , Computational Photography Fall 2017, Lecture 10

EM225 Projective Geometry Part 2

A Point in Non-Convex Polygon Location Problem Using the Polar Space Subdivision in E 2

Advanced Geometric Approach for Graphics and Visual Guided Robot Object Manipulation

N-Views (1) Homographies and Projection

Computer Vision I - Appearance-based Matching and Projective Geometry

Inverse kinematics computation in computer graphics and robotics using conformal geometric algebra

Generation of lattices of points for bivariate interpolation

Space Subdivision for the Adaptive Edge Spinning Polygonization

Camera Projection Models We will introduce different camera projection models that relate the location of an image point to the coordinates of the

Parallel and perspective projections such as used in representing 3d images.

The Implicit Function Modeling System - Comparison of C++ and C# Solutions

Review 1. Richard Koch. April 23, 2005

Algebraic Geometry of Segmentation and Tracking

Coordinate Transformations in Advanced Calculus

Multiple View Geometry in Computer Vision

Summer School: Mathematical Methods in Robotics

Part II. Working and Playing with Geometry

Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme

Basics of Computational Geometry

Ray-Triangle and Ray-Quadrilateral Intersections in Homogeneous Coordinates

Performance Level Descriptors. Mathematics

Background for Surface Integration

Introduction to Geometric Algebra Lecture I

CS 130 Exam I. Fall 2015

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

Katu Software Algebra 1 Geometric Sequence

Prentice Hall Mathematics: Pre-Algebra 2004 Correlated to: Colorado Model Content Standards and Grade Level Expectations (Grade 8)

From Vertices To Fragments-1

CSE 252B: Computer Vision II

Sung-Eui Yoon ( 윤성의 )

Institutionen för systemteknik

Notes on Spherical Geometry

Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives

Advances in Metric-neutral Visualization

GEOMETRY IN THREE DIMENSIONS

Unified Mathematics (Uni-Math)

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:

Geometric Hand-Eye Calibration for an Endoscopic Neurosurgery System

Revision Problems for Examination 2 in Algebra 1

Vectors. Section 1: Lines and planes

Jorg s Graphics Lecture Notes Coordinate Spaces 1

ü 12.1 Vectors Students should read Sections of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

Homogeneous Coordinates and Transformations of the Plane

Vectors and the Geometry of Space

A Procedure to Clip Line Segment

FIND RECTANGULAR COORDINATES FROM POLAR COORDINATES CALCULATOR

Almost Curvature Continuous Fitting of B-Spline Surfaces

Prentice Hall Mathematics: Course Correlated to: Colorado Model Content Standards and Grade Level Expectations (Grade 8)

Review Exercise. 1. Determine vector and parametric equations of the plane that contains the

CSCI 4620/8626. Coordinate Reference Frames

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

BMO Round 1 Problem 6 Solutions

This blog addresses the question: how do we determine the intersection of two circles in the Cartesian plane?

Visual Recognition: Image Formation

The Three Dimensional Coordinate System

3D Computer Vision II. Reminder Projective Geometry, Transformations. Nassir Navab. October 27, 2009

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Monday, 12 November 12. Matrices

Tangency of Conics and Quadrics

Computer Vision. Coordinates. Prof. Flávio Cardeal DECOM / CEFET- MG.

Lagrange multipliers October 2013

SECONDARY DRAFT SYLLABUS. 2. Representation of functions. 3. Types of functions. 4. Composition of functions (two and three)

A Transformation Based on the Cubic Parabola y = x 3

COMP3421. Vector geometry, Clipping

Transcription:

Projective Geometry and Duality for Graphics, Games and Visualization An Introductory Course Singapore Vaclav Skala University of West Bohemia, Plzen, Czech Republic VSB Technical University, Ostrava, Czech Republic http://www.vaclavskala.eu SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu

An overview Euclidean space and projective extension Principle of duality and its applications Geometric computation in the projective space Intersection of two planes in E3 with additional constrains Barycentric coordinates and intersections Interpolation and intersection algorithms Implementation aspects and GPU Conclusion and summary SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 2

Projective Space SIGGRAPH Asia 202 X = [X, Y] T X E 2 x = [ x, y: w] T x P 2 Conversion: X = x / w Y = y / w X ρ w w= E 2 P 2 x p Y A c c= D(E 2 ) D(P 2 ) D(p) D( ρ) B & w 0 x (a) y a (b) b If w = 0 then x represents an ideal point - a point in infinity, i.e. it is a directional vector. The Euclidean space E 2 is represented as a plane w =. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 3

Points and vectors SIGGRAPH Asia 202 Vectors are freely movable not having a fixed position, :0 Points are not freely movable they are fixed to an origin of the current coordinate system usually in textbooks, : and, : A vector in the Euclidean coordinate system - CORRECT Horrible construction DO NOT USE IT IT IS TOTALLY WRONG, :, :, :0 This was presented as How a vector is constructed in the projective space in a textbook!! WRONG, WRONG, WRONG This construction was found in SW as well!! SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 4

Points and vectors SIGGRAPH Asia 202 A vector given by two points in the projective space, : This is the CORRECT SOLUTION, but what is the interpretation? A difference of coordinates of two points is a vector in the mathematical meaning and is a scaling factor actually In the projective representation (if the vector length matters), :, :0 We have to strictly distinguish if we are working with points, i.e. vector as a data structure represents the coordinates, or with a vector in the mathematical meaning stored in a vector data structure. VECTORS x FRAMES SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 5

Duality For simplicity, let us consider a line p defined as: ax + by + d = 0 We can multiply it by w 0 and we get: X ρ w w= E 2 P 2 x p Y A c c= D(E 2 ) D(P 2 ) D(p) D( ρ) B ax + by + dw = 0 i.e. p T x = 0 p = [ a, b: d] T x = [ x, y: w] T =[ wx, wy: w] T x (a) y a (b) b A line p E 2 is actually a plane in the projective space P 2 (point [0,0:0] T excluded) SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 6

Duality From the mathematical notation p T x = 0 we cannot distinguish whether p is a line and x is a point or vice versa in the case of P 2. It means that a point and a line are dual in the case of P 2, and a point and a plane are dual in the case of P 3. The principle of duality in P 2 states that: Any theorem remains true when we interchange the words point and line, lie on and pass through, join and intersection, collinear and concurrent and so on. Once the theorem has been established, the dual theorem is obtained as described above. This helps a lot to solve some geometrical problems. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 7

Examples of dual objects and operators E 2 E 3 Primitive Point Line Point Plane Dual primitive Line Point Plane Point Operator Join Intersect Dual operator Intersect Join Computational sequence for a problem is the same for a dual problem. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 8

Definition The cross product of the two vectors x = [x,y :w ] T and x 2 = [x 2,y 2 :w 2 ] T is defined as: where: i = [,0:0] T, j = [0,:0] T, k = [0,0:] T Please, note that homogeneous coordinates are used. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 9

Theorem Let two points x and x 2 be given in the projective space. Then the coefficients of the p line, which is defined by those two points, are determined as the cross product of their homogeneous coordinates, Proof Let the line p E 2 be defined in homogeneous coordinates as (coefficient is used intentionally to have the same symbol representing a distance of the element from the origin for lines and planes) 0 We are actually looking for a solution to the following equations: where: p = [a,b : d] T 0 0 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 0

It means that any point that lies on the p line must satisfy both the equation above and the equation is defined as T p x= 0 in other words the p vector We can write i.e. 0 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu

Evaluating the determinant 0 we get the line coefficients of the line p as: a = y det y 2 w w 2 b x = det x 2 w w 2 c = x det x 2 y y 2 Note: for w = we get the standard cross product formula and the cross product defines the p line, i.e. p = x x 2 where: p = [a,b : d] T An intersection of two lines => A x = b A line given by two points => A x = 0 Those problems are DUAL, why algorithms are different?? Cross product is equivalent to a solution of a linear system of equations! SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 2

DUALITY APPLICATION SIGGRAPH Asia 202 In the projective space points and lines are dual. Due to duality we can directly intersection of two lines as, : If the lines are parallel or close to parallel, the homogeneous coordinate 0 and a user has to make a decision so there is sequence in the code like det.. Generally computation can continue even if 0 if projective space is used. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 3

DISTANCE Geometry is strongly connected with distances and their measurement, geometry education is strictly sticked to the Euclidean geometry, where the distance is measured as, resp.. This concept is convenient for a solution of basic geometric problems, but in many cases it results into quite complicated formula and there is a severe question of stability and robustness in many cases. The main objection against the projective representation is that there is no metric. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 4

The distance of two points can be easily computed as / where: Also a distance of a point from a line in E 2 can be computed as where:, :,: The extension to E 3 /P 3 is simple and the distance of a point from a plane in E 3 can be computed as where:,, :,,:. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 5

In many cases we do not need actually a distance, e.g. for a decision which object is closer, and distance 2 can be used instead, i.e. for the E 2 case where:, and the normal vector is not normalized If we are comparing distances from the same line p we can use pseudo-distance for comparisons Similarly in the case of E 3 where:,, and SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 6

Computation in Projective Space Cross product definition A plane ρ is determined as a cross product of three given points Due to the duality An intersection point x of three planes is determined as a cross product of three given planes x x x 2 3 ρ ρ ρ 2 3 i j k l x y z w = x2 y2 z2 w2 x3 y3 z3 w3 i j k l a b c d = a2 b2 c2 d2 a3 b3 c3 d3 Computation of generalized cross product is equivalent to a solution of a linear system of equations => no division operation! SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 7

Geometric transformations with points (note,, 0 ): Translation by a vector,,:, i.e. /, /, 0: In the Euclidean space: 0 / 0 / 0 0 In the projective space: 0 / 0 / 0 0 and det. For we get a standard formula 0 0 0 0 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 8

Rotation by an angle,,, : In the Euclidean space: 0 0 0 0 0 0 0 0 In the projective space: 0 0 0 0 / / as by definition, det SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 9

Scaling by a factor,,, : 0 0 0 0 0 0 0 0 0 0 0 0 det It is necessary to note that the determinant of a transformation matrix, i.e. matrices,,, is det in general, but as the formulation is in the projective space, there is no need to normalize transformations to det even for rotation. It can be seen that if the parameters of a geometric transformation are given in the homogeneous coordinates, no division operation is needed at all. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 20

Transformation of lines and planes E 2 E 3 Dual problem In graphical applications position of points are changed by an interaction, i.e.. The question is how coefficients of a line, resp. a plane are changed without need to recompute them from the definition. It can be proved that or SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 2

Transformation of lines and planes As the computation is made in the projective space we can write, : for lines in E 2 or,, : for planes in E 3 THIS IS SIMPLIFICATION OF COMPUTATIONS Transformation matrices for lines, resp. for planes are DIFFERENT from transformations for points! SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 22

Transformation of lines and planes Transformation about a general axis in E 3 / P 3 Rotation axis Usually used transformation ( is translation): ϕ 0 0 0 0 0 0 0 0 0 0,, is an axis directional vector This is unstable if 0 and not precise if or vice versa That is generally computationally complex and unstable as a user has to select which axis is to be used for a rotation SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 23

Transformation of lines and planes Transformation about an axis in the Euclidean space E 3. where:. is a matrix. In the Euclidean space E 3 the vector has to be normalized The matrix is defined as: 0 0 0 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 24

Computation in Projective Space Interpolation Linear parametrization 0 0 0 0 ( ) X() t = X + ( X X ) t t, Non-linear (monotonous) parametrization ( ) x() t = x + ( x x ) t t, xt () = x0 + ( x x0) t yt () = y0 + ( y y0) t zt () = z0 + ( z z0) t wt () = w0 + ( w w0) t I t means that we can interpolate using homogeneous coordinates without a need of normalization to E k!! Homogeneous coordinate w 0 In many algorithms, we need monotonous parameterization, only 5,60 4,60 3,60 2,60,60 X(t) Y(t) 0,60 0,0 0,5,0 3,0 2,90 2,70 2,50 2,30 2,0 X - Y,90 0,00 2,00 4,00 6,00 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 25

Computation in Projective Space Spherical interpolation,, sin Ω sin Ω Instability occurs if Ω. sinω sin Ω Mathematically formula is correct, in practice the code is generally incorrect! [ ] Courtesy of Wikipedia,, sin Ω sinω sin Ω sin Ω sinω :sinω Homogeneous coordinates => better numerical stability Homogeneous coordinate SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 26

Computation in Projective Space Intersection line plane 0 0 [ abcd,,, ] min min 0 0 min ( ) x() t = x + ( x x ) t t, T a x = 0 ax + by + cz + d = 0 t = T T T 0 t = τ : τw if τw 0 thent: = t TEST if t > t then... if τ * τ > τ * τ then... condition τ 0 w T a = S = X X a x a s τ = a x τ = a s w w T An intersection of a plane with a line in E 2 / E 3 can be computed efficiently Comparison operations must be modified!!! Cyrus-Beck line clipping algorithm 0-25% faster SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 27

Line Clipping procedure CLIP_L; { x A, x B in homogeneous coordinates } { The EXIT ends the procedure } { input: x A, x B ; x A =[x A,y A,] T p = [a,b,c] T } begin {} p := x A x x B ; { ax+by+c = 0} {2} for k:=0 to N- do { x k =[x k,y k,] T } {3} if p T x k 0 then c k := else c k :=0; {4} if c = [0000] T or c = [] T then EXIT; {5} i:= TAB[c]; j:= TAB2[c]; {6} x A := p x e i ; x B := p x e j ; {7} DRAW (x A ; x B ) {e i i-th edge } end {CLIP_L} Line clipping algorithms in E 2 x A Cohen-Sutherland Liang-Barsky Hodgman Skala modification of Clip_L for line segments F(x)<0 F(x)>0 x 3 x 0 e 3 e 2 e 0 e x 2 x x B s SIMPLE, ROBUST and FAST SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 28

Computation in Projective Space - Barycentric coordinates Let us consider a triangle with vertices X, X 2, X 3, A position of any point X E 2 can be expressed as x 2 ax + a X + ax = X 2 2 3 3 ay + a Y + ay = Y 2 2 3 3 additional condition P 3 x P 2 P a + a + a = 0 a a 2 3 i = P i P i =,...,3 i x Linear system must be solved x 3 If points x i are given as [x i, y i, z i : w i ] T and w i then x i must be normalized to w i =, i.e. 4 * 3 = 2 division operations SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 29

Computation in Projective Space bx + b2x2 + bx 3 3 + b4x = 0 by + by 2 2+ by 3 3+ by 4 = 0 b+ b2 + b3 + b4 = 0 b = ab i =,...,3 b 0 i Rewriting i 4 4 b X X2 X3 X b 2 Y Y2 Y3 Y b 3 = 0 b 4 Solution of the linear system of equations (LSE) is equivalent to generalized cross product b = ξ η w = b, b2, b3, b4 = X, X2, X3, X 2 3 T [,,,] SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 30 b ξ η = Y, Y, Y, Y w = T T T

Computation in Projective Space if w i or w i = b x x2 x3 x b 2 y y2 y3 y b 3 w w2 w3 w b 4 = 0 => new entities: projective scalar, projective vector b = ξ η w b = b, b2, b3, b4 ξ = x, x2, x3, x η = y, y2, y3, y w = w, w2, w3, w 0 ( b : w w w) 2 3 0 ( b : w w w) 2 3 0 ( b : w w w) 3 2 T T T T (Skala,V.: Barycentric coordinates computation in homogeneous coordinates, Computers&Graphics, 2008) SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 3

Computation in Projective Space Line in E3 as Two Plane Intersection Standard formula in the Euclidean space,, : :,, : : Line given as an intersection of two planes The formula is quite horrible one and for students not acceptable as it is too complex and they do not see from the formula comes from. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 32

SIGGRAPH Asia 202 Computation in Projective Space Line in E3 as Two Plane Intersection Standard formula in the Euclidean space Plücker s coordinates a line is given by two points. Due to the DUALITY - point is dual to a plane and vice versa the intersection of two planes can be computed as a dual problem but computationally expensive computation z Projective formulation and simple computation SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 33

Computation in Projective Space Line in E3 as Two Plane Intersection,, :,, : normal vectors are,,,, directional vector of a line of two planes and is given as starting point??? A plane passing the origin with a normal vector,,, :0 The point is defined as How simple formula supporting matrix-vector architectures like GPU and parallel processing Compare the standard and projective formulas SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 34

SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 35 Computation in Projective Space the nearest point Find the nearest point on an intersection of two planes to the given point ξ Simple solution: Translate planes and so the ξ is in the origin Compute intersection of two planes i.s. and Translate using Again an elegant solution, simple formula supporting matrix-vector architectures like GPU and parallel processing Solution DETAILS next Known solution using Lagrange multipliers = 2 2 0 0 0 2 2 2 2 2 2 2 2 2 0 0 0 0 2 0 0 0 2 0 0 0 2 n p n p p p p p p p n n n n n n n n n n n n z y x z y x z y x z y x z z y y x x μ λ Krumm,J.: Intersection of Two Planes, Microsoft Research ξ

The closest point to an intersection of two planes In some applications we need to find a closest point on a line given as an intersection of two planes. We want to find a point, the closest point to the given point, which lies on an intersection of two planes : and : SIGGRAPH Asia 202 This problem was recently solved by using Lagrange multipliers and an optimization approach. This leads to a solution of a system of linear equations with 5 equations. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 36

Solution in the projective space.translates the given point,, to the origin matrix 2.Compute parameters of the given planes and after the transformation as and, 3.Compute the intersection of those two planes and 4.Transform the point to the original coordinate system using transformation :0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 It is simple, easy to implement on GPU. SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 37

Computation in Projective Space Disadvantages Careful handling with formula as the projective space Oriented projective space is to be used, i.e. 0; HW could support it Exponents of the homogeneous vector can overflow o exponents should be normalized; HW could support it o unfortunately not supported by the current hardware o P_Lib library for computation in the projective space - uses SW solution for normalization on GPU (C# and C++) SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 38

Computation in Projective Space Advantages Infinity is represented No division operation is needed, a division operation can be hidden to the homogeneous coordinate Many mathematical formula are simpler and elegant One code sequence solve primary and dual problems Supports matrix vector operations in hardware like GPU etc. Numerical computation can be faster More robust and stable solutions can be achieved System of linear equations can be solved directly without division operation if exponent normalization is provided SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 39

SIGGRAPH Asia 202 Implementationn aspects and GPU GPU (Graphical Processing Unit) -optimized for matrix-vector, vector-vector operation especially for [x,y,z :w] Native arithmetic operations with homogeneous coordinates without exponent normalization Programmable HW parallel processing SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 40

Implementation aspects and GPU 4D cross product can be implemented in Cg/HLSL on GPU (not optimal implementation) as: float4 cross_4d(float4 x, float4 x2, float4 x3) { float4 a; # simple formula # } a.x=dot(x.yzw, cross(x2.yzw, x3.yzw)); a.y=-dot(x.xzw, cross(x2.xzw, x3.xzw)); a.z=dot(x.xyw, cross(x2.xyw, x3.xyw)); a.w=-dot(x.xyz, cross(x2.xyz, x3.xyz)); return a; # more compact formula available # SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 4

Geometry algebra SIGGRAPH Asia 202 in E 3 It is strange result of a dot product is a scalar value while result of the outer product (cross product) is a vector. Please, for details see What is??? http://geometricalgebra.zcu.cz/ GraVisMa - workshops on Computer Graphics, Computer Vision & Mathematics http://www.gravisma.eu WSCG Conference on Computer Graphics, Computer Vision & Visualization http://www.wscg.eu SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 42

Summary and conclusion SIGGRAPH Asia 202 We have got within this course an understanding of: projective representation use for geometric transformations with points, lines and planes principle of duality and typical examples of dual problems, influence to computational complexity intersection computation of two planes in E3, dual Plücker coordinates and simple projective solution geometric problems solution with additional constrains intersection computations and interpolation algorithms directly in the projective space barycentric coordinates computation on GPU avoiding or postponing division operations in computations Projective space representation supports matrix-vector architectures like GPU faster, robust and easy to implement algorithms achieved SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 43

References Skala,V.: Barycentric Coordinates Computation in Homogeneous Coordinates, Computers & Graphics, Elsevier, ISSN 0097-8493, Vol. 32, No., pp.20-27, 2008 Skala,V.: Intersection Computation in Projective Space using Homogeneous Coordinates, Int. Journal of Image and Graphics, ISSN 029-4678, Vol.7, No.4, pp.65-628, 2008 Skala,V.: Length, Area and Volume Computation in Homogeneous Coordinates, Int. Journal of Image and Graphics, Vol.6., No.4, pp.625-639, ISSN 029-4678, 2006 Skala,V., Kaiser,J., Ondracka,V.: Library for Computation in the Projective Space, 6th Int.Conf. Aplimat, Bratislava, ISBN 978-969562-4-, pp. 25-30, 2007 Skala,V.: GPU Computation in Projective Space Using Homogeneous Coordinates, Game Programming GEMS 6 (Ed.Dickheiser,M.), pp.37-47, ISBN -58450-450-, Charles River Media, 2006 Skala,V.: A new approach to line and line segment clipping in homogeneous coordinates, The Visual Computer, ISSN 078-2789, Vol.2, No., pp.905-94, Springer Verlag, 2005 Generally Publications with on-line DRAFTs via http://www.vaclavskala.eu References related Yamaguchi,F.:Computer-Aided Geometric Design: A Totally Four-Dimensional Approach, Springer, 2002 Agoston,M.K.: Computer Graphics and Geometric Modeling - Mathematics, ISBN - 58233-87-2, Springer, 2005 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 44

Additional references for Geometric Algebra and Conformal Geometry Bayro-Corrochano,E: Geometric Computing: For Wavelet Transforms, Robot Vision, Learning, Control and Action, Springer, 200 Bayro-Corrochano,E, Sobczyk,G.: Geometric Algebra with Application in Science and Engineering, Birkhauser, 200 Browne,J.: Grassmann Algebra - Draft Exploring Application of Extended Vector Algebra with Mathematica, Swinburn University of Technology, Melbourne, Australia, 200 Chevalley,C.: The Algebraic Theory of Spinors and Clifford Algebras, Springer, 995 Doran,Ch., Lasenby,A.: Geometric Algebra for Physicists, Cambridge Univ.Press, 2003 Dorst,L., Fontine,D., Mann,S.: Geometric Algebra for Computer Science, Morgan Kaufmann, 2007 Gu,X.D., Yau,S.-T.: Computational Conformal Geometry, International Press, Somerville, USA, 2008 Hildenbrand,D.: Foundations of Geometric Algebra Computing, Springer 202 Li,H., Olver,P.J., Sommer,G.: Computer Algebra and Geometric Algebra with Applications, Springer Perwass,Ch.: Geometric Algebra with Applications in Engineering, Springer Verlag, 2008 Sommer, G.: Geometric Computing with Clifford Algebras. Theoretical Foundations and Applications in Computer Vision and Robotics, Springer, Berlin, 200 Suter,J.: Geometric Algebra Primer [PDF] University of Twente, The Netherlands SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 45

Vince,J.: Geometric Algebra for Computer Science, Springer, 2008 Vince,J.: Geometric Algebra: An Algebraic System for Computer Games and Animation, Springer, 2009 Macdonald,A: A Survey of Geometric Algebra and Geometric Calculus, http://faculty.luther.edu/~macdonal, 2009 Advances in Applied Clifford Algebras - Birkhauser-Springer journal [http://www.clifford-algebras.org] Digital papers repository of WSCG 992 available from http://www.wscg.eu SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 46

Questions??? Contact Vaclav Skala c/o University of West Bohemia Faculty of Applied Sciences Dept. of Computer Science and Engineering CZ 306 4 Plzen, Czech Republic http://www.vaclavskala.eu skala@kiv.zcu.cz subj. SIGGRAPH Asia Supported by the Ministry of Education of the Czech Republic, projects ME0060, LA0035, LH28 SIGGRAPH Asia 202 Vaclav Skala http://www.vaclavskala.eu 47