SlideShare ist ein Scribd-Unternehmen logo
1 von 95
Downloaden Sie, um offline zu lesen
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);

Weitere ähnliche Inhalte

Was ist angesagt?

Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harrisWael Badawy
 
A practical intro to BabylonJS
A practical intro to BabylonJSA practical intro to BabylonJS
A practical intro to BabylonJSHansRontheWeb
 
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
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Gameslivedoor
 
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 HardwareMark Kilgard
 
WaterFlowUDK
WaterFlowUDKWaterFlowUDK
WaterFlowUDKmin9202
 
Geometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupGeometry Shader-based Bump Mapping Setup
Geometry Shader-based Bump Mapping SetupMark Kilgard
 
CS193P Lecture 5 View Animation
CS193P Lecture 5 View AnimationCS193P Lecture 5 View Animation
CS193P Lecture 5 View Animationonoaonoa
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Marakana Inc.
 
Intro to Game Programming
Intro to Game ProgrammingIntro to Game Programming
Intro to Game ProgrammingRichard 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 TutorialRichard 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 184Mahmoud 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 unityWithTheBest
 

Was ist angesagt? (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
 

Andere mochten auch

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 CloningMohammad 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 EnvironmentMohammad Shaker
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieMohammad Shaker
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPMohammad Shaker
 
C# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow FoundationC# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow FoundationMohammad 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 TemplatesMohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyMohammad Shaker
 
C# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCFC# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCFMohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015Mohammad 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 MethodsMohammad 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 SystemsMohammad Shaker
 
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 Technologye-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
 

Andere mochten auch (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
 

Ähnlich wie XNA L02–Basic Matrices and Transformations

Programming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin EvolveProgramming Augmented Reality - Xamarin Evolve
Programming Augmented Reality - Xamarin EvolveFrank 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 2StanfordComputationalImaging
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
Computer Vision Structure from motion
Computer Vision Structure from motionComputer Vision Structure from motion
Computer Vision Structure from motionWael Badawy
 
Computer Vision sfm
Computer Vision sfmComputer Vision sfm
Computer Vision sfmWael Badawy
 
affine transformation for computer graphics
affine transformation for computer graphicsaffine transformation for computer graphics
affine transformation for computer graphicsDrSUGANYADEVIK
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf ChicagoJanie Clayton
 
Introduction to Real Time Rendering
Introduction to Real Time RenderingIntroduction to Real Time Rendering
Introduction to Real Time RenderingKoray Hagen
 
06 image features
06 image features06 image features
06 image featuresankit_ppt
 
Fast rendering with starling
Fast rendering with starlingFast rendering with starling
Fast rendering with starlingFlash Conference
 
Information from pixels
Information from pixelsInformation from pixels
Information from pixelsDave Snowdon
 
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 AlgorithmBenjoe Vidal
 

Ähnlich wie 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 Structure from motion
Computer Vision Structure from motionComputer Vision Structure from motion
Computer Vision Structure from motion
 
Computer Vision sfm
Computer Vision sfmComputer Vision sfm
Computer Vision sfm
 
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
 

Mehr von 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 GraduateMohammad Shaker
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game DevelopmentMohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesMohammad Shaker
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - ColorMohammad Shaker
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - TypographyMohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingMohammad Shaker
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and ThreadingMohammad Shaker
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSMohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsMohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsMohammad Shaker
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and GamingMohammad Shaker
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / ParseMohammad Shaker
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesMohammad 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 AdaptersMohammad Shaker
 
Indie Series 01: Intro to Games
Indie Series 01: Intro to GamesIndie Series 01: Intro to Games
Indie Series 01: Intro to GamesMohammad 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 SyncSevenMohammad 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 GamesMohammad Shaker
 
Roboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software EngineeringRoboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software EngineeringMohammad Shaker
 

Mehr von 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
 

Kürzlich hochgeladen

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Kürzlich hochgeladen (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

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);