Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Windows 8 Game Development

You're reading from   Learning Windows 8 Game Development Windows 8 brings touchscreens to the tablet and PC. This book will show you how to develop games for both by following clear, hands-on examples. Takes your C++ skills into exciting areas of 3D development.

Arrow left icon
Product type Paperback
Published in Oct 2013
Publisher Packt
ISBN-13 9781849697446
Length 244 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Michael Quandt Michael Quandt
Author Profile Icon Michael Quandt
Michael Quandt
Arrow right icon
View More author details
Toc

Orientation


There are multiple sensors that can be used independently or in combination to get the orientation of a device. Many modern mobile PCs, from tablets to even laptops have some or all of these sensors built-in. WinRT allows access to the individual sensors, as well as a nice Orientation Sensor API that combines all of the provided data and does the math required to give you the angles you want in a simpler form. It's up to you what you use, depending on how much information you require.

Let's take a look at how to work with each sensor individually, and then look at the Orientation Sensor API, which takes data from all of these and gives you the information you need, saving you a lot of time.

Accelerometer

The accelerometer is a sensor that detects the direction and acceleration of the device. This can be used to determine if the device is moving, but sometimes it is used to determine the gravity direction to provide a reference to other sensors and determine orientation.

For example...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime