<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1477083969713116925</id><updated>2011-07-28T07:39:44.570-07:00</updated><category term='Inhuman'/><category term='Isometric'/><category term='Nonsense'/><category term='General'/><category term='Human'/><category term='DirectX'/><category term='Travel'/><category term='Demo'/><category term='XLQSI Format'/><category term='Physics'/><category term='Silverlight'/><title type='text'>Beta Blending</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-8282071313478502857</id><published>2009-09-09T06:06:00.000-07:00</published><updated>2009-09-09T06:13:24.884-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='XLQSI Format'/><title type='text'>Xleeque Designer Documentation (XLQSI Editor)</title><content type='html'>Sneak preview of Xleeque Designer (an editor of XLQSI file format) has gone live! Click here for the &lt;a href="http://www.xleeque.com/articles/xleeque-designer-documentation.aspx" title="Official documentation of Xleeque Designer"&gt;official documentation of Xleeque Designer&lt;/a&gt; tool.&lt;br/&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://2.bp.blogspot.com/_A8rsaTSyBL0/SqephU9LdFI/AAAAAAAAASo/t3k52QNm8H8/s1600-h/xleeque-designer-main-window-screenshot.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://2.bp.blogspot.com/_A8rsaTSyBL0/SqephU9LdFI/AAAAAAAAASo/t3k52QNm8H8/s400/xleeque-designer-main-window-screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5379454669943436370" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-8282071313478502857?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/8282071313478502857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=8282071313478502857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/8282071313478502857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/8282071313478502857'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2009/09/xleeque-designer-documentation-xlqsi.html' title='Xleeque Designer Documentation (XLQSI Editor)'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_A8rsaTSyBL0/SqephU9LdFI/AAAAAAAAASo/t3k52QNm8H8/s72-c/xleeque-designer-main-window-screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-3669803304307819005</id><published>2009-09-09T05:54:00.000-07:00</published><updated>2009-09-09T06:13:56.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='XLQSI Format'/><title type='text'>Xleeque Shaded Image File Format Specifications</title><content type='html'>I have published the initial draft of &lt;a href="http://www.xleeque.com/articles/xleeque-shaded-image-file-format-specifications.aspx" title="Official Xleeque Shaded Image File Specifications"&gt;Xleeque Shaded Image File format specifications&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-3669803304307819005?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/3669803304307819005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=3669803304307819005' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/3669803304307819005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/3669803304307819005'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2009/09/xleeque-shaded-image-file.html' title='Xleeque Shaded Image File Format Specifications'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-6732547303119095635</id><published>2009-08-01T06:05:00.000-07:00</published><updated>2009-08-05T06:40:10.812-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='Isometric'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Isometric Tile Hit Testing (Part 2)</title><content type='html'>And so from &lt;a href="http://betablending.blogspot.com/2009/07/isometric-tile-hit-testing-part-1.html"&gt;part one&lt;/a&gt; of the same article we knew how a given tile centroid in screen coordinates P(x,y) is mapped to the corresponding tile in map coordinates M(x,y). It is relatively easier to find the nearest centroid from the mouse cursor position, and here's how.&lt;br /&gt;&lt;br /&gt;When user clicks anywhere on the canvas, mouse cursor position is captured relative to the top-left corner of the canvas. The nearest columns of dots to the left and right of cursor position are referred to as "left band" and "right band" respectively (click to enlarge):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_A8rsaTSyBL0/SnRVkNTeHXI/AAAAAAAAASY/7Bb1LG2fcB0/s1600-h/Tile+Hit+Testing+-+Bands.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5365007136640081266" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 253px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_A8rsaTSyBL0/SnRVkNTeHXI/AAAAAAAAASY/7Bb1LG2fcB0/s400/Tile+Hit+Testing+-+Bands.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The left and right bands can be computed as follow: &lt;p style="MARGIN-LEFT: 24px;font-family:courier new;font-size:1em;"  &gt;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; half_canvas_width = canvas_width * 0.5;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; click_x = mouse_x - half_canvas_width - offset;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; factor_x = (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;)Math.Floor(click_x / half_tile_width);&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; left_band_x = factor_x * half_tile_width;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; right_band_x = (factor_x + 1) * half_tile_width;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Variable &lt;em&gt;offset&lt;/em&gt; represents difference between the tip of origin tile M(0,0) and the middle-top of the Content Canvas. Value of &lt;em&gt;offset&lt;/em&gt; is zero for square maps, but not for rectangular ones (see &lt;a href="http://betablending.blogspot.com/2009/07/isometric-tile-positioning-on-canvas.html"&gt;Isometric Tile Positioning on Canvas&lt;/a&gt; for more details on &lt;em&gt;offset&lt;/em&gt;): &lt;/p&gt;&lt;p&gt;Now determine the "even column" between these two bands: the "origin column", and every alternate column are "even columns". For the above case, the "right band" is an even column, while the "left band" is an odd column.&lt;/p&gt;&lt;p&gt;Next, try to identify two neighbouring points on the even column (right band in this scenario), referred to as &lt;em&gt;beta&lt;/em&gt; and &lt;em&gt;alpha&lt;/em&gt; points (as illustrated in above image):&lt;/p&gt;&lt;p style="MARGIN-LEFT: 24px;font-family:courier new;font-size:1em;"  &gt;&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; click_y = mouse_y - half_tile_height;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; factor_y = (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;)Math.Floor(click_y / tile_height);&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; beta_y = factor_y * tile_height;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; alpha_y = (factor_y + 1) * tile_height;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After both &lt;em&gt;alpha&lt;/em&gt; and &lt;em&gt;beta&lt;/em&gt; points are identified, find out which one is closer to &lt;em&gt;click_y&lt;/em&gt; (for this case it is &lt;em&gt;alpha&lt;/em&gt; point).&lt;/p&gt;&lt;p&gt;&lt;em&gt;Gamma&lt;/em&gt; point is vertically centered between &lt;em&gt;alpha&lt;/em&gt; and &lt;em&gt;beta&lt;/em&gt; points, located across on the odd column. The key to identifying the clicked tile lies on finding the smallest distance from mouse position to either &lt;em&gt;alpha&lt;/em&gt; or &lt;em&gt;gamma&lt;/em&gt; points.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_A8rsaTSyBL0/Sng9flifeBI/AAAAAAAAASg/nKQZg30eg-U/s1600-h/Tile+Hit+Testing+-+Distance.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5366106568873965586" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 272px; CURSOR: hand; HEIGHT: 192px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_A8rsaTSyBL0/Sng9flifeBI/AAAAAAAAASg/nKQZg30eg-U/s400/Tile+Hit+Testing+-+Distance.png" border="0" /&gt;&lt;/a&gt; &lt;p&gt;If &lt;em&gt;Gx+Gy&lt;/em&gt; is smaller than &lt;em&gt;Ax+Ay&lt;/em&gt;, then &lt;em&gt;gamma&lt;/em&gt; point is clicked, otherwise &lt;em&gt;alpha&lt;/em&gt; point is clicked.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-6732547303119095635?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/6732547303119095635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=6732547303119095635' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/6732547303119095635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/6732547303119095635'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2009/08/isometric-tile-hit-testing-part-2.html' title='Isometric Tile Hit Testing (Part 2)'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_A8rsaTSyBL0/SnRVkNTeHXI/AAAAAAAAASY/7Bb1LG2fcB0/s72-c/Tile+Hit+Testing+-+Bands.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-1217825909893326347</id><published>2009-07-31T05:41:00.000-07:00</published><updated>2009-08-04T07:04:15.689-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='Isometric'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Isometric Tile Hit Testing (Part 1)</title><content type='html'>&lt;p&gt;As each of the tiles on Content Canvas is being represented by an Image object (essentially an UIElement), we could easily attach a MouseLeftButtonDown event handler to those images, and determine which tile is clicked. But then again, there may be hundreds of Image objects in the canvas that are visible at the same time. Hit-testing these objects as mouse cursor moves across the canvas require some processing, even Silverlight employs some kind of space partitioning techniques (I'm sure it does).&lt;br /&gt;&lt;br /&gt;So wouldn't it be nice if we could just turn IsHitTestVisible property of every tile to false and skip all those processing altogether? It turns out we can take advantage of the fact that tiles are laid out in a uniform way, and translate a given mouse cursor position to a point in map coordinates.&lt;br /&gt;&lt;br /&gt;Illustrated below is a rectangular map enclosed in a Content Canvas (which has red borders). The centroid of each tile is represented by a dot. These dots extended beyond the boundaries of map to illustrate their column and row nature (click to enlarge):&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_A8rsaTSyBL0/SnMI8rV5KcI/AAAAAAAAAR4/RfAGkcAfDgk/s1600-h/Tile+Hit+Testing+-+Centroids.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5364641419648117186" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 280px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_A8rsaTSyBL0/SnMI8rV5KcI/AAAAAAAAAR4/RfAGkcAfDgk/s400/Tile+Hit+Testing+-+Centroids.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The origin tile has a map coordinates of M(0,0) and is always positioned at the top of the Content Canvas. All alternate columns of dots, starting from the origin tile are referred to as "even columns", while every other columns are "odd columns".&lt;br /&gt;&lt;br /&gt;For the ease of calculation, we fix the centroid of the origin tile M(0,0) to have pixel coordinates of P(0,0), and all other tiles are placed relative to the origin tile. Assuming each tile is of size 64x32 pixels, centroids of other tiles on map would have the pixel coordinates as shown in image below (click to enlarge):&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_A8rsaTSyBL0/SnPQgsycoBI/AAAAAAAAASQ/FWwtImdQqwM/s1600-h/Tile+Hit+Testing+-+Coordinates.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5364860841325535250" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 213px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_A8rsaTSyBL0/SnPQgsycoBI/AAAAAAAAASQ/FWwtImdQqwM/s400/Tile+Hit+Testing+-+Coordinates.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Let's try to derive the equations for mapping a screen coordinate P(x,y) to map coordinate M(x,y). From two of the highlighted cells above, we know that P(32,48) maps to tile M(2,1); and P(64,128) maps to tile M(5,3). That gives the following equations:&lt;/p&gt;&lt;center&gt;&lt;i&gt;P(32,48) = M(2,1)&lt;/i&gt; --- Equation 1&lt;/center&gt;&lt;center&gt;&lt;i&gt;P(64,128) = M(5,3)&lt;/i&gt; --- Equation 2&lt;/center&gt;&lt;p&gt;We know that both x and y screen coordinates have an influence on each x and y components in map coordinates. Let us first determine the influence P(x,y) has on the x component of map coordinates. From Equation 1 and 2 we know that:&lt;/p&gt;&lt;center&gt;&lt;i&gt;32P + 48Q = 2&lt;/i&gt; --- Equation 3&lt;br /&gt;&lt;i&gt;64P + 128Q = 5&lt;/i&gt; --- Equation 4&lt;/center&gt;&lt;p&gt;Solving Equation 3 and 4 together we get:&lt;/p&gt;&lt;center&gt;&lt;i&gt;P = 1/64&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Q = 1/32&lt;/i&gt;&lt;/center&gt;&lt;p&gt;Now we do the same for y component of map coordinates:&lt;/p&gt;&lt;center&gt;&lt;i&gt;32R + 48S = 1&lt;/i&gt; --- Equation 5&lt;/center&gt;&lt;center&gt;&lt;i&gt;64R + 128S = 3 --- Equation 6&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;&lt;p&gt;Solving both Equation 5 and 6 we get:&lt;/p&gt;&lt;center&gt;&lt;i&gt;R = -1/64&lt;/i&gt;&lt;br /&gt;&lt;i&gt;S = 1/32&lt;/i&gt;&lt;/center&gt;&lt;p&gt;Here are the final equations to map a screen coordinate P(x,y) to map coordinate M(x,y):&lt;/p&gt;&lt;center&gt;&lt;i&gt;M(x) = P(x)/64 + P(y)/32&lt;/i&gt;&lt;br /&gt;&lt;i&gt;M(y) = P(y)/32 - P(x)/64&lt;/i&gt;&lt;/center&gt;&lt;p&gt;&lt;div style="COLOR: #ff0000"&gt;WARNING:&lt;/div&gt;These equations are derived based on the assumption that tile height (e.g. 32) is half of the tile width (e.g. 64), where the above equation can be generalized in the following form: &lt;p&gt;&lt;/p&gt;&lt;center&gt;&lt;i&gt;M(x) = P(x)/Wt + P(y)/Ht&lt;/i&gt;&lt;br /&gt;&lt;i&gt;M(y) = P(y)/Ht - P(x)/Wt&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;&lt;p&gt;where &lt;i&gt;Wt&lt;/i&gt; is represents the tile width and &lt;i&gt;Ht&lt;/i&gt; is the tile height.&lt;/p&gt;&lt;p&gt;How do we know it is correct? Well you can try it on another highlighted cell P(-96,144) and see if it maps correctly to M(3,6).&lt;/p&gt;&lt;p&gt;That is all about mapping a tile centroid in screen coordinates P(x,y) to cell in map coordinates M(x,y). In &lt;a href="http://betablending.blogspot.com/2009/08/isometric-tile-hit-testing-part-2.html"&gt;part two&lt;/a&gt; of this article, we will find way to identify the clicked centroid from a given mouse coordinate.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-1217825909893326347?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/1217825909893326347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=1217825909893326347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/1217825909893326347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/1217825909893326347'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2009/07/isometric-tile-hit-testing-part-1.html' title='Isometric Tile Hit Testing (Part 1)'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_A8rsaTSyBL0/SnMI8rV5KcI/AAAAAAAAAR4/RfAGkcAfDgk/s72-c/Tile+Hit+Testing+-+Centroids.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-4548491038052923136</id><published>2009-07-30T07:23:00.000-07:00</published><updated>2009-07-31T23:15:28.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='Isometric'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Isometric Tile Positioning on Canvas</title><content type='html'>In order to avoid moving tiles on the Content Canvas completely, the Content Canvas is created big enough to accommodate the entire map. For those who think too much about performance like me, a Silverlight canvas can be created in different sizes without costing more (or less) memory, even when CacheMode is set to BitmapCache.&lt;br /&gt;&lt;br /&gt;A square map (that has the same number of columns as the number of rows) will have its origin tile M(0,0) positioned in the exact middle-top of the canvas. But a rectangular map (that has number of columns not equal to the number of rows) will have its origin tile M(0,0) located some distance off the canvas center point (click to enlarge):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_A8rsaTSyBL0/SnGxW3tAARI/AAAAAAAAARo/INRD_bv7UtY/s1600-h/Tile+Rendering+-+Content+Canvas.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5364263637642903826" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 235px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_A8rsaTSyBL0/SnGxW3tAARI/AAAAAAAAARo/INRD_bv7UtY/s400/Tile+Rendering+-+Content+Canvas.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Since square maps are special cases of rectangular maps, we will attempt to solve the equations for rectangular maps as a generic solution. Let us use the following symbols to denote various components for calculation:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;C&lt;/i&gt; = Number of columns on map&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;R&lt;/i&gt; = Number of rows on map&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;O&lt;/i&gt; = Offset from canvas center point&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;Wc&lt;/i&gt; = Canvas width in pixels&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;Hc&lt;/i&gt; = Canvas height in pixels&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;Wt&lt;/i&gt; = Tile width in pixels&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;i&gt;Ht&lt;/i&gt; = Tile height in pixels&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Based on observation, one additional row will increase the overall map dimension by &lt;i&gt;Wt*0.5&lt;/i&gt; pixels. This increment will offset origin tile M(0,0) by &lt;i&gt;Wt*0.25&lt;/i&gt; pixels to the right. Hence, offset from canvas center point &lt;i&gt;O&lt;/i&gt; can be derived from the following equation:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;i&gt;O = (R-C) * Wt * 0.25&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Again, based on the same observation, the canvas dimension can be obtained from the following equations:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;i&gt;Wc = (R+C) * Wt * 0.5&lt;/i&gt;&lt;br&gt;&lt;i&gt;Hc = (R+C) * Ht * 0.5&lt;/i&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Each tile on the map is represented by an Image object, whose first pixel lies on the top-left corner of the tile. A tile is positioned in the canvas at a location denoted by P(x,y), with respect to the top-left corner of the canvas. We can determine the values of P(x,y) for a given map tile M(x,y) with the following equations:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;i&gt;P(x) = O + [[M(x)-M(y)-1] * Wt * 0.5&lt;/i&gt;&lt;br&gt;&lt;i&gt;P(y) = [[M(x)+M(y)] * Ht * 0.5&lt;/i&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-4548491038052923136?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/4548491038052923136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=4548491038052923136' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/4548491038052923136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/4548491038052923136'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2009/07/isometric-tile-positioning-on-canvas.html' title='Isometric Tile Positioning on Canvas'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_A8rsaTSyBL0/SnGxW3tAARI/AAAAAAAAARo/INRD_bv7UtY/s72-c/Tile+Rendering+-+Content+Canvas.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-5039697889965263925</id><published>2009-03-06T07:32:00.000-08:00</published><updated>2009-03-21T09:37:48.767-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>Stackana - A Hiragana, Katakana Puzzle Game</title><content type='html'>I am extremely happy to introduce Stackana -- a game through which anyone can memorize Hiragana and Katakana characters the fun and easy way! The game drives you to match Kana (Hiragana and Katakana) blocks with their corresponding Romaji (phonetics) blocks in an increasingly shorter interval.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;a href="http://www.xleeque.com/stackana-hiragana-katakana-learning-game.aspx"&gt;&lt;img align="center" src="http://lh6.ggpht.com/_A8rsaTSyBL0/SbFDr1dBTOI/AAAAAAAAAOc/LykSiBVCTxg/s800/stackana-perspective-view.gif.jpg" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;This process causes you to memorize those Kana characters subconsciously as you immerse in the game play. Try it now, practice and find yourself memorizing more Hiragana and Katakana characters at the end of each game!&lt;br /&gt;&lt;br /&gt;Stackana even include recently developed Katakana characters such as "va", "vi" and so on, rest assured that you are learning the complete kana writing system!&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Where Do I Play Stackana?&lt;/h3&gt;There are two ways you can play Stackana:&lt;br /&gt;&lt;br /&gt;1. To the top-right of this page, look for a "Stackana Japanese Game" box (you will need Silverlight browser plug-in to play).&lt;br /&gt;&lt;br /&gt;2. You can play on the &lt;a href="http://www.xleeque.com/stackana-hiragana-katakana-learning-game.aspx" alt="Stackana - Japanese Puzzle Game"&gt;official Stackana website&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;I hope you like it! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-5039697889965263925?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/5039697889965263925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=5039697889965263925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/5039697889965263925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/5039697889965263925'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2009/03/stackana-hiragana-katakana-puzzle-game.html' title='Stackana - A Hiragana, Katakana Puzzle Game'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_A8rsaTSyBL0/SbFDr1dBTOI/AAAAAAAAAOc/LykSiBVCTxg/s72-c/stackana-perspective-view.gif.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-6786171419526091591</id><published>2008-09-18T06:07:00.002-07:00</published><updated>2008-11-22T01:26:18.554-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General'/><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>Visit California: San Francisco, Los Angeles and Las Vegas</title><content type='html'>"Oh, come on."&lt;br /&gt;&lt;br /&gt;That's my first reaction when my manager told he would send me to Autodesk University about a month ago (more about Autodesk University in later posts).&lt;br /&gt;&lt;br /&gt;"I don't think it is at all possible for a sponsored trip right now. Especially when the company belt's been tighten. I'd be glad enough if they don't ask me to stay home from tomorrow onwards."&lt;br /&gt;&lt;br /&gt;And one month later, now, the confirmation. "Congratulations, you are promoted.", or "sir, you have a baby boy!!". You may have heard those, but the business trip, let me tell ya, excites me more than anything else. I've long for a US trip since, like, ...forever. So off I went to tell my wife, Diana, the best travel planner on this side of the world.&lt;br /&gt;&lt;br /&gt;Here's how the itinerary goes:&lt;br /&gt;&lt;br /&gt;&lt;span style=" ;font-family:'Courier New', Courier, monospace;font-size:small;"&gt;&lt;table cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="15%"&gt;Nov 19&lt;/td&gt;&lt;td&gt;San Francisco: touch down, procced to San Rafael.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 20&lt;/td&gt;&lt;td&gt;San Francisco: Work from San Rafael office.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 21&lt;/td&gt;&lt;td&gt;San Francisco: Work from San Rafael office.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 22&lt;/td&gt;&lt;td&gt;San Francisco: Golden Gate Bridge, Chinatown, Muir Wood, Sausalito.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 23&lt;/td&gt;&lt;td&gt;San Francisco: Alcatraz, Monterey, Bay Aquarium, Carmel, 17-Mile.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 24&lt;/td&gt;&lt;td&gt;San Francisco: Work from San Rafael office.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 25&lt;/td&gt;&lt;td&gt;San Francisco: Work from San Rafael office.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 26&lt;/td&gt;&lt;td&gt;San Francisco: Work from San Rafael office.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 27&lt;/td&gt;&lt;td&gt;Los Angeles: Arrive, check in hotel (TBD), Thanksgiving dinner.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 28&lt;/td&gt;&lt;td&gt;Los Angeles: Universal Studios, Hollywood, Walk of Fame.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 29&lt;/td&gt;&lt;td&gt;Las Vegas: Arrive, check in hotel.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nov 30&lt;/td&gt;&lt;td&gt;Las Vegas: Hoover Dam, Grand Canyon.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 01&lt;/td&gt;&lt;td&gt;Las Vegas: check in MGM hotel.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 02&lt;/td&gt;&lt;td&gt;Las Vegas: Autodesk University.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 03&lt;/td&gt;&lt;td&gt;Las Vegas: Autodesk University.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 04&lt;/td&gt;&lt;td&gt;Las Vegas: Autodesk University.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 05&lt;/td&gt;&lt;td&gt;Las Vegas: Autodesk University.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 06&lt;/td&gt;&lt;td&gt;Fly back to Singapore on this day?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 07&lt;/td&gt;&lt;td&gt;Or this day?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 08&lt;/td&gt;&lt;td&gt;Or this?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dec 09&lt;/td&gt;&lt;td&gt;How about this?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-6786171419526091591?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/6786171419526091591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=6786171419526091591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/6786171419526091591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/6786171419526091591'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2008/09/visit-california-san-francisco-los.html' title='Visit California: San Francisco, Los Angeles and Las Vegas'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-3938302158824739699</id><published>2008-07-10T23:42:00.000-07:00</published><updated>2008-07-10T23:46:22.964-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nonsense'/><title type='text'>Autobike 跑得快</title><content type='html'>欧拖卖 跑得快&lt;br /&gt;只差后面没大牌&lt;br /&gt;被警察 纠下来&lt;br /&gt;你说奇怪不奇怪&lt;br /&gt;&lt;br /&gt;欧拖卖 跑得快&lt;br /&gt;吓到那个老太太&lt;br /&gt;她从三轮车上跌下来&lt;br /&gt;你说应该怎么办&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-3938302158824739699?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/3938302158824739699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=3938302158824739699' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/3938302158824739699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/3938302158824739699'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2008/07/autobike.html' title='Autobike 跑得快'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-9003760921263628161</id><published>2007-12-29T09:13:00.000-08:00</published><updated>2007-12-31T07:13:57.681-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Demo'/><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectX'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Control Your Universe (Demo)</title><content type='html'>Alright, here’s a demo of what my previous post “&lt;a href="http://betablending.blogspot.com/2007/12/as-guy-snatches-your-hand-bag-you.html"&gt;Control Your Universe&lt;/a&gt;” was all about. It shows 16 sprites that hover around the window, based on a set of given starting and ending points. The movements are all interpolated between these points with the formulas that we discussed in the previous post. Notice how these sprites accelerate and decelerate in a smooth manner.&lt;br /&gt;&lt;br /&gt;Disclaimer: The icons are not my work; they are designed exclusively by Rokey (Rokey.net).&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;object width="425" height="350"&gt; &lt;param name="movie" value="http://www.youtube.com/v/Vbk9SyowKi8"&gt; &lt;/param&gt; &lt;embed src="http://www.youtube.com/v/Vbk9SyowKi8" type="application/x-shockwave-flash" width="425" height="350"&gt; &lt;/embed&gt; &lt;/object&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;The program is written in unmanaged C++ and November 2007 DirectX SDK using Microsoft Visual Studio 2005. You can download the executable or solution files with the links below, please let me know your feedbacks:&lt;br /&gt;&lt;br /&gt;Note: Links open up new window for SendSpace.com, when the new window opens, just click on the "Download Link" at the bottom to download file.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.sendspace.com/file/onahs0" target="_blank"&gt;Download Binary&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.sendspace.com/file/fg67iz" target="_blank"&gt;Download Solution&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-9003760921263628161?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/9003760921263628161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=9003760921263628161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/9003760921263628161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/9003760921263628161'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2007/12/control-your-universe-demo.html' title='Control Your Universe (Demo)'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-8566643751859871726</id><published>2007-12-22T05:06:00.000-08:00</published><updated>2007-12-27T06:36:38.102-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inhuman'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Control Your Universe</title><content type='html'>As the guy snatches your hand-bag, you started going after him. Moments later, figuring that out-running this guy is simply beyond your wildest imagination, you slow down to a stop and continue to yell at him "Don't let me catch you, you son of a...". Okay stop right there, we've just seen physics in action:&lt;br /&gt;&lt;br /&gt;1. Your speed increases.&lt;br /&gt;2. Your speed reaches its max.&lt;br /&gt;3. Your speed reduces.&lt;br /&gt;4. Come to a stop.&lt;br /&gt;&lt;br /&gt;Overly simplified, but you get the idea. Nothing jumps from stationary to a high speed, nothing comes to a standstill immediately. Speed changes gradually. So just in case you're wondering, things you saw in Click weren't real:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2233/2129010210_eba8c4ab83_o.jpg" border="0" /&gt;&lt;/center&gt;&lt;br /&gt;&lt;strong&gt;The Crazy Chase&lt;/strong&gt;&lt;br /&gt;Say, it all started when you were walking, with an initial velocity denoted by &lt;strong&gt;u&lt;/strong&gt;. Let’s start evaluating the whole crazy chase from the moment he snatched your hand bag. In the accelerating phase (first half), you started running like a mad dog and then reached your peak velocity, &lt;strong&gt;vc&lt;/strong&gt;. That’s when you decided to give it up and go into a decelerating phase (second half), slowing down from your top speed &lt;strong&gt;vc&lt;/strong&gt;, to a stop.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2076/2128233947_6b46dbe31c_o.gif" border="0" /&gt;&lt;/center&gt;&lt;br /&gt;Let’s make an assumption that the accelerating phase (first half) takes as much time as the decelerating phase (second half). Time required for each phase is denoted by &lt;strong&gt;t&lt;/strong&gt;. So for the accelerating phase, we get:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2274/2128234017_04087d59d0_o.gif" border="0" /&gt;&lt;/center&gt;&lt;br /&gt;And for the decelerating phase, we get:&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2199/2128234047_01a452e2fa_o.gif" border="0" /&gt;&lt;/center&gt;As you stopped at the end of decelerating phase, &lt;strong&gt;v&lt;/strong&gt; is zero, that gives us:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2222/2128234079_51ba869ba6_o.gif" border="0" /&gt;&lt;/center&gt;&lt;br /&gt;Equation (1) equals to equation (2):&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2160/2129010426_67a0a73336_o.gif" border="0" /&gt;&lt;/center&gt;Now consider the distance you’ve travelled, here’s how it would look like in a graph. &lt;strong&gt;S&lt;/strong&gt; represents the total distance, from the moment you started chasing him, to the moment you stopped. Though both accelerating and decelerating phases take the same amount of time, the distances travelled are different due to difference in velocity.&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2107/2129010302_91ee93f906_o.gif" border="0" /&gt;&lt;/center&gt;Denoting the distance travelled in the accelerating phase with &lt;strong&gt;x&lt;/strong&gt;, we get:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2365/2129010466_7015ce1192_o.gif" border="0" /&gt;&lt;/center&gt;As the total distance travelled is &lt;strong&gt;S&lt;/strong&gt;, it is clear that you travelled &lt;strong&gt;S-x&lt;/strong&gt; in the decelerating phase:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2060/2129010496_bbc52d0de3_o.gif" border="0" /&gt;&lt;/center&gt;Substituting Equation (2) gives:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2146/2128234275_a6d3916a6e_o.gif" border="0" /&gt;&lt;/center&gt;Substituting Equation (3) gives:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2305/2128234377_cce14968ee_o.gif" border="0" /&gt;&lt;/center&gt;Substituting Equation (4) into (5) gives:&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2276/2129010628_540ec82542_o.gif" border="0" /&gt;&lt;/center&gt;&lt;br /&gt;So… what’s the use of analyzing this crazy chase you ask?&lt;br /&gt;&lt;br /&gt;To derive equations that make subtle movements in game feel smoother and more natural. Take for an example selection highlight that moves from one menu item to the other. The selection highlight does not have to jump among menu items because that looks kind of stiff; with its movements interpolated, the selection highlight should smoothly glide between two menu items.&lt;br /&gt;&lt;br /&gt;Of course these formulas are not limited to just movements, they can be used to morph any variable from one value to another (e.g. colors, rotation angle).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-8566643751859871726?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/8566643751859871726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=8566643751859871726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/8566643751859871726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/8566643751859871726'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2007/12/as-guy-snatches-your-hand-bag-you.html' title='Control Your Universe'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1477083969713116925.post-1035771999358009529</id><published>2007-12-16T01:04:00.000-08:00</published><updated>2007-12-23T09:00:43.703-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Human'/><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>A humble beginning of a not-so-humble journey...</title><content type='html'>&lt;strong&gt;The Blog&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Had a blog before, went into coma for a year and died last month. Buried in backyard. I want this to live longer, a lot longer. Hopefully it will all be about inhuman side of me. Inhuman, as in computer stuff. Techie stuff. E=mc2 stuff. Nerdy stuff... geeky stuff. Probably notes as we develop along. Or lesson learnt. Or occasionally, things about human, too.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My Dream&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Had a dream to dictate the world. Fortunately for you, it remained a dream. Settled for something more realistic. Want to make a game, something I was born to do. Turning this, at the time of writing, 12-year-old dream into a reality. Made the first step, found a partner, who's talentedly into game programming, who's believed to be capable of materializing the dream.&lt;br /&gt;&lt;br /&gt;The catch, two must fight together.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1477083969713116925-1035771999358009529?l=betablending.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betablending.blogspot.com/feeds/1035771999358009529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1477083969713116925&amp;postID=1035771999358009529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/1035771999358009529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1477083969713116925/posts/default/1035771999358009529'/><link rel='alternate' type='text/html' href='http://betablending.blogspot.com/2007/12/humble-beginning-of-not-so-humble.html' title='A humble beginning of a not-so-humble journey...'/><author><name>Captain</name><uri>http://www.blogger.com/profile/08253298018819512926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
