<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: Camera Problems</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/1097</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:49:23 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/1097" rel="self" type="application/rss+xml" />

		<item>
			<title>penguins on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6668</link>
			<pubDate>Tue, 04 Aug 2009 15:46:29 +0000</pubDate>
			<dc:creator>penguins</dc:creator>
			<guid isPermaLink="false">6668@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>There removed, I removed it in my own code as well. Thanks.
</p></description>
		</item>
		<item>
			<title>GameBit on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6667</link>
			<pubDate>Tue, 04 Aug 2009 15:38:03 +0000</pubDate>
			<dc:creator>GameBit</dc:creator>
			<guid isPermaLink="false">6667@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>didn't riq said "[[self camera] restore]; // DON'T call any other camera method after this method."
</p></description>
		</item>
		<item>
			<title>penguins on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6658</link>
			<pubDate>Tue, 04 Aug 2009 14:05:03 +0000</pubDate>
			<dc:creator>penguins</dc:creator>
			<guid isPermaLink="false">6658@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks everyone, I solved it. I didn’t realize how many options there are associated with the camera, but using the Already predefined Z values did the trick. Just in case anyone else has the same problem,<br />
this is what I did:<br />
<pre><code>float centerX;
	float centerY;
	float centerZ;

	float eyeX;
	float eyeY;
	float eyeZ;

	float upX;
	float upY;
	float upZ;

	[[self camera] centerX:&#38;centerX centerY:&#38;centerY centerZ:&#38;centerZ];
	[[self camera] upX:&#38;upX upY:&#38;upY upZ:&#38;upZ];
	[[self camera] eyeX:&#38;eyeX eyeY:&#38;eyeY eyeZ:&#38;eyeZ];

	[[self camera] setEyeX:[player img].position.x  eyeY:[player img].position.y eyeZ:eyeZ];
	[[self camera] setCenterX:[player img].position.x centerY:[player img].position.y centerZ:centerZ];
	[[self camera] setUpX:upX upY:upY upZ:upZ];</code></pre>
<p>Thanks again.
</p></description>
		</item>
		<item>
			<title>pabloruiz55 on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6650</link>
			<pubDate>Tue, 04 Aug 2009 13:03:39 +0000</pubDate>
			<dc:creator>pabloruiz55</dc:creator>
			<guid isPermaLink="false">6650@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>[[self camera] setCenterX:[[player img] position].x centerY:[[player img] position].y centerZ:0];<br />
	[[self camera] setEyeX:[[player img] position].x eyeY:[[player img] position].y eyeZ:0];</p>
<p>you sohuldn't position the z to 0, get the camera's centerZ and eyeZ values and use them so the z values always remain the same.
</p></description>
		</item>
		<item>
			<title>penguins on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6648</link>
			<pubDate>Tue, 04 Aug 2009 12:56:41 +0000</pubDate>
			<dc:creator>penguins</dc:creator>
			<guid isPermaLink="false">6648@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks, That is the perspective that I want from doing that, everything flat, But how would I pan the layer. I got it to work with <code>self.position</code>, but I wanted to do it the "right", as seen by a previous thread with the camera.</p>
<p>Thanks for the help
</p></description>
		</item>
		<item>
			<title>riq on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6647</link>
			<pubDate>Tue, 04 Aug 2009 12:48:15 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">6647@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>just don't mix <code>[[self camera] restore];]</code> with the other methods.<br />
just try:<br />
<pre><code>[[self camera] restore];
// DON&#39;T call any other camera method after this method.</code></pre></description>
		</item>
		<item>
			<title>penguins on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6644</link>
			<pubDate>Tue, 04 Aug 2009 12:43:57 +0000</pubDate>
			<dc:creator>penguins</dc:creator>
			<guid isPermaLink="false">6644@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks for the help. I just tried the above,</p>
<pre><code>[[self camera] restore];
	[[self camera] setCenterX:[[player img] position].x centerY:[[player img] position].y centerZ:0];</code></pre>
<p>Gives me that same thing, (this is all in the gameLayer class.)<br />
and the<br />
<pre><code>[[self camera] restore];
	[[self camera] setCenterX:[[player img] position].x centerY:[[player img] position].y centerZ:0];
	[[self camera] setEyeX:[[player img] position].x eyeY:[[player img] position].y eyeZ:0];</code></pre>
<p>Gives me the black screen of death and sadness.</p>
<p>Is there some demo out there the uses camera? I have searched, and have found nothing.</p>
<p>Thanks for the help and speedy reply,
</p></description>
		</item>
		<item>
			<title>riq on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6632</link>
			<pubDate>Tue, 04 Aug 2009 11:13:50 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">6632@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>try with:</p>
<pre><code>[[node camera] restore];</code></pre></description>
		</item>
		<item>
			<title>pabloruiz55 on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6631</link>
			<pubDate>Tue, 04 Aug 2009 11:12:16 +0000</pubDate>
			<dc:creator>pabloruiz55</dc:creator>
			<guid isPermaLink="false">6631@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi! You should also center the camera's eye to the player. Also you have to set the z of the center and eye to the default of the camera.
</p></description>
		</item>
		<item>
			<title>penguins on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6604</link>
			<pubDate>Tue, 04 Aug 2009 02:09:05 +0000</pubDate>
			<dc:creator>penguins</dc:creator>
			<guid isPermaLink="false">6604@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am trying to eliminate the 3rd dimension. I am trying to make every tile, a square, 16px by 16px, the original setup. I am trying to eliminate the rotation of the the layer. Eliminate perspective.</p>
<p>Thanks for the help.
</p></description>
		</item>
		<item>
			<title>rbrooky on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6602</link>
			<pubDate>Tue, 04 Aug 2009 02:00:35 +0000</pubDate>
			<dc:creator>rbrooky</dc:creator>
			<guid isPermaLink="false">6602@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Not sure what you're trying to achieve? What do you mean by flat? The entire background or just the purple square in the middle.
</p></description>
		</item>
		<item>
			<title>penguins on "Camera Problems"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1097#post-6598</link>
			<pubDate>Tue, 04 Aug 2009 01:20:16 +0000</pubDate>
			<dc:creator>penguins</dc:creator>
			<guid isPermaLink="false">6598@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>Sorry if this is really basic, I am new to cocos2d.</p>
<p>The cocos camera object has been giving me so many troubles.</p>
<p>In this circumstance, a picture is worth a thousand words.</p>
<p><a href="http://emberapp.com/penguins/images/littlesnapper/">http://emberapp.com/penguins/images/littlesnapper/</a></p>
<p>So I am wondering how to make that Flat. The only camera code that I have is:</p>
<p><code>[self.camera setCenterX:[player img].position.x centerY:[player img].position.y centerZ:0];</code></p>
<p>Thanks for the help. And sorry if it was already on the forums. I searched camera for help, but found nothing pertaining to my problem.
</p></description>
		</item>

	</channel>
</rss>

