<?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>GaanZa &#187; Java</title>
	<atom:link href="http://www.gaanza.com/blog/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gaanza.com</link>
	<description></description>
	<lastBuildDate>Tue, 03 Jan 2012 10:09:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>looking for 2D physics engine for Android !!!</title>
		<link>http://www.gaanza.com/blog/android-physics-engine/</link>
		<comments>http://www.gaanza.com/blog/android-physics-engine/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 04:33:51 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Box 2d]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[android physics engine]]></category>
		<category><![CDATA[jbox2d]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/?p=631</guid>
		<description><![CDATA[I have been doing game development on android very recently (2 weeks) . And i bought samsung galaxy having android 2.1 to test my games and demos. I am pretty happy with the results and enjoying very much. Before this i had made games for j2me mobile devices and still making. Well anyway i am [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing game development on android very recently (2 weeks) <img src='http://www.gaanza.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . And i bought samsung galaxy having android 2.1 to test my games and demos. I am pretty happy with the results and enjoying very much. Before this i had made games for j2me mobile devices and still making. Well anyway i am not discussing android game development here so i am coming to the primary focus of this post.</p>
<p>Physics. Yeah physics is phun and if decent physics is added to your game then it makes game more enjoyable, of course if gameplay design is good and fun. I have been playing with my own very very basic physics code(collision detection, collision response) that i have written for j2me. It is working fine in android after tweaking my code here and there. But i wanted more features so i thought to look for any decent free opensource physics engine for android. Unfortunately i didn&#8217;t get much success. There were some forums and tutorials where using Box2d with android was discussed. <a href="http://www.anddev.org/how-to_2d_physics_with_box2d-t5099.html">This site</a> has shown the tutorial using JBox2d on android and is been discussed by the people there.</p>
<p>I am a big fan of Box2d. I have been using JBox2d and Box2d flash for my respective platform based game. Library had fulfilled my satisfaction and need. I have not tested JBox2d on android yet. I wanted to do few research on it before doing that. In few forums people complained that if using more than 5 bodies, it brings the FPS rate down and makes simulation very slow. I haven&#8217;t checked that but is going to write code to see if its true. <strong>I think it may depend on hardware device specification and capability because i have played Angry Birds on my samsung galaxy s and physics of game works just fine and smooth.</strong> I came across one <a href="http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/">site</a> where they showed the graph on how much number of bodies/elements effect the FPS(frame rate) using Box2d and Chipmunk. <a href="http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/">Here</a> it is.<br />
<a href="http://www.gaanza.com/wp-content/uploads/2010/12/graph.png"><img src="http://www.gaanza.com/wp-content/uploads/2010/12/graph.png" alt="" title="graph" width="600" height="262" class="aligncenter size-full wp-image-632" /></a></p>
<p>So now i am going to write a simple code of falling polygons using Box2d on android and see the FPS and performance. I will post the results and my experience on next post ASAP.</p>
<p><strong>Merry Christmas &#038; Happy New Year<br />
Gracias.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/android-physics-engine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LOST</title>
		<link>http://www.gaanza.com/blog/lost/</link>
		<comments>http://www.gaanza.com/blog/lost/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:31:48 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[gaanza]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[j2me game]]></category>
		<category><![CDATA[mobile game]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/lost/</guid>
		<description><![CDATA[These days i am busy with lots of things. I am working on a Game for Mobile Phones. This project is based on J2ME. Currently i have given the game a name &#8220;LOST&#8221; according to story and theme. Here is the video of my project. Well the video is just a testing of gameplay mechanics, [...]]]></description>
			<content:encoded><![CDATA[<p>These days i am busy with lots of things. I am working on a Game for Mobile Phones. This project is based on J2ME. Currently i have given the game a name &#8220;LOST&#8221; according to story and theme. Here is the video of my project. Well the video is just a testing of gameplay mechanics, all graphics and images will be different in the original game. So just check out what i am working on.</p>
<p><object width="640" height="385">
<param name="movie" value="http://www.youtube.com/v/pT06XCoqf-w?fs=1&amp;hl=en_US"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/pT06XCoqf-w?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p><a name="fb_share"></a><br />
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/lost/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2D Rain Effect</title>
		<link>http://www.gaanza.com/blog/2d-rain-effect/</link>
		<comments>http://www.gaanza.com/blog/2d-rain-effect/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 05:40:10 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Opengl]]></category>
		<category><![CDATA[Slick 2D]]></category>
		<category><![CDATA[lwjgl]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/?p=382</guid>
		<description><![CDATA[Hola Everyone. I am working on a level for 2d game where i needed to add a rain effects. I am using Slick 2D library for making my 2d game. Before i started working on making 2D rain effect , i discussed this topic on slick 2d forum for how to get started ? Here [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Hola Everyone.</strong><br />
I am working on a level for 2d game where i needed to add a rain effects. I am using Slick 2D library for making my 2d game. Before i started working on making  2D rain effect , i discussed this topic on slick 2d forum for how to get started ? Here is the <a href="http://slick.javaunlimited.net/viewtopic.php?p=13771#13771" target="_blank">forum thread</a>. You can check it out.<br />
So i wrote a simple code to create a rain effect:<br />
1)	Make a Rain Drop, i wrote a class for Rain Drop that extends Polygon class. Yes i m creating rain drops with polygons.<br />
2)	Create number of drops at random coordinates  and simulate it across the screen i.e make them fall. You can use wind factor also for providing bit more interesting.</p>
<p><a href="http://www.gaanza.com/wp-content/uploads/2010/03/rain1.png"><img class="alignnone size-full wp-image-388" title="rain" src="http://www.gaanza.com/wp-content/uploads/2010/03/rain1.png" alt="" width="599" height="768" /></a><br />
So this is the way i started.</p>
<p>Here is the Rain Drop class:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co2">import org.newdawn.slick.geom.Polygon;</span></p>
<p><span class="kw2">public</span> <span class="kw2">class</span> RainDrop <span class="kw2">extends</span> <a href="http://www.google.com/search?q=allinurl%3APolygon+java.sun.com&#038;bntl=1"><span class="kw3">Polygon</span></a><span class="br0">&#123;</span><br />
<span class="kw2">public</span> RainDrop<span class="br0">&#40;</span><span class="kw4">int</span> size<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
super<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="coMULTI">/** coordinates of vertices of polygon(rain drop) */</span><br />
<span class="kw2">this</span>.<span class="me1">addPoint</span><span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="kw2">this</span>.<span class="me1">addPoint</span><span class="br0">&#40;</span><span class="nu0">0</span>, size<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>This is the main class where we are using rain drops and simulating it to create a simple rain effect, nothing fancy.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co2">import java.util.logging.Level;</span><br />
<span class="co2">import java.util.logging.Logger;</span><br />
<span class="co2">import org.newdawn.slick.AppGameContainer;</span><br />
<span class="co2">import org.newdawn.slick.BasicGame;</span><br />
<span class="co2">import org.newdawn.slick.Color;</span><br />
<span class="co2">import org.newdawn.slick.GameContainer;</span><br />
<span class="co2">import org.newdawn.slick.Graphics;</span><br />
<span class="co2">import org.newdawn.slick.Image;</span><br />
<span class="co2">import org.newdawn.slick.SlickException;</span></p>
<p><span class="kw2">public</span> <span class="kw2">class</span> Rainy <span class="kw2">extends</span> BasicGame<span class="br0">&#123;</span></p>
<p><span class="kw2">private</span> RainDrop<span class="br0">&#91;</span><span class="br0">&#93;</span> drops;<br />
<span class="kw2">private</span> <a href="http://www.google.com/search?q=allinurl%3AImage+java.sun.com&#038;bntl=1"><span class="kw3">Image</span></a> background;</p>
<p><span class="kw2">public</span> Rainy<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp;super<span class="br0">&#40;</span><span class="st0">&#8220;&#8221;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">public</span> <span class="kw4">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<span class="kw2">try</span> <span class="br0">&#123;</span><br />
AppGameContainer app = <span class="kw2">new</span> AppGameContainer<span class="br0">&#40;</span><span class="kw2">new</span> Rainy<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
app.<span class="me1">setDisplayMode</span><span class="br0">&#40;</span><span class="nu0">1024</span>, <span class="nu0">768</span>, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
app.<span class="me1">setTargetFrameRate</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span>;<br />
app.<span class="me1">setShowFPS</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span>;<br />
app.<span class="me1">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span> <span class="kw2">catch</span> <span class="br0">&#40;</span>SlickException ex<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
Logger.<span class="me1">getLogger</span><span class="br0">&#40;</span>Rainy.<span class="kw2">class</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">log</span><span class="br0">&#40;</span>Level.<span class="me1">SEVERE</span>, <span class="kw2">null</span>, ex<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p>@Override<br />
<span class="kw2">public</span> <span class="kw4">void</span> init<span class="br0">&#40;</span>GameContainer gc<span class="br0">&#41;</span> <span class="kw2">throws</span> SlickException <span class="br0">&#123;</span><br />
background=<span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AImage+java.sun.com&#038;bntl=1"><span class="kw3">Image</span></a><span class="br0">&#40;</span><span class="st0">&#8220;data/jungle.jpg&#8221;</span><span class="br0">&#41;</span>;</p>
<p><span class="coMULTI">/** creating 700 rain drops and placing it on random location across the screen */</span><br />
initializeRain<span class="br0">&#40;</span><span class="nu0">900</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p>@Override<br />
<span class="kw2">public</span> <span class="kw4">void</span> update<span class="br0">&#40;</span>GameContainer gc, <span class="kw4">int</span> delta<span class="br0">&#41;</span> <span class="kw2">throws</span> SlickException <span class="br0">&#123;</span></p>
<p><span class="kw1">for</span><span class="br0">&#40;</span><span class="kw4">int</span> i=<span class="nu0">0</span>;i&lt;drops.<span class="me1">length</span>-<span class="nu0">1</span>;i++<span class="br0">&#41;</span><span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setY</span><span class="br0">&#40;</span>drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">getY</span><span class="br0">&#40;</span><span class="br0">&#41;</span>+<span class="nu0">4</span>.0f<span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setX</span><span class="br0">&#40;</span>drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">getX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">getY</span><span class="br0">&#40;</span><span class="br0">&#41;</span>&gt;<span class="nu0">768</span><span class="br0">&#41;</span><span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setX</span><span class="br0">&#40;</span><span class="br0">&#40;</span>float<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AMath+java.sun.com&#038;bntl=1"><span class="kw3">Math</span></a>.<span class="me1">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">2000</span><span class="br0">&#41;</span>+<span class="nu0">30</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setY</span><span class="br0">&#40;</span><span class="br0">&#40;</span>float<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AMath+java.sun.com&#038;bntl=1"><span class="kw3">Math</span></a>.<span class="me1">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p><span class="br0">&#125;</span></p>
<p><span class="br0">&#125;</span></p>
<p><span class="br0">&#125;</span></p>
<p><span class="kw2">public</span> <span class="kw4">void</span> render<span class="br0">&#40;</span>GameContainer gc, <a href="http://www.google.com/search?q=allinurl%3AGraphics+java.sun.com&#038;bntl=1"><span class="kw3">Graphics</span></a> g<span class="br0">&#41;</span> <span class="kw2">throws</span> SlickException <span class="br0">&#123;</span><br />
g.<span class="me1">drawImage</span><span class="br0">&#40;</span>background, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
g.<span class="me1">setColor</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&#038;bntl=1"><span class="kw3">Color</span></a><span class="br0">&#40;</span><span class="nu0">188</span>.0f,<span class="nu0">227</span>.0f,<span class="nu0">229</span>.0f,<span class="nu0">0</span>.3f<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">for</span><span class="br0">&#40;</span><span class="kw4">int</span> i=<span class="nu0">0</span>;i&lt;drops.<span class="me1">length</span>-<span class="nu0">1</span>;i++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;g.<span class="me1">draw</span><span class="br0">&#40;</span>drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="coMULTI">/** creating rain drops */</span><br />
<span class="kw4">void</span> initializeRain<span class="br0">&#40;</span><span class="kw4">int</span> num_of_drops<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
drops=<span class="kw2">new</span> RainDrop<span class="br0">&#91;</span>num_of_drops<span class="br0">&#93;</span>;<br />
<span class="kw1">for</span><span class="br0">&#40;</span><span class="kw4">int</span> i=<span class="nu0">0</span>;i&lt;drops.<span class="me1">length</span>-<span class="nu0">1</span>;i++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>=<span class="kw2">new</span> RainDrop<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AMath+java.sun.com&#038;bntl=1"><span class="kw3">Math</span></a>.<span class="me1">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">10</span> + <span class="nu0">4</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setX</span><span class="br0">&#40;</span><span class="br0">&#40;</span>float<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AMath+java.sun.com&#038;bntl=1"><span class="kw3">Math</span></a>.<span class="me1">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">2000</span><span class="br0">&#41;</span>+<span class="nu0">30</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; drops<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setY</span><span class="br0">&#40;</span><span class="br0">&#40;</span>float<span class="br0">&#41;</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AMath+java.sun.com&#038;bntl=1"><span class="kw3">Math</span></a>.<span class="me1">random</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">750</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="br0">&#125;</span></div>
</div>
<p>So what i am doing  :<br />
1)	initializeRain(int num_of_drops) takes an int parameter which denotes the number of rain drops. This function creates a number of rain drops(instance of raindrop class) and assigns the random x and y position to each rain drops.<br />
2)	Then we simply iterate the array of rain drops and translate them across the screen. When drops reaches the bottom of screen then we simply restore back to random initial starting postion. This keeps going on and gives the impression of rainy effect.</p>
<p>This is very simple 2d effect that i started with. You can write your own optimized version and can add more feature to give fancy impression like adding alpha values  for each rain drop etc.</p>
<p><strong>Gracias.</strong></p>
<p><a name="fb_share" type="box_count share_url="http://www.gaanza.com/blog/2d-rain-effect/"></a><br />
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" 
        type="text/javascript">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/2d-rain-effect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finding Nearest Sprite For 2D Collision</title>
		<link>http://www.gaanza.com/blog/finding-nearest-sprite-for-2d-collision/</link>
		<comments>http://www.gaanza.com/blog/finding-nearest-sprite-for-2d-collision/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 15:04:08 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Slick 2D]]></category>
		<category><![CDATA[2d collision]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/?p=368</guid>
		<description><![CDATA[Hola EveryOne. There are various methods/ways to detect a collision between two objects. Each having its own advantage and disadvantage and based on our requirement we implement one of the collsion detection algorithm. Here i am not going to talk about collision algorithm. I am going to talk about determining the nearest object with which [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Hola EveryOne.</strong></p>
<p>There are various methods/ways to detect a collision between two objects. Each having its own advantage and disadvantage and based on our requirement we implement one of the collsion detection algorithm.</p>
<p>Here i am not going to talk about collision algorithm. I am going to talk about determining the nearest object with which collision will take place. Suppose there are many objects across the screen and u have to detect the collision between your game character and those objects. And you run the algorithm to detect collision with each of every object in every frame. So it decreases the efficiency of your program. Its better to detremine the nearest object to your game character and detect collision with that determined nearest object.</p>
<p>Here i m using bounding rectangle concept for collision detection.<br />
<a href="http://www.gaanza.com/wp-content/uploads/2010/02/near2.png"><img src="http://www.gaanza.com/wp-content/uploads/2010/02/near2.png" alt="" title="concept diagram" width="567" height="523" class="alignnone size-full wp-image-373" /></a></p>
<p>Code Example:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">public</span> <span class="kw4">static</span> Sprite getNearestGroundSprite<span class="br0">&#40;</span>ArrayList&lt;Sprite&gt; sprites,Sprite hero<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; Sprite sprite=<span class="kw2">null</span>;<br />
&nbsp; &nbsp; float minDistance=<span class="nu0">9999</span>;<br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>hero!=<span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="kw4">int</span> i=<span class="nu0">0</span>;i&lt;sprites.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;i++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<span class="coMULTI">/* ignore all those objects which are not visible across the screen */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getSX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>&gt;screenWidth || <span class="br0">&#40;</span>sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getSX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>+sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>&lt;<span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
<span class="coMULTI">/* ignore all those objects which are located above the game character */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>hero.<span class="me1">getSY</span><span class="br0">&#40;</span><span class="br0">&#41;</span>&gt;sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getSY</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
<span class="coMULTI">/* ignore all those objects that are located at the left side of game character */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>hero.<span class="me1">getSX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>&gt;<span class="br0">&#40;</span>sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getSX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>+sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
<span class="coMULTI">/* ignore all those objects that are located at right side of game character */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#40;</span>hero.<span class="me1">getSX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>+hero.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>&lt;sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getSX</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>&nbsp; <br />
<span class="coMULTI">/* calculate the distance between remaining objects and game character */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; float dist=sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getSY</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-hero.<span class="me1">getSY</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="coMULTI">/* determine the nearest sprite from remaining sprites */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>dist&lt;minDistance<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; minDistance=dist;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sprite=sprites.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="coMULTI">/* nearest object found or return null if not found */</span><br />
&nbsp; &nbsp; <span class="kw2">return</span> sprite;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Sprite is just a class representing characters of game. getSX() and getSY() returns the x and y coordinate location of that sprite. getWidth() simply returns the width of the sprite image.</p>
<p>In above code i am ignoring all those sprites that are located at left, right and top of my game character because i need bottom sprite to check collision with i.e when character falls down. This way the number of sprites decreases for checking collisions. You can write function for finding nearest left and right sprites also. You need to call this function at right place and when needed.</p>
<p>This is very simple and basic way i started and it gets the job done. You can write your own optimized code. This is how i started. I have written my optimized code for finding nearest sprite but right now i won&#8217;t be posting it but i&#8217;l share it soon in near future.</p>
<p><strong>Gracias.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/finding-nearest-sprite-for-2d-collision/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Loading image/Texture Mapping in LWJGL</title>
		<link>http://www.gaanza.com/blog/loading-imagetexture-mapping-in-lwjgl/</link>
		<comments>http://www.gaanza.com/blog/loading-imagetexture-mapping-in-lwjgl/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 15:35:40 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Opengl]]></category>
		<category><![CDATA[loading image]]></category>
		<category><![CDATA[lwjgl]]></category>
		<category><![CDATA[texture mapping]]></category>
		<category><![CDATA[texture-lwjgl]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/?p=318</guid>
		<description><![CDATA[Hola everyone. I am currently working on my own two game projects: one project is of mobile phone game and other is 2.5 or side-scrolling 3d game, not much sure. So for second project i am making an small engine that will be used to make 2.5D game or side scrolling 3d game, Just simple [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-323" title="box" src="http://www.gaanza.com/wp-content/uploads/2009/10/box.png" alt="box" width="550" height="400" /></p>
<p>Hola everyone.</p>
<p>I am currently working on my own two game projects: one project is of mobile phone game and other is 2.5 or side-scrolling 3d game, not much sure. So for second project i am making an small engine that will be used to make 2.5D game or side scrolling 3d game, Just simple and fun game. I have chosen LWJGL, which is a java binding for Opengl to make my game. So first thing i need to work on loading images.texture mapping in lwjgl. I found some pretty much useful tutorials and great help from lwjgl forums. But atlast i got something that i was looking for from the <a href="http://lwjgl.org/forum/index.php/topic,3073.0.html" target="_blank">forum</a>.</p>
<p>I came to know about slick-util which is free and open source lib to <strong>load images and play sounds</strong>. Its very easy to pick up and implement it. Its just worked flawlessly and smoothly for me. You can <a href="http://slick.cokeandcode.com/downloads/util/" target="_blank">download the slick-util from here</a>.<strong> PNG, GIF, JPG, TGA are supported and WAV, OGG, XM sounds are supported by slick-util.</strong></p>
<p>So here i&#8217;l show u how easily i loaded images and mapped to a 3D BOX. First u have to setup lwjgl and slick-util with netbeans. Yeah i am using netbeans to write my program. You <a href="http://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/" target="_blank">can see my post to setup lwjgl with netbeans</a>. Now we will set up slick-util, its a continuation to the steps that we did to setup lwjgl.</p>
<p><strong>Continued&#8230;</strong></p>
<p>Step 1: We just have to configure the project properties so that project can find the lib to compile and run.</p>
<p><img class="alignnone size-full wp-image-319" title="1" src="http://www.gaanza.com/wp-content/uploads/2009/10/1.png" alt="1" width="501" height="206" /></p>
<p><img class="alignnone size-full wp-image-320" title="2" src="http://www.gaanza.com/wp-content/uploads/2009/10/2.png" alt="2" width="462" height="254" /></p>
<p>Ok that was it. Now slick-util lib has been set up.Now first i&#8217;l show u how to load image and bind it , full source will be at the end.</p>
<p><strong>Texture texture;</strong></p>
<p>Texture is an interface having description of texture which will be loaded.</p>
<p><strong>texture = TextureLoader.getTexture(&#8220;PNG&#8221;, new FileInputStream(&#8220;Data/Crate.png&#8221;));</strong></p>
<p>now we are loading the texture using TextureLoader utility class. Just smooth and simple.</p>
<p><strong>texture.bind();</strong></p>
<p>Now we are binding the texture.</p>
<p>So thats what u need to load the image and map them to objects. Download this image to use it in this program.</p>
<p><img class="alignnone size-full wp-image-321" title="Crate" src="http://www.gaanza.com/wp-content/uploads/2009/10/Crate.png" alt="Crate" width="256" height="256" /></p>
<p><strong>Full Code:</strong></p>
<div class="codesnip-container" >
<div class="codesnip"><span class="coMULTI">/*<br />
&nbsp;* To change this template, choose Tools | Templates<br />
&nbsp;* and open the template in the editor.<br />
&nbsp;*/</span></p>
<p>package com.<span class="me1">gaanza</span>.<span class="me1">engine</span>.<span class="me1">test2</span>;</p>
<p><span class="co2">import java.io.FileInputStream;</span><br />
<span class="co2">import java.io.IOException;</span><br />
<span class="co2">import java.util.logging.Level;</span><br />
<span class="co2">import java.util.logging.Logger;</span><br />
<span class="co2">import org.lwjgl.LWJGLException;</span><br />
<span class="co2">import org.lwjgl.Sys;</span><br />
<span class="co2">import org.lwjgl.opengl.Display;</span><br />
<span class="co2">import org.lwjgl.opengl.DisplayMode;</span><br />
<span class="co2">import org.lwjgl.opengl.GL11;</span><br />
<span class="co2">import org.lwjgl.util.glu.GLU;</span><br />
<span class="co2">import org.newdawn.slick.opengl.Texture;</span><br />
<span class="co2">import org.newdawn.slick.opengl.TextureLoader;</span></p>
<p><span class="coMULTI">/**<br />
&nbsp;*<br />
&nbsp;* @author Java Guy<br />
&nbsp;*/</span><br />
<span class="kw2">public</span> <span class="kw2">class</span> EngineTest <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">static</span> <span class="kw4">boolean</span> gameRunning=<span class="kw2">true</span>;<br />
&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">static</span> <span class="kw4">int</span> targetWidth = <span class="nu0">800</span>;<br />
&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">static</span> <span class="kw4">int</span> targetHeight = <span class="nu0">600</span>;</p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> float xrot=<span class="nu0">0</span>.1f;<br />
&nbsp; &nbsp; <span class="kw2">private</span> float yrot=<span class="nu0">0</span>.1f;<br />
&nbsp; &nbsp; <span class="kw2">private</span> float zrot=<span class="nu0">0</span>.1f;</p>
<p>&nbsp; &nbsp; <span class="coMULTI">/** The texture that&#8217;s been loaded */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">private</span> Texture texture;</p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&#038;bntl=1"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; EngineTest app=<span class="kw2">new</span> EngineTest<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; initDisplay<span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; initGL<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; app.<span class="me1">init</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; app.<span class="me1">run</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">static</span> <span class="kw4">void</span> initDisplay<span class="br0">&#40;</span><span class="kw4">boolean</span> fullscreen<span class="br0">&#41;</span><span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; DisplayMode chosenMode = <span class="kw2">null</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DisplayMode<span class="br0">&#91;</span><span class="br0">&#93;</span> modes = Display.<span class="me1">getAvailableDisplayModes</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i=<span class="nu0">0</span>;i&lt;modes.<span class="me1">length</span>;i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>modes<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span> == targetWidth<span class="br0">&#41;</span> &amp;&amp; <span class="br0">&#40;</span>modes<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> == targetHeight<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chosenMode = modes<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw2">catch</span> <span class="br0">&#40;</span>LWJGLException e<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Sys.<span class="me1">alert</span><span class="br0">&#40;</span><span class="st0">&#8220;Error&#8221;</span>, <span class="st0">&#8220;Unable to determine display modes.&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&#038;bntl=1"><span class="kw3">System</span></a>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// at this point if we have no mode there was no appropriate, let the user know</span><br />
&nbsp; &nbsp; <span class="co1">// and give up</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>chosenMode == <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sys.<span class="me1">alert</span><span class="br0">&#40;</span><span class="st0">&#8220;Error&#8221;</span>, <span class="st0">&#8220;Unable to find appropriate display mode.&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&#038;bntl=1"><span class="kw3">System</span></a>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display.<span class="me1">setDisplayMode</span><span class="br0">&#40;</span>chosenMode<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display.<span class="me1">setFullscreen</span><span class="br0">&#40;</span>fullscreen<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&#8220;LWJGL window&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display.<span class="me1">create</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">catch</span> <span class="br0">&#40;</span>LWJGLException e<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sys.<span class="me1">alert</span><span class="br0">&#40;</span><span class="st0">&#8220;Error&#8221;</span>,<span class="st0">&#8220;Unable to create display.&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&#038;bntl=1"><span class="kw3">System</span></a>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p><span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">static</span> <span class="kw4">boolean</span> initGL<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glMatrixMode</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_PROJECTION</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glLoadIdentity</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; Calculate the aspect ratio of the window</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GLU.<span class="me1">gluPerspective</span><span class="br0">&#40;</span><span class="nu0">45</span>.0f,<span class="br0">&#40;</span><span class="br0">&#40;</span>float<span class="br0">&#41;</span>targetWidth<span class="br0">&#41;</span>/<span class="br0">&#40;</span><span class="br0">&#40;</span>float<span class="br0">&#41;</span>targetHeight<span class="br0">&#41;</span>,<span class="nu0">0</span>.1f,<span class="nu0">100</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glMatrixMode</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_MODELVIEW</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glLoadIdentity</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glEnable</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_TEXTURE_2D</span><span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Enable Texture Mapping ( NEW )</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glShadeModel</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_SMOOTH</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glClearColor</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glClearDepth</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glEnable</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_DEPTH_TEST</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glDepthFunc</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_LEQUAL</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glHint</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_PERSPECTIVE_CORRECTION_HINT</span>, GL11.<span class="me1">GL_NICEST</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">true</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">void</span> init<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texture = TextureLoader.<span class="me1">getTexture</span><span class="br0">&#40;</span><span class="st0">&#8220;PNG&#8221;</span>, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AFileInputStream+java.sun.com&#038;bntl=1"><span class="kw3">FileInputStream</span></a><span class="br0">&#40;</span><span class="st0">&#8220;Data/grass.png&#8221;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw2">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&#038;bntl=1"><span class="kw3">IOException</span></a> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Logger.<span class="me1">getLogger</span><span class="br0">&#40;</span>EngineTest.<span class="kw2">class</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">log</span><span class="br0">&#40;</span>Level.<span class="me1">SEVERE</span>, <span class="kw2">null</span>, ex<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">void</span> run<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span>gameRunning<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; render<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display.<span class="me1">update</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// finally check if the user has requested that the display be</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// shutdown</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>Display.<span class="me1">isCloseRequested</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gameRunning = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display.<span class="me1">destroy</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&#038;bntl=1"><span class="kw3">System</span></a>.<span class="me1">exit</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">void</span> update<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; xrot+=<span class="nu0">0</span>.1f;<br />
&nbsp; &nbsp; &nbsp; &nbsp; yrot+=<span class="nu0">0</span>.1f;<br />
&nbsp; &nbsp; &nbsp; &nbsp; zrot+=<span class="nu0">0</span>.1f;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">private</span> <span class="kw4">void</span> render<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glClear</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_COLOR_BUFFER_BIT</span>|GL11.<span class="me1">GL_DEPTH_BUFFER_BIT</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glLoadIdentity</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTranslatef</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f,<span class="nu0">0</span>.0f,-<span class="nu0">5</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="co1">// Move Into The Screen 5 Units</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glRotatef</span><span class="br0">&#40;</span>xrot,<span class="nu0">1</span>.0f,<span class="nu0">0</span>.0f,<span class="nu0">0</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Rotate On The X Axis</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glRotatef</span><span class="br0">&#40;</span>yrot,<span class="nu0">0</span>.0f,<span class="nu0">1</span>.0f,<span class="nu0">0</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Rotate On The Y Axis</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glRotatef</span><span class="br0">&#40;</span>zrot,<span class="nu0">0</span>.0f,<span class="nu0">0</span>.0f,<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Rotate On The Z Axis</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; texture.<span class="me1">bind</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="co1">// or GL11.glBind(texture.getTextureID());</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glBegin</span><span class="br0">&#40;</span>GL11.<span class="me1">GL_QUADS</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Front Face</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Left Of The Texture and Quad</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Back Face</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Left Of The Texture and Quad</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Top Face</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Right Of The Texture and Quad</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Bottom Face</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Right Of The Texture and Quad</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Right face</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span> <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Left Of The Texture and Quad</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Left Face</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">0</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Bottom Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">1</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Right Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glTexCoord2f</span><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">1</span>.0f<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glVertex3f</span><span class="br0">&#40;</span>-<span class="nu0">1</span>.0f,&nbsp; <span class="nu0">1</span>.0f, -<span class="nu0">1</span>.0f<span class="br0">&#41;</span>;&nbsp; &nbsp;<span class="co1">// Top Left Of The Texture and Quad</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GL11.<span class="me1">glEnd</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Gracias.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/loading-imagetexture-mapping-in-lwjgl/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Diving into Mobile Gaming !!</title>
		<link>http://www.gaanza.com/blog/diving-into-mobile-gaming/</link>
		<comments>http://www.gaanza.com/blog/diving-into-mobile-gaming/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 08:12:34 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[j2me]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/?p=313</guid>
		<description><![CDATA[Recently my friends suggested me to make games for mobile phones. I haven&#8217;t done any formal course for mobile programming so i did a some search on mobile game development on google and gone through some articles like The Clash of Mobile Platforms: J2ME, ExEn, Mophun and WGE I have a Nokia N70ME handset and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently my friends suggested me to make games for mobile phones. I haven&#8217;t done any formal course for mobile programming so i did a some search on mobile game development on google and gone through some articles like <span style="font-family: Verdana; font-weight: bold; font-size: 12pt; color: #003e98;"><a href="http://www.gamedev.net/reference/articles/article1944.asp" target="_blank">The Clash of Mobile Platforms: J2ME, ExEn, Mophun and WGE</a></span></p>
<p><span style="font-size: small;">I have a Nokia N70ME handset and most of my friends have same kinda(specifications) handset. All of them are java enabled. I did a search on their specifications and found that almost all were midp 2.0 enabled. After doing some research on mobile gaming i chose J2ME for developing mobile games because majority of the phones of my target audience are java-enabled so i can reach to masses. Secondly, SUN provides you all the development tools for free. And thirdly i am more comfortable in java programming language so it would be easier for me to pick up things more fast and easily. So i am using netbeans IDE 6.7 with the mobility pack to write my app and its pretty productive and reliable. My next step was to find some good online tutorial to just get started, all basic things. I searched the google and found many useful stuff there:</span></p>
<p><span style="font-size: small;"> <a href="http://developers.sun.com/mobility/midp/articles/gameapi/" target="_blank">http://developers.sun.com/mobility/midp/articles/gameapi/</a></span></p>
<p><span style="font-size: small;"><a href="http://developers.sun.com/mobility/midp/articles/game/" target="_blank">http://developers.sun.com/mobility/midp/articles/game/</a></span></p>
<p><span style="font-size: small;"><a href="http://today.java.net/pub/a/today/2005/07/07/j2me3.html" target="_blank">http://today.java.net/pub/a/today/2005/07/07/j2me3.html</a></span></p>
<p><span style="font-size: small;"><a href="http://www.devx.com/wireless/Article/27167/1954">http://www.devx.com/wireless/Article/27167/1954</a></span></p>
<p><span style="font-size: small;">So i got many stuffs to get started making midp 2.0 games. It didn&#8217;t take too much time to pick up things. I got the concepts easily and started implementing them. I just started with testing codes like drawing images, moving them, rotation etc. After testing all those codes i decided to make very simple 2d side scrolling game. Then i searched for some free sprites on google and got some stuffs on world war 2 theme. Then i asked my friend to make some background images for me and he made some pretty good backgrounds. So then i was off to fly and started making the game.</span></p>
<p><span style="font-size: small;">This is my current progress on game and i am pretty sure that soon i&#8217;ll complete the game and upload here for the download.</span></p>
<p><span style="font-size: small;"><img class="alignnone size-full wp-image-314" title="jungleMobile" src="http://www.gaanza.com/wp-content/uploads/2009/10/jungleMobile.png" alt="jungleMobile" width="248" height="329" /></span></p>
<p><span style="font-size: small;">This is my mobile game project that i am working. Soon i&#8217;l finish it. And important thing is that i am enjoying very much making game for mobile phones. I tested it on my Nokia N70 handset and it worked flawlessly. I am very excited regarding this project.</span></p>
<p><span style="font-size: small;"><strong>Gracias.</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/diving-into-mobile-gaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up LWJGL with Netbeans</title>
		<link>http://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/</link>
		<comments>http://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 04:41:05 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Opengl]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[lwjgl]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/?p=285</guid>
		<description><![CDATA[On Forums, people keeps asking about setting up lwjgl library with netbeans. So here i am going to show the steps to do that. STEP 1: Go to Tools-&#62; Libariries.Now create new library. Give it a name say &#8220;lwjgl21&#8243;. STEP 2: Now we have to configure the library. Click the classpath tab, then click add [...]]]></description>
			<content:encoded><![CDATA[<p>On Forums, people keeps asking about setting up lwjgl library with netbeans. So here i am going to show the steps to do that.</p>
<p><strong>STEP 1: </strong>Go to Tools-&gt; Libariries.Now create new library. Give it a name say &#8220;lwjgl21&#8243;.</p>
<p><img class="alignnone size-full wp-image-286" title="step1" src="http://www.gaanza.com/wp-content/uploads/2009/09/step1.png" alt="step1" width="535" height="213" /></p>
<p><strong>STEP 2:</strong> Now we have to configure the library. Click the classpath tab, then click add jars, and add all the jars shown below:</p>
<p><img class="alignnone size-full wp-image-287" title="step2" src="http://www.gaanza.com/wp-content/uploads/2009/09/step2.png" alt="step2" width="534" height="406" /></p>
<p><strong>STEP 3:</strong> If u want to add java doc than click the javadoc tab, and then add the javadoc folder. Then finally click oK and lwjgl21 library that we have just created is done.</p>
<p><strong>STEP 4:</strong> Now create a empty java project.</p>
<p><img class="alignnone size-full wp-image-288" title="step3" src="http://www.gaanza.com/wp-content/uploads/2009/09/step3.png" alt="step3" width="305" height="144" /></p>
<p><strong>STEP 5:</strong> Now we have to set the properties so that our newly created project can find the lwjgl library and jar files. So Right-Click the project-&gt; Properties. Now check the image carefully and configure accordingly. So first select libraries on the categories section and then click compile tab, and then add jar file for compilation step. This step is very important so check image properly below.</p>
<p><img class="alignnone size-full wp-image-289" title="step4" src="http://www.gaanza.com/wp-content/uploads/2009/09/step4.png" alt="step4" width="578" height="189" /></p>
<p><strong>STEP 6:</strong> Okie now click run tab, and add the library that we had just created. Check the image very properly.</p>
<p><img class="alignnone size-full wp-image-294" title="step5" src="http://www.gaanza.com/wp-content/uploads/2009/09/step51.png" alt="step5" width="548" height="177" /></p>
<p><strong>STEP 7:</strong> Now the final step. We have to provide the argument so that project cud find the necessary dll files. So first select the Run at caregories section then go to vm-options. Check the image properly and follow.</p>
<p><img class="alignnone size-full wp-image-291" title="step6" src="http://www.gaanza.com/wp-content/uploads/2009/09/step6.png" alt="step6" width="565" height="207" /></p>
<p>Okie thats it. Now click ok. So you have just set up lwjgl with your netbeans ide. So now you can compile and run your lwjgl app. I am using netbeans ide 6.7.</p>
<p><strong>Gracias</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My New Game Project : Jungle Riddle</title>
		<link>http://www.gaanza.com/blog/project-jungle-riddle/</link>
		<comments>http://www.gaanza.com/blog/project-jungle-riddle/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 04:54:05 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Slick 2D]]></category>
		<category><![CDATA[java games]]></category>
		<category><![CDATA[java-opengl]]></category>
		<category><![CDATA[jungle riddle]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/?p=178</guid>
		<description><![CDATA[At present i am working on a 2d side-scrolling platform game. It started as a course project but now i want to extend it and make it large. I have used java and slick library to make this game project. I have put the game demo on my blog page. The project is still in [...]]]></description>
			<content:encoded><![CDATA[<p>At present i am working on a 2d side-scrolling platform game. It started as a course project but now i want to extend it and make it large.</p>
<p>I have used java and slick library to make this game project. I have put the game demo on my blog page. The project is still in development process. So you can download and play it. Please give the feedback. I am still new to game development so feedback( both positive and negative ) will be appreciated.</p>
<p>So download the game from <a href="http://www.gaanza.com/wp-content/plugins/download-monitor/download.php?id=1">http://gaanza.com/games/</a> and play it</p>
<h2><strong><span style="color: #ffcc00;">please comment your feedback and suggestions here</span></strong><span style="color: #ffcc00;">.</span></h2>
<p>it&#8217;ll be great help for developing this game further.</p>
<p>Gracias.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/project-jungle-riddle/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing or Setting up JOGL on Ubuntu</title>
		<link>http://www.gaanza.com/blog/setting-up-jogl-in-ubuntu/</link>
		<comments>http://www.gaanza.com/blog/setting-up-jogl-in-ubuntu/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:50:38 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jogl]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/?p=118</guid>
		<description><![CDATA[Here are the detailed steps to set up or install JOGL on your ubuntu. First of all you have to download the jogl library(according to your machine) from here . I am using Ubuntu 8.04 on intel board so i downloaded jogl-1.1.1-linux-i586.zip. So extract the zip file. Now open the folder that you have just [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-143" title="gl_java_ubuntu1" src="http://www.gaanza.com/wp-content/uploads/2009/06/gl_java_ubuntu1.png" alt="gl_java_ubuntu1" width="500" height="150" /></p>
<p>Here are the detailed steps to set up or install JOGL on your ubuntu. First of all you have to <a href="https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=9260&amp;expandFolder=9260&amp;folderID=0" target="_self">download</a> the jogl library(according to your machine) from <a href="https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=9260&amp;expandFolder=9260&amp;folderID=0" target="_blank">here</a> . I am using Ubuntu 8.04 on intel board so i downloaded jogl-1.1.1-linux-i586.zip.</p>
<p>So extract the zip file. Now open the folder that you have just now extracted. Go to lib folder.</p>
<p><strong>STEP 1</strong>: Now you have to copy four .so files i.e libjogl.so, libjogl_awt.so, libjogl_cg.so, libgluegen-rt.so to [javainstalation directory]/jre/lib/i386</p>
<p>Open the terminal window and type: sudo cp libjogl.so /usr/lib/java/jdk1.6.0_13/jre/lib/i386</p>
<p>similarly you have to copy other three .so files.</p>
<p>*you have to provide you java installation path*</p>
<p><img class="alignnone size-full wp-image-120" title="jogl1" src="http://www.gaanza.com/wp-content/uploads/2009/06/jogl1.png" alt="jogl1" width="659" height="125" /></p>
<p>Now you can check the destination if files has been copied.</p>
<p><img class="alignnone size-full wp-image-122" title="jogl21" src="http://www.gaanza.com/wp-content/uploads/2009/06/jogl21.png" alt="jogl21" width="572" height="458" /></p>
<p><strong>STEP 2:</strong> Now copy jogl.jar and gluegen-rt.jar to [java installation di]/jre/lib/ext</p>
<p>run this command to copy: sudo cp jogl.jar /usr/lib/java/jdk1.6.0_13/jre/lib/ext</p>
<p>simillarly copy gluegen-rt.jar</p>
<p>*you have to provide your java installation path*</p>
<p><img class="alignnone size-full wp-image-123" title="jogl3" src="http://www.gaanza.com/wp-content/uploads/2009/06/jogl3.png" alt="jogl3" width="593" height="196" /></p>
<p>You can check:</p>
<p><img class="alignnone size-full wp-image-124" title="jogl4" src="http://www.gaanza.com/wp-content/uploads/2009/06/jogl4.png" alt="jogl4" width="566" height="326" /></p>
<p><strong>STEP 3</strong>: SO thats it. Now lets test the simple jogl code.</p>
<p><em>import javax.media.opengl.GLCapabilities;</em></p>
<p><em>public class Hello{<br />
public static void main (String args[]) {<br />
try {<br />
System.loadLibrary(&#8220;jogl&#8221;);<br />
System.out.println(<br />
&#8220;Hello World! (The native libraries are installed.)&#8221;<br />
);<br />
GLCapabilities caps = new GLCapabilities();<br />
System.out.println(<br />
&#8220;Hello JOGL! (The jar appears to be available.)&#8221;<br />
);<br />
} catch (Exception e) {<br />
System.out.println(e);<br />
}<br />
}<br />
} </em></p>
<p>Now compile this Hello.java and the run it. Here is the output:</p>
<p><img class="alignnone size-full wp-image-125" title="jogl-final" src="http://www.gaanza.com/wp-content/uploads/2009/06/jogl-final.png" alt="jogl-final" width="529" height="125" /></p>
<p>So thats it. Now your are off to fly and write your jogl apps.</p>
<p><strong>Thanks.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/setting-up-jogl-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Setting up java classpath on ubuntu</title>
		<link>http://www.gaanza.com/blog/setting-up-classpath-for-java-on-ubuntu/</link>
		<comments>http://www.gaanza.com/blog/setting-up-classpath-for-java-on-ubuntu/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 01:31:23 +0000</pubDate>
		<dc:creator>padam</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gaanza.com/blog/?p=81</guid>
		<description><![CDATA[When u install sun&#8217;s jdk manually on ubuntu, java classpath doesn&#8217;t get set automatically unlike in windows. So when you enter command javac in terminal window, it says &#8220;javac  command not found&#8221;. So here is the very simple way to set up the classpath for java on ubuntu. STEP 1 : Open the terminal window. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-133" title="java_ubuntu" src="http://www.gaanza.com/wp-content/uploads/2009/06/java_ubuntu.png" alt="java_ubuntu" width="350" height="150" /></p>
<p>When u install sun&#8217;s jdk manually on ubuntu, java classpath doesn&#8217;t get set automatically unlike in windows. So when you enter command javac in terminal window, it says &#8220;javac  command not found&#8221;. So here is the very simple way to set up the classpath for java on ubuntu.</p>
<p><strong>STEP 1</strong> : Open the terminal window.</p>
<p><strong>STEP 2</strong>: Type sudo gedit /etc/bash.bash.rc. Press enter.</p>
<p><strong>STEP 3</strong>: Now gedit editor will open up. Now at the end of file just write:</p>
<p>PATH=$PATH:/usr/lib/java/jdk1.6.0_13/bin</p>
<p>export PATH</p>
<p>**You have to provide the path of bin folder in java installation deirectory.**</p>
<p><img class="alignnone size-full wp-image-82" title="screenshot-12" src="http://www.gaanza.com/wp-content/uploads/2009/06/screenshot-12.png" alt="screenshot-12" width="554" height="415" /></p>
<p><strong>STEP 4</strong>: Now save the file and close the editor and terminal. Open new terminal window and type javac and press enter, all the java options and flags will come up.</p>
<p>Thats it.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gaanza.com/blog/setting-up-classpath-for-java-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

