SlideShare a Scribd company logo
Mohammad Shaker 
mohammadshaker.com 
@ZGTRShaker 
2011, 2012, 2013, 2014 
XNA Game Development 
L02 –Transformations and Basic Matrices
3D World
3D World
3D World
XNA Matrices
XNA Matrices 
• Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. 
• Matrix.Translation: Creates a translation matrix (one or more axes). 
• Matrix.Scale: Creates a scale matrix (one or more axes). 
• Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. 
• Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
Basic Matrices View, Projection and World Matrices
Basic Matrices 
•View, Projection and World Matrices
RULE
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP:
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA 
PROJECTION
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA 
PROJECTION 
WORLD MATRIX
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
Camera (View) Matrix
XNA Matrices 
• Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. 
• Matrix.Translation: Creates a translation matrix (one or more axes). 
• Matrix.Scale: Creates a scale matrix (one or more axes). 
• Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. 
• Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
View Matrices 
Matrix.CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector);
View Matrices 
Matrix.CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector);
View Matrices 
Matrix.CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector);
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
Projection Matrix
XNA Matrices 
• Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. 
• Matrix.Translation: Creates a translation matrix (one or more axes). 
• Matrix.Scale: Creates a scale matrix (one or more axes). 
• Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. 
• Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
Projection Matrices
Projection Matrices 
The Difference?!
Projection Matrices 
The Difference?! 
perspective
Projection Matrices 
The Difference?! 
perspective 
orthographic
Projection Matrices
Projection Matrices
Projection Matrices
Projection Matrices 
Realistic? 
perspective 
orthographic
Projection Matrices 
•Projection Matries 
Realistic? 
perspective 
orthographic
Projection Matrices 
Architecture? 
perspective 
orthographic
Projection Matrices 
Architecture? 
perspective 
orthographic
Projection Matrices 
Usability? 
perspective 
orthographic
Projection Matrices 
Usability? 
perspective 
orthographic
XNA Matrices 
• Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. 
• Matrix.Translation: Creates a translation matrix (one or more axes). 
• Matrix.Scale: Creates a scale matrix (one or more axes). 
• Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. 
• Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
Orthographic Projections 
•An orthographic projection can be created with the following code: 
Matrix.CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane);
Orthographic Projections 
•An orthographic projection can be created with the following code: 
•Off-center orthogonal projection: 
Matrix.CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane); 
Matrix.CreateOrthographicOffCenter(float left, 
float right, 
float bottom, 
float top, 
float zNearPlane, float zFarPlane);
Orthographic Projections 
•Ummm …. 
Matrix.CreateOrthographicOffCenter(-1, 1, -1, 1, 0.1f, 100f); Matrix.CreateOrthographic(2, 2, 0.1f, 100f);
Orthographic Projections 
•Ummm …. 
Matrix.CreateOrthographicOffCenter(-1, 1, -1, 1, 0.1f, 100f); Matrix.CreateOrthographic(2, 2, 0.1f, 100f);
Perspective Projections 
•PerspectiveFieldOfView 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
•Perspective projections 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspectiveFieldOfView(float fieldOfView, 
float aspectRatio, 
float nearPlaneDistance, 
float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspective( 
float width, 
float height, 
float nearPlaneDistance, float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspective( 
float width, 
float height, 
float nearPlaneDistance, float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspective( 
float width, 
float height, 
float nearPlaneDistance, float farPlaneDistance);
Perspective Projections 
Matrix.CreatePerspectiveOffCenter( 
float left, 
float right, 
float bottom, 
float top, 
float nearPlaneDistance, float farPlaneDistance);
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
RULE 
TO SEE A 3D SCENE YOU SHOULD SET UP: 
CAMERA (Singleton, for all objects) 
PROJECTION (Singleton, for all objects) 
WORLD MATRIX (For each object separately)
World MatrixEach Object in 3D Has Its own World Matrix
World Matrix
World Matrix 
•Example 
•Let’s assume that the coordinates of the triangle vertices are as follows:
World Matrix 
•Example 
•To translate 40 units over the y axis’s positive direction,allyou need to do is to add 40 toeachy position, and you have the new coordinates for the vertices:
World Matrix
World Matrix
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Load Identity Matrix 
Matrix.Identity(); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Create scale matrix 
Matrix.CreateScale(float scaleAmount); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Create a matrix that rotates around the x-axis: 
Matrix.CreateRotateX(float angleInRadians); 
•Create a matrix that rotatesaround the y-axis: 
Matrix.CreateRotateY(float angleInRadians); 
•Create a matrix that rotatesaround the z-axis: 
Matrix.CreateRotateZ(float angleInRadians); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Create a matrix that rotates points around an arbitrary axis: 
Matrix.CreateFromAxisAngle(Vector3 axis, float angleInRadians); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Create an Orbit matrix?! 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Create an Orbit matrix?! 
It’s just 
“Translate then Rotate” 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Create a translation matrix: 
Matrix.CreateTranslation(Vector3 position); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations
Transformations 
•Multiple World Transformations
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Not the same! 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Not the same! 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateRotationX(MathHelper.ToRadians(45)) * 
Matrix.CreateTranslation(newVector3(10, 0, 0)); 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Not the same! 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Transformations 
•Multiple World Transformations 
Matrixresult = 
Matrix.CreateTranslation(newVector3(10, 0, 0)) * 
Matrix.CreateRotationX(MathHelper.ToRadians(45)); 
Identity 
Scale 
Rotate 
Orbit 
Translate
Test’emlive! 
Souvenir, 9:03 AM, Tuesday, Aug.16th-2011 still awake :S
Custom Matrices
Custom Matrices 
Matrix customMatrix= new Matrix( 
floatm11, floatm12, floatm13, floatm14, floatm21, floatm22, floatm23, floatm24, floatm31, floatm32, floatm33, floatm34, floatm41, floatm42, floatm43, floatm44);
Custom Matrices 
•Custom Matrices 
Matrix customMatrix= new Matrix( 
floatm11, floatm12, floatm13, floatm14, floatm21, floatm22, floatm23, floatm24, floatm31, floatm32, floatm33, floatm34, floatm41, floatm42, floatm43, floatm44); 
customMatrix.M31 = 4;
Basic Matrices -A Final Example 
Vector3cameraPosition= newVector3(30.0f, 30.0f, 30.0f); 
Vector3cameraTarget= newVector3(0.0f, 0.0f, 0.0f); // Look back at the origin 
floatfovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians 
floataspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; 
floatnear = 0.01f; // the near clipping plane distance 
floatfar = 100f; // the far clipping plane distance 
Matrixworld = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); 
Matrixview = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); 
Matrixprojection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
Basic Matrices -A Final Example 
Vector3cameraPosition= newVector3(30.0f, 30.0f, 30.0f); 
Vector3cameraTarget= newVector3(0.0f, 0.0f, 0.0f); // Look back at the origin 
float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians 
float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; 
float near = 0.01f; // the near clipping plane distance 
float far = 100f; // the far clipping plane distance 
Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); 
Matrixview = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); 
Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
Basic Matrices -A Final Example 
Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); 
Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin 
floatfovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians 
floataspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; 
floatnear = 0.01f; // the near clipping plane distance 
floatfar = 100f; // the far clipping plane distance 
Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); 
Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); 
Matrixprojection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
Basic Matrices -A Final Example 
Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); 
Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin 
float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians 
float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; 
float near = 0.01f; // the near clipping plane distance 
float far = 100f; // the far clipping plane distance 
Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); 
Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); 
Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
Basic Matrices -A Final Example 
Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); 
Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin 
float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians 
float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; 
float near = 0.01f; // the near clipping plane distance 
float far = 100f; // the far clipping plane distance 
Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); 
Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); 
Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
Basic Matrices -A Final Example 
Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); 
Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin 
float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians 
float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; 
float near = 0.01f; // the near clipping plane distance 
float far = 100f; // the far clipping plane distance 
Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); 
Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); 
Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);

