<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mozketo &#187; Talks</title>
	<atom:link href="http://mozketo.com/category/talks/feed/" rel="self" type="application/rss+xml" />
	<link>http://mozketo.com</link>
	<description>Now a dev diary</description>
	<lastBuildDate>Thu, 25 Mar 2010 09:17:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cocoaheads Jan 5 &#8211; Core Animation</title>
		<link>http://mozketo.com/cocoaheads-jan-5-core-animation/</link>
		<comments>http://mozketo.com/cocoaheads-jan-5-core-animation/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 08:30:10 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Talks]]></category>
		<category><![CDATA[Core Animation]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=74</guid>
		<description><![CDATA[Today I did a little talk at Cocoaheads Brisbane, Australia. It was on Core Animation and I made a very very very very very simple application which would rotate a single image using CATransform3DIdentity to give it a nice perspective 3D rotation look.
Here&#8217;s the full Xcode 3.1 project: Download. 
If you&#8217;re interested solely in the transformation here&#8217;s the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I did a little talk at Cocoaheads Brisbane, Australia. It was on Core Animation and I made a very very very very very simple application which would rotate a single image using <code>CATransform3DIdentity</code> to give it a nice perspective 3D rotation look.</p>
<p>Here&#8217;s the full Xcode 3.1 project: <a href='http://mozketo.com/wp-content/uploads/2009/01/ca_photospin03.zip'>Download</a>. </p>
<p>If you&#8217;re interested solely in the transformation here&#8217;s the code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p74code2'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p742"><td class="code" id="p74code2"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">float</span> zDistance <span style="color: #002200;">=</span> <span style="color: #2400d9;">850</span>;
CATransform3D sublayerTransform <span style="color: #002200;">=</span> CATransform3DIdentity;
sublayerTransform.m34 <span style="color: #002200;">=</span> <span style="color: #2400d9;">1.0</span> <span style="color: #002200;">/</span> <span style="color: #002200;">-</span>zDistance;
subLayer.transform <span style="color: #002200;">=</span> sublayerTransform;
&nbsp;
CABasicAnimation <span style="color: #002200;">*</span>flipAnimation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CABasicAnimation animationWithKeyPath<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;transform.rotation.y&quot;</span><span style="color: #002200;">&#93;</span>;
flipAnimation.toValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithDouble<span style="color: #002200;">:</span>1.0f <span style="color: #002200;">*</span> M_PI<span style="color: #002200;">&#93;</span>;
flipAnimation.autoreverses <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
flipAnimation.duration <span style="color: #002200;">=</span> 2.0f;
flipAnimation.repeatCount <span style="color: #002200;">=</span> 1e100f;
flipAnimation.timingFunction <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CAMediaTimingFunction functionWithName<span style="color: #002200;">:</span>kCAMediaTimingFunctionEaseInEaseOut<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>subLayer addAnimation<span style="color: #002200;">:</span>flipAnimation forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;flip&quot;</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>Where subLayer == your Core Animation layer you want to rotate.</p>
<p>Reference: <a href="http://www.pragprog.com/titles/bdcora/core-animation-for-mac-os-x-and-the-iphone">Core Animation for Mac OS X and the iPhone</a> and <a href="http://atomicwang.org/motherfucker/Index/B4E5D81C-A9A0-403C-B7A3-62FEB81DE777.html">Mike Lee</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/cocoaheads-jan-5-core-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
