Skip to content

Latest commit

 

History

History
 
 

CoreMotionTeapot

{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf290
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;\f2\fnil\fcharset0 LucidaGrande;
}
{\colortbl;\red255\green255\blue255;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{square\}}{\leveltext\leveltemplateid1\'01\uc0\u9642 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{square\}}{\leveltext\leveltemplateid101\'01\uc0\u9642 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
\margl1440\margr1440\vieww10340\viewh11920\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\b\fs28 \cf0 CoreMotionTeapot
\b0\fs24 \
\
CoreMotionTeapot is an application project that demonstrates how to receive and process accelerometer and device motion data. Using this data and OpenGL ES, the application animates  a teapot image in three-dimensional space.\
\
The project has the following classes and protocol, which (except where noted) have corresponding 
\f1\fs20 .h
\f0\fs24  and 
\f1\fs20 .m
\f0\fs24  file:\
\
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural
\ls1\ilvl0\cf0 {\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 CoreMotionTeapotAppDelegate
\f0\fs24  \'97A standard implementation of the 
\f1\fs20 UIApplicationDelegate
\f0\fs24  protocol. \
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 EAGLView
\f0\fs24  \'97A custom view class that wraps a 
\f1\fs20 CAEAGLLayer
\f0\fs24  object and acts as a surface for OpenGL ES rendering. It also wraps several UIKit controls that allow the user to choose whether to render the teapot using raw accelerometer or processed device motion data, as well as tune various filter parameters. It creates an instance of CMMotionManager and uses it to receive both accelerometer and device motion data.\
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 AccelerometerFilter
\f0\fs24  - Contains an implementation of a low- and high-pass filter\
\pard\tx560\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural
\ls2\ilvl0\cf0 In addition, the following files contain various utilities and data:\
{\listtext	
\f2 \uc0\u9642 
\f0 	}\
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 matrix.h/.m
\f0\fs24  - Contains various utility functions for operating on matrices.\
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 vector.h
\f0\fs24  - Contains various utility functions for operating on vectors.\
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 vector_inline_implementation.h
\f0\fs24  - Contains inline implementations of the functions in 
\f1\fs20 vector.h.
\f0\fs24 \
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 teapot.h
\f0\fs24  - Contains data needed for rendering the teapot.\
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 vertex.shader
\f0\fs24  - Contains a simple OpenGL ES 2.0 vertex shader.\
{\listtext	
\f2 \uc0\u9642 
\f0 	}
\f1\fs20 fragment.shader
\f0\fs24  - Contains a simple OpenGL ES 2.0 fragment shader.\
\pard\tx560\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
Device-motion data is derived from both the accelerometer and the gyroscope;  Core Motion processes the data before delivering it to the application.\
\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\b \cf0 Related Information\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\b0 \cf0 "Motion Events" in 
\i Event Handling Guide for iPhone OS
\i0  explains how to use the Core Motion API. The document also includes links to related Core Motion reference documentation.\
\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\b \cf0 Special Considerations\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\b0 \cf0 If you run the compiled application on a device that does not have a gyroscope, you cannot use device motion data. You cannot effectively run the application on the simulator, for obvious reasons.\
\
\
\
}