More Related Content

What's hot

Learn Java 3D
Learn Java 3D Learn Java 3D
Learn Java 3D
Jay Thakkar
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harris
Wael Badawy
 
Lec2
Lec2Lec2
A practical intro to BabylonJS
A practical intro to BabylonJSA practical intro to BabylonJS
A practical intro to BabylonJS
HansRontheWeb
 
Anschp34
Anschp34Anschp34
Anschp34
FnC Music
 
Ch32 ssm
Ch32 ssmCh32 ssm
Ch32 ssm
Marta Díaz
 
Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...
Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...
Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...
Daniel Barrero
 
05 Views
05 Views05 Views
05 Views
Mahmoud
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
livedoor
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
Mark Kilgard
 
WaterFlowUDK
WaterFlowUDKWaterFlowUDK
WaterFlowUDK
min9202
 
Geometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupGeometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping Setup
Mark Kilgard
 
CS193P Lecture 5 View Animation
CS193P Lecture 5 View AnimationCS193P Lecture 5 View Animation
CS193P Lecture 5 View Animation
onoaonoa
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)
Marakana Inc.
 
Applets
AppletsApplets
Intro to Game Programming
Intro to Game ProgrammingIntro to Game Programming
Intro to Game Programming
Richard Jones
 
2. reflection (solved example + exercise)
2. reflection (solved example + exercise)2. reflection (solved example + exercise)
2. reflection (solved example + exercise)
SameepSehgal1
 
