<?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>Shyam Guthikonda &#187; c#</title>
	<atom:link href="http://www.shy.am/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shy.am</link>
	<description>Game Programmer - http://shy.am</description>
	<lastBuildDate>Mon, 14 Mar 2011 12:18:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>XNA DebugOverlay Utility</title>
		<link>http://www.shy.am/2009/11/xna-debugoverlay-utility/</link>
		<comments>http://www.shy.am/2009/11/xna-debugoverlay-utility/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 03:20:38 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[xna]]></category>

		<guid isPermaLink="false">http://www.shy.am/?p=1121</guid>
		<description><![CDATA[The DebugOverlay utility is a class that I&#8217;ve been using in my XNA projects for a while. It allows me to draw visualization objects from anywhere in my application &#8211; even in separate threads. Some areas where I have used this utility are: The AI system can display a units&#8217; velocity and position through Lines, [...]]]></description>
			<content:encoded><![CDATA[<p>The DebugOverlay utility is a class that I&#8217;ve been using in my XNA projects for a while. It allows me to draw visualization objects from <em>anywhere</em> in my application &#8211; even in separate threads.</p>
<p>Some areas where I have used this utility are:</p>
<ul>
<li>The AI system can display a units&#8217; velocity and position through Lines, Arrows, and Spheres. Use ScreenText to show the current state or goal hierarchy of a given unit.</li>
<li>The Physics system can use bounding boxes and spheres to show collision volumes. Points can be used to show raycast intersections or points of impact.</li>
<li>The Graphics system can use Spheres, Lines, and Arrows to show the position and direction of lights.</li>
<li>The Editor (or other tools) can use Lines, Arrows, and Bounding Boxes for axis representation during translate/rotate/scale.</li>
<li>Vertex Display &#8211; For a software-based skinning implementation, I used Points to visualize the locations of my vertices, and Spheres for the locations of the bones. It&#8217;s possible to use Spheres for everything, but thousands of Spheres can get a little expensive.</li>
</ul>
<p>This utility is only meant for Debug purposes, and therefore uses the [Conditional("DEBUG")] tag on each of it&#8217;s exposed methods.</p>
<p>To use the DebugOverlay, create the object during Initialization:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">new</span> DebugOverlay<span style="color: #008000;">&#40;</span>GraphicsDevice, Content<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>Call the visualization functions from anywhere in your code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #6666cc; font-weight: bold;">void</span> ScreenText<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> text, Vector2 pos, Color c<span style="color: #008000;">&#41;</span>
<span style="color: #6666cc; font-weight: bold;">void</span> Line<span style="color: #008000;">&#40;</span>Vector3 start, Vector3 end, Color color<span style="color: #008000;">&#41;</span>
<span style="color: #6666cc; font-weight: bold;">void</span> Arrow<span style="color: #008000;">&#40;</span>Vector3 start, Vector3 end, <span style="color: #6666cc; font-weight: bold;">float</span> arrowSize, Color color<span style="color: #008000;">&#41;</span>
<span style="color: #6666cc; font-weight: bold;">void</span> BoundingBox<span style="color: #008000;">&#40;</span>BoundingBox boundingBox, Color color<span style="color: #008000;">&#41;</span>
<span style="color: #6666cc; font-weight: bold;">void</span> Point<span style="color: #008000;">&#40;</span>Vector3 pos, Color color<span style="color: #008000;">&#41;</span>
<span style="color: #6666cc; font-weight: bold;">void</span> Sphere<span style="color: #008000;">&#40;</span>Vector3 pos, <span style="color: #6666cc; font-weight: bold;">float</span> radius, Color color<span style="color: #008000;">&#41;</span></pre></td></tr></table></div>

<p>In your Draw routine, call the DebugOverlay.Draw method, passing in the projection and view matrices:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">DebugOverlay<span style="color: #008000;">.</span><span style="color: #0000FF;">Singleton</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Draw</span><span style="color: #008000;">&#40;</span>mCamera<span style="color: #008000;">.</span><span style="color: #0000FF;">ProjectionMatrix</span>, mCamera<span style="color: #008000;">.</span><span style="color: #0000FF;">ViewMatrix</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>I made a small sample application to show off the functionality. Below is a screenshot and the complete source code.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-63-1121">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-840" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/20091121_debugoverlaydemo/debugoverlaydemo.png" title=" " class="shutterset_set_63" >
								<img title="debugoverlaydemo" alt="debugoverlaydemo" src="http://www.shy.am/wp-content/gallery/20091121_debugoverlaydemo/thumbs/thumbs_debugoverlaydemo.png" width="95" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><strong>Download: </strong><a href="http://shy.am/codedump/DebugOverlayDemo.zip">source + demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2009/11/xna-debugoverlay-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Artemis Chronicle Tools</title>
		<link>http://www.shy.am/2009/08/artemis-chronicle-tools/</link>
		<comments>http://www.shy.am/2009/08/artemis-chronicle-tools/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:41:46 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[360]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[xna]]></category>

		<guid isPermaLink="false">http://www.shy.am/?p=909</guid>
		<description><![CDATA[During the first semester of working on NitroX and Artemis Chronicle, our design and content pipeline was very slow. Simple things like creating a level and placing a box were arduous tasks. Placing an item involved flying the camera around the level, writing down it&#8217;s rough coordinates, hard coding the coordinates, and then tweak these [...]]]></description>
			<content:encoded><![CDATA[<p>During the first semester of working on NitroX and Artemis Chronicle, our design and content pipeline was very slow. Simple things like creating a level and placing a box were arduous tasks. Placing an item involved flying the camera around the level, writing down it&#8217;s rough coordinates, hard coding the coordinates, and then tweak these values until the box is in the desired position. (Thankfully, we were using C# which pretty much eliminated any compile time. Doing this in C++ would have been impossible).</p>
<p>This created a situation where we were unable to prototype levels quickly, and time that could be better used somewhere else was being wasted.</p>
<p>Because of this, I devoted the first few weeks of the second semester to full-time tool development. Two of the more useful tools created are described below. These tools, once created, were continuously used and refined throughout the entire life of the project.</p>
<p><strong>Level Editor</strong>:</p>
<p>Artemis Chronicle and the NitroX engine have a completely integrated level editor. The editor allows 3D navigation through the world (using Maya camera controls), object placement (translation, rotation, scale), object property exposure (including physics volumes), trigger volumes (used for scripted events), and interactive camera sequencing (allows us to create cut-scenes and cinematics in a point-and-click fashion instead of in code).</p>
<p>The editor runs on Windows and is written in C#, allowing for close integration into the XNA content pipeline. The editor data is serialized out to an XML format (which is later compressed for application deployment), sent through the content pipeline, and imported directly into the NitroX engine for use on both Windows and Xbox 360.</p>
<p><strong>Mesh Viewer</strong>:</p>
<p>The Mesh Viewer is a tool that lets our artists quickly preview their work before sending it off to be integrated into the latest build of the game. As anyone who&#8217;s used the FBX exporter knows, exporting from Maya does not always go smoothly, so this tool allows the artist to catch any errors early, thus saving time for the entire team.</p>
<p>Animations can be chained together to create sequences, and then previewed in a real-time manner. Playback speed, blending parameters, and looping can also be adjusted via the user interface.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-56-909">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-782" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/00.jpg" title="Scene navigation." class="shutterset_set_56" >
								<img title="00" alt="00" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_00.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-783" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/01.jpg" title="Camera sequence scripting and cinematics." class="shutterset_set_56" >
								<img title="01" alt="01" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_01.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-784" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/02.jpg" title="Trigger volumes and scripting." class="shutterset_set_56" >
								<img title="02" alt="02" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_02.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-785" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/03.jpg" title="Object placement." class="shutterset_set_56" >
								<img title="03" alt="03" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_03.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-786" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/04.jpg" title="Scripting." class="shutterset_set_56" >
								<img title="04" alt="04" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_04.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-787" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/05.jpg" title="Object selection." class="shutterset_set_56" >
								<img title="05" alt="05" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_05.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-788" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/07.jpg" title="Mesh Viewer." class="shutterset_set_56" >
								<img title="07" alt="07" src="http://www.shy.am/wp-content/gallery/portfolio_ac_tools/thumbs/thumbs_07.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2009/08/artemis-chronicle-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Non-Linear Roots</title>
		<link>http://www.shy.am/2008/12/non-linear-roots/</link>
		<comments>http://www.shy.am/2008/12/non-linear-roots/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 16:53:50 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.shy.am/dev/?p=239</guid>
		<description><![CDATA[An implementation of the Newton-Raphson method to compute the root of a non-linear equation. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 [...]]]></description>
			<content:encoded><![CDATA[<p>An implementation of the Newton-Raphson method to compute the root of a non-linear equation.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: Shyam M Guthikonda</span>
<span style="color: #666666;">// Email: shyamguth@gmail.com</span>
<span style="color: #666666;">// URL: http://shy.am</span>
<span style="color: #666666;">// Desc: Program to calculate the root of a non-linear function, utilizing</span>
<span style="color: #666666;">//		 the Newton-Raphson method.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Include Files</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #339900;">#include &quot;math.h&quot;</span>
<span style="color: #339900;">#include &quot;windows.h&quot;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Globals</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span>	Iter<span style="color: #008080;">;</span>			<span style="color: #666666;">// Keeps track of the number of iterations each</span>
								<span style="color: #666666;">// root location method requires. Avoids the need</span>
								<span style="color: #666666;">// to pass an extra parameter by reference.</span>
&nbsp;
ULONG			ErrorFlags <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>	<span style="color: #666666;">// Used to keep track of any errors.</span>
&nbsp;
<span style="color: #666666;">// Possible error flags</span>
<span style="color: #0000ff;">enum</span> ERRORS
<span style="color: #008000;">&#123;</span>
	ERRORS_DERIV_EQ_ZERO	<span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span>,
	ERRORS_DENOM_EQ_ZERO	<span style="color: #000080;">=</span> <span style="color: #0000dd;">2</span>,
	ERRORS_MAX_ITERATION	<span style="color: #000080;">=</span> <span style="color: #0000dd;">4</span>,
	ERROR_FORCE_32BIT		<span style="color: #000080;">=</span> <span style="color: #208080;">0x7FFFFFFF</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// Struct to hold the X and Y roots of a non-linear system</span>
<span style="color: #0000ff;">struct</span> Point
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">double</span> X<span style="color: #008080;">;</span>
	<span style="color: #0000ff;">double</span> Y<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: F1()</span>
<span style="color: #666666;">// Desc: The first function.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> F1<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> x, <span style="color: #0000ff;">double</span> y <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>x <span style="color: #000040;">*</span> x<span style="color: #008000;">&#41;</span> <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span> <span style="color: #000040;">-</span> y <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: F2()</span>
<span style="color: #666666;">// Desc: The second function.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> F2<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> x, <span style="color: #0000ff;">double</span> y <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #0000dd;">3</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">cos</span><span style="color: #008000;">&#40;</span> x <span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> y <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: F1dx()</span>
<span style="color: #666666;">// Desc: Derivative of the first function with respect to x.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> F1dx<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> x, <span style="color: #0000ff;">double</span> y <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #0000dd;">2</span> <span style="color: #000040;">*</span> x <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: F1dy()</span>
<span style="color: #666666;">// Desc: Derivative of the first function with respect to y.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> F1dy<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> x, <span style="color: #0000ff;">double</span> y <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: F2dx()</span>
<span style="color: #666666;">// Desc: Derivative of the second function with respect to x.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> F2dx<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> x, <span style="color: #0000ff;">double</span> y <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">3</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">sin</span><span style="color: #008000;">&#40;</span> x <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: F2dy()</span>
<span style="color: #666666;">// Desc: Derivative of the second function with respect to y.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> F2dy<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> x, <span style="color: #0000ff;">double</span> y <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: Es()</span>
<span style="color: #666666;">// Desc: Calculates the percent tolerance, given a desired number of</span>
<span style="color: #666666;">//		 significant figures.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">double</span> Es<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> SigFigs <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span><span style="color:#800080;">.5</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">pow</span><span style="color: #008000;">&#40;</span> <span style="color:#800080;">10.0</span>, <span style="color: #008000;">&#40;</span><span style="color:#800080;">2.0</span> <span style="color: #000040;">-</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span><span style="color: #008000;">&#41;</span>SigFigs<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: NewtonRaphson()</span>
<span style="color: #666666;">// Desc: Determines the root of a non-linear function using the</span>
<span style="color: #666666;">//		 Newton-Raphson method.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
Point NewtonRaphsonNonLinear<span style="color: #008000;">&#40;</span> <span style="color: #0000ff;">double</span> Xi, <span style="color: #0000ff;">double</span> Yi, <span style="color: #0000ff;">double</span> Es, <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> Imax <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">double</span> Ea <span style="color: #000080;">=</span> <span style="color:#800080;">1000.0</span>, Denom<span style="color: #008080;">;</span>
	<span style="color: #0000ff;">double</span> Xrold <span style="color: #000080;">=</span> Xi, Yrold <span style="color: #000080;">=</span> Yi<span style="color: #008080;">;</span>
	Point Root<span style="color: #008080;">;</span>
	Iter <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
	Root.<span style="color: #007788;">X</span> <span style="color: #000080;">=</span> Xi<span style="color: #008080;">;</span>
	Root.<span style="color: #007788;">Y</span> <span style="color: #000080;">=</span> Yi<span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #666666;">// No errors yet with this method!</span>
	ErrorFlags <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span> <span style="color: #0000dd;">1</span> <span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		Xrold <span style="color: #000080;">=</span> Root.<span style="color: #007788;">X</span><span style="color: #008080;">;</span> Yrold <span style="color: #000080;">=</span> Root.<span style="color: #007788;">Y</span><span style="color: #008080;">;</span>
		Iter<span style="color: #000040;">++</span><span style="color: #008080;">;</span>
&nbsp;
		<span style="color: #666666;">// Prevent division by 0.</span>
		Denom <span style="color: #000080;">=</span> F1dx<span style="color: #008000;">&#40;</span> Root.<span style="color: #007788;">X</span>, Root.<span style="color: #007788;">Y</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> F2dy<span style="color: #008000;">&#40;</span> Root.<span style="color: #007788;">X</span>, Root.<span style="color: #007788;">Y</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> F1dy<span style="color: #008000;">&#40;</span> Root.<span style="color: #007788;">X</span>, Root.<span style="color: #007788;">Y</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> F2dx<span style="color: #008000;">&#40;</span> Root.<span style="color: #007788;">X</span>, Root.<span style="color: #007788;">Y</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>Denom <span style="color: #000080;">==</span> <span style="color:#800080;">0.0</span><span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
			<span style="color: #666666;">// Set the given error flag and return the most recent root estimates.</span>
			ErrorFlags <span style="color: #000040;">|</span><span style="color: #000080;">=</span> ERRORS_DENOM_EQ_ZERO<span style="color: #008080;">;</span>
			<span style="color: #0000ff;">return</span> Root<span style="color: #008080;">;</span>
		<span style="color: #008000;">&#125;</span>
&nbsp;
		<span style="color: #666666;">// Newton-Raphson formula for a non-linear system.</span>
		Root.<span style="color: #007788;">X</span> <span style="color: #000080;">=</span> Xrold <span style="color: #000040;">-</span> <span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>F1<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> F2dy<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #008000;">&#40;</span>F2<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> F1dy<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> Denom<span style="color: #008080;">;</span>
		Root.<span style="color: #007788;">Y</span> <span style="color: #000080;">=</span> Yrold <span style="color: #000040;">-</span> <span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>F2<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> F1dx<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #008000;">&#40;</span>F1<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> F2dx<span style="color: #008000;">&#40;</span> Xrold, Yrold <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> Denom<span style="color: #008080;">;</span>
&nbsp;
		<span style="color: #666666;">// Calculate the relative absolute error, Ea (of X term)</span>
		<span style="color: #666666;">// Don't calculate the error on the first iteration since there is no previous term</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>Root.<span style="color: #007788;">X</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color:#800080;">0.0</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;&amp;</span> <span style="color: #008000;">&#40;</span>Iter <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> Ea <span style="color: #000080;">=</span> <span style="color: #0000dd;">abs</span><span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>Root.<span style="color: #007788;">X</span> <span style="color: #000040;">-</span> Xrold<span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> Root.<span style="color: #007788;">X</span> <span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">100</span><span style="color: #008080;">;</span>
&nbsp;
		<span style="color: #666666;">// Root found within error range desired, or number of iterations has</span>
		<span style="color: #666666;">// reached the maximum amount permitted by Imax. Either way: return.</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> Ea <span style="color: #000080;">&lt;</span> Es	  <span style="color: #008000;">&#41;</span>	<span style="color: #008000;">&#123;</span> <span style="color: #0000ff;">return</span> Root<span style="color: #008080;">;</span>									   <span style="color: #008000;">&#125;</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> Iter <span style="color: #000080;">&gt;=</span> Imax <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> ErrorFlags <span style="color: #000040;">|</span><span style="color: #000080;">=</span> ERRORS_MAX_ITERATION<span style="color: #008080;">;</span> <span style="color: #0000ff;">return</span> Root<span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
	<span style="color: #008000;">&#125;</span> <span style="color: #666666;">// End while</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: ErrorMsg()</span>
<span style="color: #666666;">// Desc: Function to print the currently set bits in ErrorFlags, of enum</span>
<span style="color: #666666;">//		 type ERRORS.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">void</span> ErrorMsg<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> ErrorFlags <span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;Errors:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> ErrorFlags <span style="color: #000040;">&amp;</span> ERRORS_DERIV_EQ_ZERO  <span style="color: #008000;">&#41;</span> <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Derivative = 0<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>			<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> ErrorFlags <span style="color: #000040;">&amp;</span> ERRORS_DENOM_EQ_ZERO  <span style="color: #008000;">&#41;</span> <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Denominator = 0<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>			<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> ErrorFlags <span style="color: #000040;">&amp;</span> ERRORS_MAX_ITERATION  <span style="color: #008000;">&#41;</span> <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Max Iterations Reached<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>	<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #008000;">&#125;</span> <span style="color: #666666;">// End if errors</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #666666;">// Name: _tmain() (Application Entry Point)</span>
<span style="color: #666666;">// Desc: Entry point for the program.</span>
<span style="color: #666666;">//--------------------------------------------------------------------</span>
<span style="color: #0000ff;">int</span> _tmain<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	Point		Root<span style="color: #008080;">;</span>
	<span style="color: #0000ff;">double</span>		fEs <span style="color: #000080;">=</span> Es<span style="color: #008000;">&#40;</span> <span style="color: #0000dd;">6</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>	<span style="color: #666666;">// Number of desired significant figures.</span>
&nbsp;
	<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Roots Accurate to 6 Sig Figs<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #666666;">// NEWTON-RAPHSON-----------------------------------------------</span>
	Root <span style="color: #000080;">=</span> NewtonRaphsonNonLinear<span style="color: #008000;">&#40;</span>
					<span style="color:#800080;">1.5</span>,			<span style="color: #666666;">// Initial X guess</span>
					<span style="color:#800080;">3.5</span>,			<span style="color: #666666;">// Initial Y guess</span>
					fEs,			<span style="color: #666666;">// Percent tolerance</span>
					<span style="color: #0000dd;">1000</span>			<span style="color: #666666;">// Maximum iterations allowed</span>
					<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;Method: Newton-Raphson (Non-Linear)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #666666;">// Display any errors.</span>
	ErrorMsg<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;X_Root = %g<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, Root.<span style="color: #007788;">X</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;Y_Root = %g<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, Root.<span style="color: #007788;">Y</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;Iterations = %i<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, Iter <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2008/12/non-linear-roots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Procedural Clouds</title>
		<link>http://www.shy.am/2007/11/procedural-clouds/</link>
		<comments>http://www.shy.am/2007/11/procedural-clouds/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 15:31:03 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[clouds]]></category>
		<category><![CDATA[demos]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[ogre]]></category>
		<category><![CDATA[shaders]]></category>

		<guid isPermaLink="false">http://www.shy.am/dev/?p=199</guid>
		<description><![CDATA[A procedurally generated, real-time, GPU-based cloud module, written on top of the OGRE 3D engine. Cloud formation, movement, lighting and layers. One version was also done in pure OpenGL/C++. Both implementations make use of GLSL. There is also a paper that goes along with this project, to better explain the techniques used. Download: source (Ogre), [...]]]></description>
			<content:encoded><![CDATA[<p>A procedurally generated, real-time, GPU-based cloud module, written on top of the OGRE 3D engine. Cloud formation, movement, lighting and layers. One version was also done in pure OpenGL/C++. Both implementations make use of GLSL.</p>
<p>There is also a <a href="http://www.shy.am/wp-content/uploads/2009/01/realistic-real-time-skies-shyam-guthikonda.pdf">paper</a> that goes along with this project, to better explain the techniques used.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-2-199">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-9" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_procclouds/procClouds_02.jpg" title=" " class="shutterset_set_2" >
								<img title="procClouds_02.jpg" alt="procClouds_02.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_procclouds/thumbs/thumbs_procClouds_02.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-8" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_procclouds/procClouds_01.jpg" title=" " class="shutterset_set_2" >
								<img title="procClouds_01.jpg" alt="procClouds_01.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_procclouds/thumbs/thumbs_procClouds_01.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-7" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_procclouds/procClouds_00.jpg" title=" " class="shutterset_set_2" >
								<img title="procClouds_00.jpg" alt="procClouds_00.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_procclouds/thumbs/thumbs_procClouds_00.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-10" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_procclouds/procClouds_03.jpg" title=" " class="shutterset_set_2" >
								<img title="procClouds_03.jpg" alt="procClouds_03.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_procclouds/thumbs/thumbs_procClouds_03.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><strong>Download: </strong><a href="http://www.shy.am/projects/ProceduralClouds_Ogre.zip">source (Ogre)</a>, <a href="http://www.shy.am/projects/ProceduralClouds_OpenGL.zip">source (OpenGL)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2007/11/procedural-clouds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Bytecode IDE</title>
		<link>http://www.shy.am/2006/05/java-bytecode-ide/</link>
		<comments>http://www.shy.am/2006/05/java-bytecode-ide/#comments</comments>
		<pubDate>Wed, 10 May 2006 04:22:28 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[bytecode]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[wxwidgets]]></category>

		<guid isPermaLink="false">http://www.shy.am/?p=964</guid>
		<description><![CDATA[An Integrated Development Environment (IDE) for writing Java Bytecode programs, using C++ and wxWidgets. Some features: Full-featured text editor with tab support. Assembler to translate bytecode into instruction-level code. Multi-threaded debugging, with support for breakpoints and line-by-line debugging. Download: bin]]></description>
			<content:encoded><![CDATA[<p>An Integrated Development Environment (IDE) for writing Java Bytecode programs, using C++ and wxWidgets. Some features:</p>
<ul>
<li>Full-featured text editor with tab support.</li>
<li>Assembler to translate bytecode into instruction-level code.</li>
<li>Multi-threaded debugging, with support for breakpoints and line-by-line debugging.</li>
</ul>

<div class="ngg-galleryoverview" id="ngg-gallery-6-964">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-21" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_jbcide/debugWindow.jpg" title=" " class="shutterset_set_6" >
								<img title="debugWindow.jpg" alt="debugWindow.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_jbcide/thumbs/thumbs_debugWindow.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-22" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_jbcide/mainWindow.jpg" title=" " class="shutterset_set_6" >
								<img title="mainWindow.jpg" alt="mainWindow.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_jbcide/thumbs/thumbs_mainWindow.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><strong>Download: </strong><a href="http://www.shy.am/projects/JavaByteCode_Final-exe.zip">bin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2006/05/java-bytecode-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wallpaper Algorithm</title>
		<link>http://www.shy.am/2006/01/wallpaper-algorithm-2/</link>
		<comments>http://www.shy.am/2006/01/wallpaper-algorithm-2/#comments</comments>
		<pubDate>Thu, 05 Jan 2006 20:18:49 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[demos]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[gui]]></category>

		<guid isPermaLink="false">http://www.shy.am/?p=323</guid>
		<description><![CDATA[This is an implementation of the Wallpaper Algorithm as described in &#8220;The New Turing Omnibus&#8221; by A.K. Dewdney. The algorithm creates a repeating pattern of dots based on user supplied values. In addition, the UI allows for 3-D navigation. Done in C#. Download: source]]></description>
			<content:encoded><![CDATA[<p>This is an implementation of the Wallpaper Algorithm as described in &#8220;<em><a href="http://www.amazon.com/New-Turing-Omnibus-Turning-Excursions/dp/0716782715" target="_blank">The New Turing Omnibus</a></em>&#8221; by A.K. Dewdney. The algorithm creates a repeating pattern of dots based on user supplied values. In addition, the UI allows for 3-D navigation. Done in C#.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-10-323">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-31" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/wallpaper_00.png" title=" " class="shutterset_set_10" >
								<img title="wallpaper_00.png" alt="wallpaper_00.png" src="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/thumbs/thumbs_wallpaper_00.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-32" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/wallpaper_01.png" title=" " class="shutterset_set_10" >
								<img title="wallpaper_01.png" alt="wallpaper_01.png" src="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/thumbs/thumbs_wallpaper_01.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-33" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/wallpaper_02.png" title=" " class="shutterset_set_10" >
								<img title="wallpaper_02.png" alt="wallpaper_02.png" src="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/thumbs/thumbs_wallpaper_02.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-34" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/wallpaper_03.png" title=" " class="shutterset_set_10" >
								<img title="wallpaper_03.png" alt="wallpaper_03.png" src="http://www.shy.am/wp-content/gallery/wallpaperAlgorithm/thumbs/thumbs_wallpaper_03.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><strong>Download:</strong> <a href="http://www.shy.am/projects/WallpaperAlgorithm.zip">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2006/01/wallpaper-algorithm-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kohonen Self-Organizing Map Demos</title>
		<link>http://www.shy.am/2005/12/kohonen-self-organizing-map-demos/</link>
		<comments>http://www.shy.am/2005/12/kohonen-self-organizing-map-demos/#comments</comments>
		<pubDate>Mon, 05 Dec 2005 09:43:36 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[demos]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.shy.am/dev/?p=112</guid>
		<description><![CDATA[In artificial intelligence, SOMs, or Self-Organizing Maps, are a type of neural network. They can be used to &#8216;teach&#8217; a computer to recognize various attributes. This project deals with two demos: SOM_Color and SOM_Image. Both are written in C#. SOM_Color is a color recognition program. A grid of nodes is initialized with random colors. The [...]]]></description>
			<content:encoded><![CDATA[<p>In artificial intelligence, SOMs, or Self-Organizing Maps, are a type of neural network. They can be used to &#8216;teach&#8217; a computer to recognize various attributes. This project deals with two demos: SOM_Color and SOM_Image. Both are written in C#.</p>
<p>SOM_Color is a color recognition program. A grid of nodes is initialized with random colors. The application learns how the colors are related to each other, and will sort the colors so that like-colors end up near each other. Color &#8220;similarity&#8221; is defined by their respective RGB color vector Euclidean distance.</p>
<p>SOM_Image is an image recognition program. A database of images is presented to the application (Madden NFL &#8217;06 images are provided with the download). The program will group similar images near each other. Two classifications are used for this similarity calculation: a histogram of lights/darks and colors. This application works surprisingly well.</p>
<p>There is also a <a href="http://www.shy.am/wp-content/uploads/2009/01/kohonen-self-organizing-maps-shyam-guthikonda.pdf">paper</a> that goes along with this project, to better explain the utilized techniques.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-7-112">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-23" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_som/som_00.jpg" title=" " class="shutterset_set_7" >
								<img title="som_00.jpg" alt="som_00.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_som/thumbs/thumbs_som_00.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-24" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_som/som_01.jpg" title=" " class="shutterset_set_7" >
								<img title="som_01.jpg" alt="som_01.jpg" src="http://www.shy.am/wp-content/gallery/portfolio_som/thumbs/thumbs_som_01.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><strong>Download: </strong><a href="http://www.shy.am/projects/SOM.zip">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2005/12/kohonen-self-organizing-map-demos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Particle Engine</title>
		<link>http://www.shy.am/2005/05/particle-engine/</link>
		<comments>http://www.shy.am/2005/05/particle-engine/#comments</comments>
		<pubDate>Thu, 05 May 2005 09:24:23 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[demos]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[particles]]></category>

		<guid isPermaLink="false">http://www.shy.am/dev/?p=78</guid>
		<description><![CDATA[Project Goals: Our goal with this project is to effectively implement a particle engine in a 3 dimensional environment. By a particle engine, we mean a system which will effectively implement realistic weather-type effects through the use of small, continuously moving particles throughout our scene. A system like this takes a lot of &#8220;background&#8221; programming [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Project Goals:</strong></p>
<p>Our goal with this project is to effectively implement a particle engine in a 3 dimensional environment. By a particle engine, we mean a system which will effectively implement realistic weather-type effects through the use of small, continuously moving particles throughout our scene. A system like this takes a lot of &#8220;background&#8221; programming in order to both manage and manipulate the several different systems we plan to create. More importantly, memory management is a very real issue here as we will be creating hundreds, if not thousands, of particles accross all of the different systems should they all be turned on at the same time. Thus we will start with a basic 3 dimensional environment with the user having camera control of moving fowards, backwards, left, right, rotate left, and rotate right. Once we have this basic &#8220;arena&#8221; set up, we will texture the environment to make it a more realistic-looking area with a grassland base and appropriately stitched skybox for the atmosphere.</p>
<p>As for the details regarding the actual particle engine, we will start with a top down design, having a particle manager at the top of the hierarchy to create, destroy, and manipulate all of the different systems we will be implementing. This particle manager will have methods for adding and removing systems from the scene as well. In addition, we will be creating a base class with virtual initialization and update functions to be overridden in the classes we define for each specific type of system.</p>
<p>On the smaller scale of particle management, our particle system objects will hold a livelist and deadlist for managing our particles. Whenever a particle moves out of the range of the scene, or where we want the system&#8217;s particles to exist in the scene, they will be moved to the deadlist to be re-initialized and used again, versus destroying and re-creating each particle to simulate continual motion, which would be rather memory intensive and slow. Our actual particle object, to be created and re-initialized within each system, will be rather small in the amount of data it will hold, but items such as it&#8217;s texture, current location, lifetime of the particle, and x,y,and z velocities to control its motion will be among them.</p>
<p>As for the differing aspects of each individual system, there aren&#8217;t many variations other than the &#8220;origin&#8221; from which each system&#8217;s particles will emanate from and the boundaries of each system.</p>
<p><strong>Planned Effects:</strong></p>
<ul>
<li>Rain, Snow, Fire, Smoke, Water (Fountain), Other</li>
</ul>
<p><strong>Reference List:</strong></p>
<ul>
<li><a href="http://www.mysticgd.com/misc/AdvancedParticleSystems.pdf" target="_blank">Advanced Particle Systems</a>: Ideas for Particle Manager and particle attributes.</li>
<li><a href="http://www.w3.org/TR/2003/CR-css3-color-20030514/" target="_blank">HSL to RGB Algorithm</a>.</li>
<li>Ideas for <a href="http://www.gamedev.net/reference/articles/article222.asp" target="_blank">Fire Blending Algorithm</a>.</li>
</ul>
<p><strong>Images:</strong></p>

<div class="ngg-galleryoverview" id="ngg-gallery-8-78">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-811" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_particles/particle_00.jpg" title=" " class="shutterset_set_8" >
								<img title="particle_00" alt="particle_00" src="http://www.shy.am/wp-content/gallery/portfolio_particles/thumbs/thumbs_particle_00.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-812" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_particles/particle_01.jpg" title=" " class="shutterset_set_8" >
								<img title="particle_01" alt="particle_01" src="http://www.shy.am/wp-content/gallery/portfolio_particles/thumbs/thumbs_particle_01.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-813" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_particles/particle_02.jpg" title=" " class="shutterset_set_8" >
								<img title="particle_02" alt="particle_02" src="http://www.shy.am/wp-content/gallery/portfolio_particles/thumbs/thumbs_particle_02.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-814" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_particles/particle_03.jpg" title=" " class="shutterset_set_8" >
								<img title="particle_03" alt="particle_03" src="http://www.shy.am/wp-content/gallery/portfolio_particles/thumbs/thumbs_particle_03.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-815" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.shy.am/wp-content/gallery/portfolio_particles/04200501.jpg" title=" " class="shutterset_set_8" >
								<img title="04200501" alt="04200501" src="http://www.shy.am/wp-content/gallery/portfolio_particles/thumbs/thumbs_04200501.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><strong>Download: </strong><a href="http://www.shy.am/projects/ParticleEngine370.rar">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shy.am/2005/05/particle-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

