<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Isometric Tilemap Rendering with libgdx</title>
	<atom:link href="http://www.badlogicgames.com/wordpress/?feed=rss2&#038;p=2032" rel="self" type="application/rss+xml" />
	<link>http://www.badlogicgames.com/wordpress/?p=2032</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 13:01:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Big Rich</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-113185</link>
		<dc:creator>Big Rich</dc:creator>
		<pubDate>Wed, 02 Jan 2013 15:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-113185</guid>
		<description><![CDATA[Hi,
Will this setup work for draw cube or grid of cubes, draw using GL_LINES, so that they&#039;re 3D but use Orthographic projection? 

I want to be able draw something Rubiks-cube-like, in 3D, but don&#039;t want it to have perspective, i.e. the cubes towards the back of the world space should appear to be the same size as those closest to the camera (i.e. extended lines should never meet, as you might expect for from Orthographic projection).

The cubes would be drawn using Vertices and Indices (i.e. Mesh class), and would probably not include textures or pre-built models. Is the above code relevant?

Thanks

Rich]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
Will this setup work for draw cube or grid of cubes, draw using GL_LINES, so that they&#8217;re 3D but use Orthographic projection? </p>
<p>I want to be able draw something Rubiks-cube-like, in 3D, but don&#8217;t want it to have perspective, i.e. the cubes towards the back of the world space should appear to be the same size as those closest to the camera (i.e. extended lines should never meet, as you might expect for from Orthographic projection).</p>
<p>The cubes would be drawn using Vertices and Indices (i.e. Mesh class), and would probably not include textures or pre-built models. Is the above code relevant?</p>
<p>Thanks</p>
<p>Rich</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TM4rkuS</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-111872</link>
		<dc:creator>TM4rkuS</dc:creator>
		<pubDate>Wed, 17 Oct 2012 18:38:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-111872</guid>
		<description><![CDATA[Even if this one is a little bit older, i hope to find some help here.
The code works fine for me, I adjusted it a little bit, so i can&#039;t scroll out of the displayed map. It seems a bit nasty to me, but the code works. I calculate the point-Vectors of the four corners and then detect, wheter the center of the screen is out of my displayed area. If so, I calculate the nearest point on the line between the two nearest corners and let the camera flip to that point. That works fine, and the calculation of the points is no problem, IF the y-coordinate of the camera is exactly half the number of the tiles. Then the (0 &#124; 0) coordinate of my displayed icons equals (tiles/2 &#124; tiles/2) for the camera. That&#039;s very handy, because now 1 step of the camera is one step of my displayed icons.
BUT, the problem that comes up, is: If i want to display bigger areas, with maybe 120 x 120 tiles, the camera just cuts some part of the view out. The y-coordinate is now 60. If i make the y-coordinate smaller, let&#039;s say 30, everything is displayed fine again. BUT: Now the calculation does not work properly, because the (0 &#124; 0) coordinate of my displayed icons does NOT equals (tiles/2 &#124; tiles/2) any more.
Why does that happen? I don&#039;t really get what the y-coordinate stands for, and what it does after all.]]></description>
		<content:encoded><![CDATA[<p>Even if this one is a little bit older, i hope to find some help here.<br />
The code works fine for me, I adjusted it a little bit, so i can&#8217;t scroll out of the displayed map. It seems a bit nasty to me, but the code works. I calculate the point-Vectors of the four corners and then detect, wheter the center of the screen is out of my displayed area. If so, I calculate the nearest point on the line between the two nearest corners and let the camera flip to that point. That works fine, and the calculation of the points is no problem, IF the y-coordinate of the camera is exactly half the number of the tiles. Then the (0 | 0) coordinate of my displayed icons equals (tiles/2 | tiles/2) for the camera. That&#8217;s very handy, because now 1 step of the camera is one step of my displayed icons.<br />
BUT, the problem that comes up, is: If i want to display bigger areas, with maybe 120 x 120 tiles, the camera just cuts some part of the view out. The y-coordinate is now 60. If i make the y-coordinate smaller, let&#8217;s say 30, everything is displayed fine again. BUT: Now the calculation does not work properly, because the (0 | 0) coordinate of my displayed icons does NOT equals (tiles/2 | tiles/2) any more.<br />
Why does that happen? I don&#8217;t really get what the y-coordinate stands for, and what it does after all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lomelin</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-110732</link>
		<dc:creator>Lomelin</dc:creator>
		<pubDate>Tue, 10 Jul 2012 15:37:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-110732</guid>
		<description><![CDATA[Thanks it really helped me ! Awesome support ^^

Here&#039;s my implementation with hexagonal map, I&#039;m sure my method to find the closest center can optimized (i.e with quadtree) :

The creation : 
==============
for(int z = 0; z &lt; 10; z++) {
     for(int x = 0; x &lt; 10; x++) {
	float tmpX = x * .75f;
	float tmpY = z;
	if(x%2 == 0)	tmpY -= .5f; 
		mesCases[x][z] = new Case(tmpX,tmpY);
	}
}

Input : 
=======

Ray pickRay = cam.getPickRay(Gdx.input.getX(), Gdx.input.getY());
.....
Vector2 clique = trouverPlusProche(intersection.x, intersection.z);
				
Closest :
=========

static float distX;
static float distZ;
static float dist = 999999999999999f;
static float distPrecedente = 9999999999999999999999f;
static int plusProcheX = 0;
static int plusProcheZ = 0;
	
private static Vector2 trouverPlusProche(float pointX, float pointZ) {		
      dist = 999999999999999f;
	distPrecedente = 9999999999999999999999f;
		for (int z = 0; z &lt; 10; z++) {
			for (int x = 0; x &lt; 10; x++) {
			distX = pointX - mesCases[x][z].centre.x;			
				if (distX &lt; 0.43301270189221932338186158537647f) {  
				distZ = pointZ - mesCases[x][z].centre.y;	
					if (distZ  0 &amp;&amp; distZ &gt; 0)
							dist = distX + distZ;
						if (distX &gt; 0 &amp;&amp; distZ &lt; 0)
							dist = distX + (-distZ);
						if (distX  0)
							dist = (-distX) + distZ;
						if (distX &lt; 0 &amp;&amp; distZ &lt; 0)
							dist = (-distX) + (-distZ); 
						if (dist &lt; distPrecedente) {
							plusProcheX = x;
							plusProcheZ = z;
							distPrecedente = dist;
						}
					}
				}
			}
		}
	return new Vector2(plusProcheX,plusProcheZ);
}]]></description>
		<content:encoded><![CDATA[<p>Thanks it really helped me ! Awesome support ^^</p>
<p>Here&#8217;s my implementation with hexagonal map, I&#8217;m sure my method to find the closest center can optimized (i.e with quadtree) :</p>
<p>The creation :<br />
==============<br />
for(int z = 0; z &lt; 10; z++) {<br />
     for(int x = 0; x &lt; 10; x++) {<br />
	float tmpX = x * .75f;<br />
	float tmpY = z;<br />
	if(x%2 == 0)	tmpY -= .5f;<br />
		mesCases[x][z] = new Case(tmpX,tmpY);<br />
	}<br />
}</p>
<p>Input :<br />
=======</p>
<p>Ray pickRay = cam.getPickRay(Gdx.input.getX(), Gdx.input.getY());<br />
&#8230;..<br />
Vector2 clique = trouverPlusProche(intersection.x, intersection.z);</p>
<p>Closest :<br />
=========</p>
<p>static float distX;<br />
static float distZ;<br />
static float dist = 999999999999999f;<br />
static float distPrecedente = 9999999999999999999999f;<br />
static int plusProcheX = 0;<br />
static int plusProcheZ = 0;</p>
<p>private static Vector2 trouverPlusProche(float pointX, float pointZ) {<br />
      dist = 999999999999999f;<br />
	distPrecedente = 9999999999999999999999f;<br />
		for (int z = 0; z &lt; 10; z++) {<br />
			for (int x = 0; x &lt; 10; x++) {<br />
			distX = pointX &#8211; mesCases[x][z].centre.x;<br />
				if (distX &lt; 0.43301270189221932338186158537647f) {<br />
				distZ = pointZ &#8211; mesCases[x][z].centre.y;<br />
					if (distZ  0 &amp;&amp; distZ &gt; 0)<br />
							dist = distX + distZ;<br />
						if (distX &gt; 0 &amp;&amp; distZ &lt; 0)<br />
							dist = distX + (-distZ);<br />
						if (distX  0)<br />
							dist = (-distX) + distZ;<br />
						if (distX &lt; 0 &amp;&amp; distZ &lt; 0)<br />
							dist = (-distX) + (-distZ);<br />
						if (dist &lt; distPrecedente) {<br />
							plusProcheX = x;<br />
							plusProcheZ = z;<br />
							distPrecedente = dist;<br />
						}<br />
					}<br />
				}<br />
			}<br />
		}<br />
	return new Vector2(plusProcheX,plusProcheZ);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cian</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-109862</link>
		<dc:creator>Cian</dc:creator>
		<pubDate>Tue, 28 Feb 2012 20:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-109862</guid>
		<description><![CDATA[mario with libgdx could u just instantly try ur game examples in the boook with no framework?not that im lazy ive already done the framework]]></description>
		<content:encoded><![CDATA[<p>mario with libgdx could u just instantly try ur game examples in the boook with no framework?not that im lazy ive already done the framework</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnson</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-109487</link>
		<dc:creator>Johnson</dc:creator>
		<pubDate>Wed, 28 Dec 2011 11:03:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-109487</guid>
		<description><![CDATA[Hi Mario,

Could you also show us how to put a 2D sprite (the unit) on top of the tile? The 2D sprite would be projected differently from the tile itself.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Hi Mario,</p>
<p>Could you also show us how to put a 2D sprite (the unit) on top of the tile? The 2D sprite would be projected differently from the tile itself.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Books</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-59004</link>
		<dc:creator>Books</dc:creator>
		<pubDate>Sun, 02 Oct 2011 14:53:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-59004</guid>
		<description><![CDATA[Thank u master *o*]]></description>
		<content:encoded><![CDATA[<p>Thank u master *o*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-53311</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Thu, 22 Sep 2011 21:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-53311</guid>
		<description><![CDATA[Brilliant post, thank you very much.]]></description>
		<content:encoded><![CDATA[<p>Brilliant post, thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-22290</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 14 Jul 2011 19:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-22290</guid>
		<description><![CDATA[Hey Mario, great work ! Keep the good things coming !
Got one question though, what if I needed a stage of actors inside the screen to be rendered the same iso way ? The cam works just fine but the batch rotation seems to be overrided deep inside the stage.]]></description>
		<content:encoded><![CDATA[<p>Hey Mario, great work ! Keep the good things coming !<br />
Got one question though, what if I needed a stage of actors inside the screen to be rendered the same iso way ? The cam works just fine but the batch rotation seems to be overrided deep inside the stage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-13388</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Sat, 18 Jun 2011 13:49:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-13388</guid>
		<description><![CDATA[I have a simpler solution to the much larger issue you allude to above.

When you monetion that the sprites are upside down and need to be flipped, that isn\&#039;t the whole story.  The truth is, everything is flipped, including tile coordinates, so your bottom left tile (0, 0) is actually now your right most tile in the isometric view.

The way to avoid all this isues is to stick with keeping the tiles extending into +x and -z so that your base vectors aren\&#039;t changing (the above aproach flips the sign of z).

Luckily it\&#039;s the easist change you could possibly make.  You just need to add a single characte to change the dirction of rotation of the plane the sprites get rendered in.

matrix.setToRotation(new Vector3(1, 0, 0), -90);

Now just keep in mind that moving into your screen now involves moving into -z so you may have to update your camera position.]]></description>
		<content:encoded><![CDATA[<p>I have a simpler solution to the much larger issue you allude to above.</p>
<p>When you monetion that the sprites are upside down and need to be flipped, that isn\&#8217;t the whole story.  The truth is, everything is flipped, including tile coordinates, so your bottom left tile (0, 0) is actually now your right most tile in the isometric view.</p>
<p>The way to avoid all this isues is to stick with keeping the tiles extending into +x and -z so that your base vectors aren\&#8217;t changing (the above aproach flips the sign of z).</p>
<p>Luckily it\&#8217;s the easist change you could possibly make.  You just need to add a single characte to change the dirction of rotation of the plane the sprites get rendered in.</p>
<p>matrix.setToRotation(new Vector3(1, 0, 0), -90);</p>
<p>Now just keep in mind that moving into your screen now involves moving into -z so you may have to update your camera position.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario</title>
		<link>http://www.badlogicgames.com/wordpress/?p=2032&#038;cpage=1#comment-13175</link>
		<dc:creator>Mario</dc:creator>
		<pubDate>Fri, 17 Jun 2011 12:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.badlogicgames.com/wordpress/?p=2032#comment-13175</guid>
		<description><![CDATA[i&#039;m afraid there won&#039;t be a 2point5d package. Don&#039;t worry about the matrix operations in the touch event handling code. There&#039;s no way around it, and they are executed on the main loop/rendering thread not the ui thread.]]></description>
		<content:encoded><![CDATA[<p>i&#8217;m afraid there won&#8217;t be a 2point5d package. Don&#8217;t worry about the matrix operations in the touch event handling code. There&#8217;s no way around it, and they are executed on the main loop/rendering thread not the ui thread.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