Introduction to Game Programming Tutorial
Introduction to Game Programming TutorialIntroduction to Game Programming Tutorial
Introduction to Game Programming Tutorial
Richard Jones
 
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184
Mahmoud Samir Fayed
 
Maximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityMaximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unity
WithTheBest
 

What's hot (20)

Learn Java 3D
Learn Java 3D Learn Java 3D
Learn Java 3D
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harris
 
Lec2
Lec2Lec2
Lec2
 
A practical intro to BabylonJS
A practical intro to BabylonJSA practical intro to BabylonJS
A practical intro to BabylonJS
 
Anschp34
Anschp34Anschp34
Anschp34
 
Ch32 ssm
Ch32 ssmCh32 ssm
Ch32 ssm
 
Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...
Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...
Company of Heroes 2 (COH2) Rendering Technology: The cold facts of recreating...
 
05 Views
05 Views05 Views
05 Views
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
 
WaterFlowUDK
WaterFlowUDKWaterFlowUDK
WaterFlowUDK
 
Geometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupGeometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping Setup
 
CS193P Lecture 5 View Animation
CS193P Lecture 5 View AnimationCS193P Lecture 5 View Animation
CS193P Lecture 5 View Animation
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)
 
Applets
AppletsApplets
Applets
 
Intro to Game Programming
Intro to Game ProgrammingIntro to Game Programming
Intro to Game Programming
 
2. reflection (solved example + exercise)
2. reflection (solved example + exercise)2. reflection (solved example + exercise)
2. reflection (solved example + exercise)
 
Introduction to Game Programming Tutorial
Introduction to Game Programming TutorialIntroduction to Game Programming Tutorial
Introduction to Game Programming Tutorial
 
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184
 
Maximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityMaximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unity
 

Viewers also liked

XNA Intro Workshop
XNA Intro WorkshopXNA Intro Workshop
XNA Intro Workshop
Sjors Miltenburg
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Mohammad Shaker
 
C# Starter L07-Objects Cloning
C# Starter L07-Objects CloningC# Starter L07-Objects Cloning
C# Starter L07-Objects Cloning
Mohammad Shaker
 
Delphi L02 Controls P1
Delphi L02 Controls P1Delphi L02 Controls P1
Delphi L02 Controls P1
Mohammad Shaker
 
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D EnvironmentUtilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
Mohammad Shaker
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an Indie
Mohammad Shaker
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
Mohammad Shaker
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
Mohammad Shaker
 
C# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow FoundationC# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow Foundation
Mohammad Shaker
 
WPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and TemplatesWPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and Templates
Mohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
Mohammad Shaker
 
C# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCFC# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCF
Mohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
Mohammad Shaker
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
Mohammad Shaker
 
Car Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS SystemsCar Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS Systems
Mohammad Shaker
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
Mohammad Shaker
 
How to Study New Ones: The Student Guide
How to Study New Ones: The Student GuideHow to Study New Ones: The Student Guide
How to Study New Ones: The Student Guide
Sivashanmugam Palaniappan
 
Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...
Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...
Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...
idescitation
 
ePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced Technology
ePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced TechnologyePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced Technology
ePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced Technology
e-Patient Connections
 
NEDRA Big Data, Big Gifts: Social Donor Management
NEDRA Big Data, Big Gifts: Social Donor Management NEDRA Big Data, Big Gifts: Social Donor Management
NEDRA Big Data, Big Gifts: Social Donor Management
EverTrue
 

Viewers also liked (20)

XNA Intro Workshop
XNA Intro WorkshopXNA Intro Workshop
XNA Intro Workshop
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
 
C# Starter L07-Objects Cloning
C# Starter L07-Objects CloningC# Starter L07-Objects Cloning
C# Starter L07-Objects Cloning
 
Delphi L02 Controls P1
Delphi L02 Controls P1Delphi L02 Controls P1
Delphi L02 Controls P1
 
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D EnvironmentUtilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an Indie
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 
C# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow FoundationC# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow Foundation
 
WPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and TemplatesWPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and Templates
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
 
C# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCFC# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCF
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
 
Car Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS SystemsCar Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS Systems
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
 
How to Study New Ones: The Student Guide
How to Study New Ones: The Student GuideHow to Study New Ones: The Student Guide
How to Study New Ones: The Student Guide
 
Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...
Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...
Quantitative Comparison of Artificial Honey Bee Colony Clustering and Enhance...
 
ePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced Technology
ePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced TechnologyePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced Technology
ePatCon11: Miron-Shatz - Inserting the Human Factor in Advanced Technology
 
NEDRA Big Data, Big Gifts: Social Donor Management
NEDRA Big Data, Big Gifts: Social Donor Management NEDRA Big Data, Big Gifts: Social Donor Management
NEDRA Big Data, Big Gifts: Social Donor Management
 

Similar to XNA L02–Basic Matrices and Transformations

Programming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin EvolveProgramming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin Evolve
Frank Krueger
 
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
StanfordComputationalImaging
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
Naman Dwivedi
 
Computer Vision sfm
Computer Vision sfmComputer Vision sfm
Computer Vision sfm
Wael Badawy
 
Computer Vision Structure from motion
Computer Vision Structure from motionComputer Vision Structure from motion
Computer Vision Structure from motion
Wael Badawy
 
SIFT.ppt
SIFT.pptSIFT.ppt
SIFT.ppt
ShubhShubh12
 
SIFT.ppt
SIFT.pptSIFT.ppt
SIFT.ppt
MaTruongThanh1
 
OpenGL basics
OpenGL basicsOpenGL basics
OpenGL basics
Mohammad Hosein Nemati
 
affine transformation for computer graphics
affine transformation for computer graphicsaffine transformation for computer graphics
affine transformation for computer graphics
DrSUGANYADEVIK
 
Spatio-temporal reasoning for traffic scene understanding
Spatio-temporal reasoning for traffic scene understandingSpatio-temporal reasoning for traffic scene understanding
Spatio-temporal reasoning for traffic scene understanding
PlanetData Network of Excellence
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago
Janie Clayton
 
Introduction to Real Time Rendering
Introduction to Real Time RenderingIntroduction to Real Time Rendering
Introduction to Real Time Rendering
Koray Hagen
 
Smart Room Gesture Control
Smart Room Gesture ControlSmart Room Gesture Control
Smart Room Gesture Control
Giwrgos Paraskevopoulos
 
06 image features
06 image features06 image features
06 image features
ankit_ppt
 
Fast rendering with starling
Fast rendering with starlingFast rendering with starling
Fast rendering with starling
Flash Conference
 
Information from pixels
Information from pixelsInformation from pixels
Information from pixels
Dave Snowdon
 
Core Animation
Core AnimationCore Animation
Core Animation
Diksha Bhargava
 
Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]
Saajid Akram
 
視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用
台灣資料科學年會
 
Virtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP AlgorithmVirtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP Algorithm
Benjoe Vidal
 

Similar to XNA L02–Basic Matrices and Transformations (20)

