Book Image

Direct3D Rendering Cookbook

Book Image

Direct3D Rendering Cookbook

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Further Reading
Index

Using a right-handed coordinate system


Up to this point, we have used a left-handed coordinate system, where the z axis points away from the view. The Visual Studio graphics content pipeline assumes a right-handed coordinate system when producing .cmo files. For the resulting 3D models we use for the remainder of this book, use a clockwise vertex winding order. The difference between left-handed and right-handed coordinates can be seen in the following figure:

Left-handed versus right-handed Cartesian coordinates – note that the z axis is reversed

In this recipe, we will look at the changes necessary to use a right-handed coordinate system and what this means for our 3D assets. This recipe can be applied to any SharpDX Direct3D application.

How to do it…

We will first step through the changes to the view and projection setup and then look at the changes necessary to the vertices within the simple QuadRenderer class.

  1. When creating the view matrix, use SharpDX.Matrix.LookAtRH instead of SharpDX...