<?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-4014309709706658445</id><updated>2012-02-15T23:29:57.891-08:00</updated><category term='Maths'/><category term='Vector Product'/><category term='Scalar Product'/><category term='Projection'/><category term='AI'/><category term='Dot Product'/><category term='Academic'/><category term='Physics'/><category term='Cartesian'/><category term='Cross Product'/><category term='Vector'/><category term='Cartesian coordinate'/><category term='Collision Response'/><title type='text'>Game Tutorial</title><subtitle type='html'>When artificial intelligence meet robotics in Game industry</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gameaitutorial.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gameaitutorial.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>LoongWei Ding</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-ICuloY1P5xU/AAAAAAAAAAI/AAAAAAAAGbo/TVrsCTIOCSg/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4014309709706658445.post-6857956137172442066</id><published>2008-03-20T16:35:00.000-07:00</published><updated>2008-03-20T16:37:23.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maths'/><category scheme='http://www.blogger.com/atom/ns#' term='Dot Product'/><category scheme='http://www.blogger.com/atom/ns#' term='Collision Response'/><category scheme='http://www.blogger.com/atom/ns#' term='Projection'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Simple Collision Response for Plane</title><content type='html'>&lt;span style="font-family: arial;"&gt;Lets say we have a plane (B) with a slope of (delta Y / delta X), the slope of the normal (n) must be (-delta X / delta Y). In vector form, thats the same as B = [delta X, delta Y] and n = [delta Y, -delta X].&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; Let's assume the incoming velocity as U, the result velocity as R.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; Now, it's time to find the projection (P) of -U onto the normalized normal (N).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; By using dot product of -U and N, we will get the length of the projection on N.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; Thus, P = (-U . N) * N --&gt; Eq. 1&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; To find the reflection, we add in V where V = U + P  --&gt; Eq. 2.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; Result velocity (R) = P + V --&gt; Eq.3&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; Substitute Eq.2 into Eq.3,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; R = P + U + P&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;   = 2 * P + U&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: arial;"&gt; Substitute Eq.1 into it,&lt;/span&gt;&lt;br /&gt; &lt;b style="font-family: arial;"&gt;R = U + 2 * (-U . N)N&lt;/b&gt;&lt;span style="font-family: arial;"&gt; or &lt;/span&gt;&lt;b style="font-family: arial;"&gt;R = U - 2 * (U . N)N&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4014309709706658445-6857956137172442066?l=gameaitutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gameaitutorial.blogspot.com/feeds/6857956137172442066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4014309709706658445&amp;postID=6857956137172442066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default/6857956137172442066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default/6857956137172442066'/><link rel='alternate' type='text/html' href='http://gameaitutorial.blogspot.com/2008/03/simple-collision-response-for-plane.html' title='Simple Collision Response for Plane'/><author><name>LoongWei Ding</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-ICuloY1P5xU/AAAAAAAAAAI/AAAAAAAAGbo/TVrsCTIOCSg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014309709706658445.post-1231726148600982477</id><published>2008-03-20T16:29:00.000-07:00</published><updated>2008-03-20T16:34:44.450-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scalar Product'/><category scheme='http://www.blogger.com/atom/ns#' term='Vector Product'/><category scheme='http://www.blogger.com/atom/ns#' term='Cross Product'/><category scheme='http://www.blogger.com/atom/ns#' term='Dot Product'/><category scheme='http://www.blogger.com/atom/ns#' term='Vector'/><title type='text'>Dot product and Cross Product</title><content type='html'>&lt;u style="font-family: arial;"&gt;&lt;span style="font-weight: bold;"&gt;Dot Product&lt;/span&gt;&lt;br /&gt;&lt;/u&gt;&lt;span style="font-family: arial;"&gt;A.B = |A||B|cos(angle)&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; A.B = a1b1 + a2b2 + a3b3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; where A = [a1 a2 a3], B = [b1 b2 b3]&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; If A.B = 0, then |A|B|cos(angle) = 0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; acos(0) = 90degree.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; Thus, A is perpendicular to B,&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; If A.B &lt;&gt; 90 degree&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; If A.B &gt; 0, angle &lt;&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; ** Dot product provides the length of the &lt;/span&gt;&lt;b style="font-family: arial;"&gt;projection&lt;/b&gt;&lt;span style="font-family: arial;"&gt; of one vector to another. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; If A is going to project on to B, B must be normalised.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;u style="font-family: arial; font-weight: bold;"&gt;Cross Product&lt;/u&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; A x B = [(a2b3 - a3b2) (a3b1 - a1b3) (a1b2 - a2b1)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; where A = [a1 a2 a3], B = [b1 b2 b3]&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; A x B is perpendicular to both A and B.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; A x B = -(B x A)&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; |A x B| = |A||B| sin(angle)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4014309709706658445-1231726148600982477?l=gameaitutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gameaitutorial.blogspot.com/feeds/1231726148600982477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4014309709706658445&amp;postID=1231726148600982477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default/1231726148600982477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default/1231726148600982477'/><link rel='alternate' type='text/html' href='http://gameaitutorial.blogspot.com/2008/03/dot-product-and-cross-product.html' title='Dot product and Cross Product'/><author><name>LoongWei Ding</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-ICuloY1P5xU/AAAAAAAAAAI/AAAAAAAAGbo/TVrsCTIOCSg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4014309709706658445.post-7251615918249058672</id><published>2008-02-26T17:53:00.000-08:00</published><updated>2008-02-26T17:54:22.381-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cartesian coordinate'/><category scheme='http://www.blogger.com/atom/ns#' term='AI'/><category scheme='http://www.blogger.com/atom/ns#' term='Academic'/><category scheme='http://www.blogger.com/atom/ns#' term='Cartesian'/><title type='text'>Cartesian Coordinate System</title><content type='html'>&lt;span style="font-family: arial;"&gt;To talk about Cartesian coordinate, maybe most of us still remember what we have learnt during high school. Or perhaps what you remember is what you draw in a graph paper. The one we use in school is in 2-dimensional which has only 2 axes. The horizontal axis is called &lt;/span&gt;&lt;i style="font-family: arial;"&gt;x-axis&lt;/i&gt;&lt;span style="font-family: arial;"&gt; and the vertical axis is called &lt;/span&gt;&lt;i style="font-family: arial;"&gt;y-axis&lt;/i&gt;&lt;span style="font-family: arial;"&gt;. The point where these 2 axes cross together is called &lt;/span&gt;&lt;i style="font-family: arial;"&gt;origin&lt;/i&gt;&lt;span style="font-family: arial;"&gt;.  &lt;/span&gt;&lt;p class="MsoNormal" style="font-family: arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;font-family:arial;"  class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm3.static.flickr.com/2035/2251780090_56645b7f87_o.gif"&gt;&lt;img style="cursor: pointer; width: 400px;" src="http://farm3.static.flickr.com/2035/2251780090_56645b7f87_o.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="font-family: arial;" face="arial" class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;&lt;i style=""&gt;Figure 1: Cartesian coordinate system&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" face="arial" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" face="arial" class="MsoNormal"&gt;A point in the coordinate system is represented by a coordinate pair &lt;i style=""&gt;(x, y)&lt;/i&gt;. The x and y value represent the distances along each axis.&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;Those who have experience in gaming most probably has experience in 3-dimension as well. Cartesian coordinate system in 3D world needs another axis – &lt;i style=""&gt;z-axis&lt;/i&gt;. Z-axis is along side the line that passes through the screen to our eyes.&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm3.static.flickr.com/2330/2250985085_d6c5ef0d21_o.gif"&gt;&lt;img style="cursor: pointer; width: 400px;" src="http://farm3.static.flickr.com/2330/2250985085_d6c5ef0d21_o.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;&lt;i style=""&gt;Figure 2: 3D coordinate system&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;To represent a line in 2D Cartesian, a function consist of variables can be introduced. In general, a straight line in &lt;i style=""&gt;x&lt;/i&gt; and &lt;i style=""&gt;y&lt;/i&gt; coordinate system can be represented by &lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;i style=""&gt;y = mx + c&lt;/i&gt; &lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;where &lt;i style=""&gt;y&lt;/i&gt; and &lt;i style=""&gt;x&lt;/i&gt; are the values represents the point while &lt;i style=""&gt;m&lt;/i&gt; is the gradient of the straight line and &lt;i style=""&gt;c&lt;/i&gt; is the &lt;i style=""&gt;y&lt;/i&gt; value where the straight line intercept to &lt;i style=""&gt;y&lt;/i&gt;-&lt;i style=""&gt;axis&lt;/i&gt;.&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;Example: &lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm3.static.flickr.com/2309/2250985129_9f95b9b9e6_o.gif"&gt;&lt;img style="cursor: pointer; width: 400px;" src="http://farm3.static.flickr.com/2309/2250985129_9f95b9b9e6_o.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;&lt;i style=""&gt;Figure 3: y = 3x + 2&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4014309709706658445-7251615918249058672?l=gameaitutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gameaitutorial.blogspot.com/feeds/7251615918249058672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4014309709706658445&amp;postID=7251615918249058672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default/7251615918249058672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4014309709706658445/posts/default/7251615918249058672'/><link rel='alternate' type='text/html' href='http://gameaitutorial.blogspot.com/2008/02/cartesian-coordinate-system.html' title='Cartesian Coordinate System'/><author><name>LoongWei Ding</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-ICuloY1P5xU/AAAAAAAAAAI/AAAAAAAAGbo/TVrsCTIOCSg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