Programming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin EvolveProgramming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin Evolve
 
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
Build Your Own VR Display Course - SIGGRAPH 2017: Part 2
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Computer Vision sfm
Computer Vision sfmComputer Vision sfm
Computer Vision sfm
 
Computer Vision Structure from motion
Computer Vision Structure from motionComputer Vision Structure from motion
Computer Vision Structure from motion
 
SIFT.ppt
SIFT.pptSIFT.ppt
SIFT.ppt
 
SIFT.ppt
SIFT.pptSIFT.ppt
SIFT.ppt
 
OpenGL basics
OpenGL basicsOpenGL basics
OpenGL basics
 
affine transformation for computer graphics
affine transformation for computer graphicsaffine transformation for computer graphics
affine transformation for computer graphics
 
Spatio-temporal reasoning for traffic scene understanding
Spatio-temporal reasoning for traffic scene understandingSpatio-temporal reasoning for traffic scene understanding
Spatio-temporal reasoning for traffic scene understanding
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago
 
Introduction to Real Time Rendering
Introduction to Real Time RenderingIntroduction to Real Time Rendering
Introduction to Real Time Rendering
 
Smart Room Gesture Control
Smart Room Gesture ControlSmart Room Gesture Control
Smart Room Gesture Control
 
06 image features
06 image features06 image features
06 image features
 
Fast rendering with starling
Fast rendering with starlingFast rendering with starling
Fast rendering with starling
 
Information from pixels
Information from pixelsInformation from pixels
Information from pixels
 
Core Animation
Core AnimationCore Animation
Core Animation
 
Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]
 
視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用
 
Virtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP AlgorithmVirtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP Algorithm
 

More from Mohammad Shaker

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate
Mohammad Shaker
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
Mohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
Mohammad Shaker
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
Mohammad Shaker
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
Mohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
Mohammad Shaker
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
Mohammad Shaker
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
Mohammad Shaker
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
Mohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
Mohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
Mohammad Shaker
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
Mohammad Shaker
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
Mohammad Shaker
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
Mohammad Shaker
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes
Mohammad Shaker
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
Mohammad Shaker
 
Indie Series 01: Intro to Games
Indie Series 01: Intro to GamesIndie Series 01: Intro to Games
Indie Series 01: Intro to Games
Mohammad Shaker
 
Indie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSevenIndie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSeven
Mohammad Shaker
 
Indie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in GamesIndie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in Games
Mohammad Shaker
 
Roboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software EngineeringRoboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software Engineering
Mohammad Shaker
 

More from Mohammad Shaker (20)

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
 
Indie Series 01: Intro to Games
Indie Series 01: Intro to GamesIndie Series 01: Intro to Games
Indie Series 01: Intro to Games
 
Indie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSevenIndie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSeven
 
Indie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in GamesIndie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in Games
 
Roboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software EngineeringRoboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software Engineering
 

Recently uploaded

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

XNA L02–Basic Matrices and Transformations

  • 1. Mohammad Shaker mohammadshaker.com @ZGTRShaker 2011, 2012, 2013, 2014 XNA Game Development L02 –Transformations and Basic Matrices
  • 6. XNA Matrices • Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. • Matrix.Translation: Creates a translation matrix (one or more axes). • Matrix.Scale: Creates a scale matrix (one or more axes). • Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. • Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
  • 7. Basic Matrices View, Projection and World Matrices
  • 8. Basic Matrices •View, Projection and World Matrices
  • 10. RULE TO SEE A 3D SCENE YOU SHOULD SET UP:
  • 11. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA
  • 12. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA PROJECTION
  • 13. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA PROJECTION WORLD MATRIX
  • 14. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 15. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 16. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 17. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 18. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 20. XNA Matrices • Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. • Matrix.Translation: Creates a translation matrix (one or more axes). • Matrix.Scale: Creates a scale matrix (one or more axes). • Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. • Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
  • 21. View Matrices Matrix.CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector);
  • 22. View Matrices Matrix.CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector);
  • 23. View Matrices Matrix.CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector);
  • 24. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 25. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 27. XNA Matrices • Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. • Matrix.Translation: Creates a translation matrix (one or more axes). • Matrix.Scale: Creates a scale matrix (one or more axes). • Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. • Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
  • 29. Projection Matrices The Difference?!
  • 30. Projection Matrices The Difference?! perspective
  • 31. Projection Matrices The Difference?! perspective orthographic
  • 35. Projection Matrices Realistic? perspective orthographic
  • 36. Projection Matrices •Projection Matries Realistic? perspective orthographic
  • 37. Projection Matrices Architecture? perspective orthographic
  • 38. Projection Matrices Architecture? perspective orthographic
  • 39. Projection Matrices Usability? perspective orthographic
  • 40. Projection Matrices Usability? perspective orthographic
  • 41. XNA Matrices • Matrix.CreateRotationX, Matrix.CreateRotationY, and Matrix.CreateRotationZ: Each of these creates a rotation matrix for each of the axes. • Matrix.Translation: Creates a translation matrix (one or more axes). • Matrix.Scale: Creates a scale matrix (one or more axes). • Matrix.CreateLookAt: Creates a view matrix used to position the camera, by setting the 3D position of the camera, the 3D position it is facing, and which direction is “up” for the camera. • Matrix.CreatePerspectiveFieldOfView: Creates a projection matrix that uses a perspective view.
  • 42. Orthographic Projections •An orthographic projection can be created with the following code: Matrix.CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane);
  • 43. Orthographic Projections •An orthographic projection can be created with the following code: •Off-center orthogonal projection: Matrix.CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane); Matrix.CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane);
  • 44. Orthographic Projections •Ummm …. Matrix.CreateOrthographicOffCenter(-1, 1, -1, 1, 0.1f, 100f); Matrix.CreateOrthographic(2, 2, 0.1f, 100f);
  • 45. Orthographic Projections •Ummm …. Matrix.CreateOrthographicOffCenter(-1, 1, -1, 1, 0.1f, 100f); Matrix.CreateOrthographic(2, 2, 0.1f, 100f);
  • 46. Perspective Projections •PerspectiveFieldOfView Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 47. Perspective Projections Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 48. Perspective Projections Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 49. Perspective Projections Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 50. Perspective Projections •Perspective projections Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 51. Perspective Projections Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 52. Perspective Projections Matrix.CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
  • 53. Perspective Projections Matrix.CreatePerspective( float width, float height, float nearPlaneDistance, float farPlaneDistance);
  • 54. Perspective Projections Matrix.CreatePerspective( float width, float height, float nearPlaneDistance, float farPlaneDistance);
  • 55. Perspective Projections Matrix.CreatePerspective( float width, float height, float nearPlaneDistance, float farPlaneDistance);
  • 56. Perspective Projections Matrix.CreatePerspectiveOffCenter( float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance);
  • 57. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 58. RULE TO SEE A 3D SCENE YOU SHOULD SET UP: CAMERA (Singleton, for all objects) PROJECTION (Singleton, for all objects) WORLD MATRIX (For each object separately)
  • 59. World MatrixEach Object in 3D Has Its own World Matrix
  • 61. World Matrix •Example •Let’s assume that the coordinates of the triangle vertices are as follows:
  • 62. World Matrix •Example •To translate 40 units over the y axis’s positive direction,allyou need to do is to add 40 toeachy position, and you have the new coordinates for the vertices:
  • 65. Identity Scale Rotate Orbit Translate
  • 66. Transformations •Load Identity Matrix Matrix.Identity(); Identity Scale Rotate Orbit Translate
  • 67. Transformations •Create scale matrix Matrix.CreateScale(float scaleAmount); Identity Scale Rotate Orbit Translate
  • 68. Transformations •Create a matrix that rotates around the x-axis: Matrix.CreateRotateX(float angleInRadians); •Create a matrix that rotatesaround the y-axis: Matrix.CreateRotateY(float angleInRadians); •Create a matrix that rotatesaround the z-axis: Matrix.CreateRotateZ(float angleInRadians); Identity Scale Rotate Orbit Translate
  • 69. Transformations •Create a matrix that rotates points around an arbitrary axis: Matrix.CreateFromAxisAngle(Vector3 axis, float angleInRadians); Identity Scale Rotate Orbit Translate
  • 70. Transformations •Create an Orbit matrix?! Identity Scale Rotate Orbit Translate
  • 71. Transformations •Create an Orbit matrix?! It’s just “Translate then Rotate” Identity Scale Rotate Orbit Translate
  • 72. Transformations •Create a translation matrix: Matrix.CreateTranslation(Vector3 position); Identity Scale Rotate Orbit Translate
  • 75. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Identity Scale Rotate Orbit Translate
  • 76. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Identity Scale Rotate Orbit Translate
  • 77. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Identity Scale Rotate Orbit Translate
  • 78. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Identity Scale Rotate Orbit Translate
  • 79. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Identity Scale Rotate Orbit Translate
  • 80. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Identity Scale Rotate Orbit Translate
  • 81. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Not the same! Identity Scale Rotate Orbit Translate
  • 82. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Not the same! Identity Scale Rotate Orbit Translate
  • 83. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateRotationX(MathHelper.ToRadians(45)) * Matrix.CreateTranslation(newVector3(10, 0, 0)); Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Not the same! Identity Scale Rotate Orbit Translate
  • 84. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Identity Scale Rotate Orbit Translate
  • 85. Transformations •Multiple World Transformations Matrixresult = Matrix.CreateTranslation(newVector3(10, 0, 0)) * Matrix.CreateRotationX(MathHelper.ToRadians(45)); Identity Scale Rotate Orbit Translate
  • 86. Test’emlive! Souvenir, 9:03 AM, Tuesday, Aug.16th-2011 still awake :S
  • 88. Custom Matrices Matrix customMatrix= new Matrix( floatm11, floatm12, floatm13, floatm14, floatm21, floatm22, floatm23, floatm24, floatm31, floatm32, floatm33, floatm34, floatm41, floatm42, floatm43, floatm44);
  • 89. Custom Matrices •Custom Matrices Matrix customMatrix= new Matrix( floatm11, floatm12, floatm13, floatm14, floatm21, floatm22, floatm23, floatm24, floatm31, floatm32, floatm33, floatm34, floatm41, floatm42, floatm43, floatm44); customMatrix.M31 = 4;
  • 90. Basic Matrices -A Final Example Vector3cameraPosition= newVector3(30.0f, 30.0f, 30.0f); Vector3cameraTarget= newVector3(0.0f, 0.0f, 0.0f); // Look back at the origin floatfovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians floataspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; floatnear = 0.01f; // the near clipping plane distance floatfar = 100f; // the far clipping plane distance Matrixworld = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); Matrixview = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); Matrixprojection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
  • 91. Basic Matrices -A Final Example Vector3cameraPosition= newVector3(30.0f, 30.0f, 30.0f); Vector3cameraTarget= newVector3(0.0f, 0.0f, 0.0f); // Look back at the origin float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; float near = 0.01f; // the near clipping plane distance float far = 100f; // the far clipping plane distance Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); Matrixview = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
  • 92. Basic Matrices -A Final Example Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin floatfovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians floataspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; floatnear = 0.01f; // the near clipping plane distance floatfar = 100f; // the far clipping plane distance Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); Matrixprojection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
  • 93. Basic Matrices -A Final Example Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; float near = 0.01f; // the near clipping plane distance float far = 100f; // the far clipping plane distance Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
  • 94. Basic Matrices -A Final Example Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; float near = 0.01f; // the near clipping plane distance float far = 100f; // the far clipping plane distance Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);
  • 95. Basic Matrices -A Final Example Vector3 cameraPosition= new Vector3(30.0f, 30.0f, 30.0f); Vector3 cameraTarget= new Vector3(0.0f, 0.0f, 0.0f); // Look back at the origin float fovAngle= MathHelper.ToRadians(45); // convert 45 degrees to radians float aspectRatio= graphics.PreferredBackBufferWidth/ graphics.PreferredBackBufferHeight; float near = 0.01f; // the near clipping plane distance float far = 100f; // the far clipping plane distance Matrix world = Matrix.CreateTranslation(10.0f, 0.0f, 10.0f); Matrix view = Matrix.CreateLookAt(cameraPosition, cameraTarget, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, aspectRatio, near, far);