<?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-6484199206811781145</id><updated>2011-07-08T14:03:37.596+01:00</updated><category term='GDT'/><category term='Modelling'/><category term='Render'/><category term='First Post'/><category term='Earth'/><category term='Blender'/><category term='Intro to 3d'/><title type='text'>Richard Pickering- Games Programmer</title><subtitle type='html'>This is the blog showing work and tech demos of certain elements which I have produced :D.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-6536978019037054043</id><published>2010-09-30T04:30:00.002+01:00</published><updated>2010-09-30T04:35:41.548+01:00</updated><title type='text'>Update On Work</title><content type='html'>Hello,&lt;br /&gt;&lt;br /&gt;I thought I'll write to my blog detailing what I've been up to over summer.  As some of you may know I am making a business, which I am naming Pickering Game Development for my placement year at university.  I have designed several games, however I am unable to comment on these, as they are still in initial development phases, so I shall write in more detail about them when they are further on in their development.  Instead, I shall detail some of the work which I have done for my business from a musical point of view throughout this blog entry.  I have composed and recorded/mixed several songs which I plan on using within different game projects for my business.  A list of links should be displayed below leading to the youtube videos of said songs:&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=nwZA6FHxwwQ&lt;br /&gt;http://www.youtube.com/watch?v=iz3H1gCteyg&lt;br /&gt;http://www.youtube.com/watch?v=xbOnzSSJgF4&lt;br /&gt;http://www.youtube.com/watch?v=6fZ7iZ-Nzew&lt;br /&gt;http://www.youtube.com/watch?v=DQ1PDLYB9SA&lt;br /&gt;&lt;br /&gt;Please feel free to leave comments on the videos, as I appreciate any feedback which is provided.  The music has been created with the assistance of Apple's Garageband music creation software.  Thanks for reading, I hope you enjoy the music :D.&lt;br /&gt;&lt;br /&gt;Richard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-6536978019037054043?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/6536978019037054043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/09/update-on-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/6536978019037054043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/6536978019037054043'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/09/update-on-work.html' title='Update On Work'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-7053227130446223466</id><published>2010-07-22T16:11:00.002+01:00</published><updated>2010-07-22T16:21:04.950+01:00</updated><title type='text'>What I've Been Up To, + Plans For The Future</title><content type='html'>Hello everybody,&lt;br /&gt;&lt;br /&gt;I know it's been a long time since my last post, so I just thought I'd give everyone an update as to what I'm currently doing at the moment, and what I plan on doing over the next year.  As some of you may know, it is my placement year at the moment on my degree.  This means that I should have gone and found a placement with a business of some description, doing an IT role of some description.  I, however, was unable to do this due to the lack of interest from companies, due to the economic climate at the moment.  Instead I have decided to work for myself, and create games and applications, which people can download digitally.  I am doing this using a number of services.  I am writing games in XNA Game Studio 3.1 at the moment, which I am presenting to the public using the Creators' Club and Xbox Live Arcade.  I am also developing iPhone applications and games, to present to the community using the App Store.&lt;br /&gt;&lt;br /&gt;I am currently developing a game which has an in-house title of Project Nerd.  This game will be an indie RPG game, and will be a long time coming, as this game will be the fruits of roughly eight months of work.  I am also developing a title called "Fighterspace Racers" which should be released in approximately two months.  This will be released via XBLA, and if successful on that platform, will also be released on iPhone.&lt;br /&gt;&lt;br /&gt;In terms of iPhone development, I am currently searching for contracts to develop iPhone applications for businesses.  I have not currently made any commercially available iPhone applications, however I should have one or two on the market (on the app store) in approximately one to two months.  I am also learning several other software languages in between doing all this, making me a bit of a busy bee at the moment.&lt;br /&gt;&lt;br /&gt;Project Nerd will have a trailer, marketing related materials and demo version available to the community before the year is up, so keep an eye out! :D.  Fighterspace Racers should be available from 30th September, 2010, so if you play games on the XBox and have an XBox Live account, please feel free to download it, and play :D.  If anyone wants to contact me on any of the information I have presented in this article, email me at richard.pickering@hotmail.co.uk.  Thanks for reading,&lt;br /&gt;&lt;br /&gt;Richard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-7053227130446223466?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/7053227130446223466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/07/what-ive-been-up-to-plans-for-future.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/7053227130446223466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/7053227130446223466'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/07/what-ive-been-up-to-plans-for-future.html' title='What I&apos;ve Been Up To, + Plans For The Future'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-527081073485894406</id><published>2010-05-21T16:07:00.001+01:00</published><updated>2010-05-21T16:41:13.525+01:00</updated><title type='text'>Teaser of things to follow!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S_apZHYg8rI/AAAAAAAAAKE/TNv9NlPQed8/s1600/Borealis.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S_apZHYg8rI/AAAAAAAAAKE/TNv9NlPQed8/s400/Borealis.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5473748646059111090" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/S_akwlJBJVI/AAAAAAAAAJ0/ACX-oJMsldw/s1600/B2DLogo.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/S_akwlJBJVI/AAAAAAAAAJ0/ACX-oJMsldw/s400/B2DLogo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5473743551626028370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This week the second year of University has finished, leaving my time free to create all kinds of weird and wonderful applications.  Here is a small teaser of what is to come on this blog:&lt;br /&gt;&lt;br /&gt;B2D- Borealis 2-Dimensions is a 2-Dimensional game engine that I will develop over summer for both iPhone and PC.  This does mean that the engine will be written firstly in C++ and then in Objective-C, however I believe that this is an achievable game engine, and will be used in games which I release of the next fifteen months.  I will also make aspects of this engine available for the community upon its release.&lt;br /&gt;&lt;br /&gt;Borealis- 3D Game engine that I have already begun development on. This engine will be used to provide decent 3D Graphics to any 3D PC games which I may decide to write.  The logo is provided above. &lt;br /&gt;&lt;br /&gt;Iphone Games- I shall be making iPhone games for the next fifteen months, and detailed descriptions of these games shall be featured on this blog.  Some code may even be posted :D.&lt;br /&gt;&lt;br /&gt;PC Games- I shall be working on making different game engines and using these I shall develop different PC games.  I shall release these games using a file server and setting up my own website.  Watch out for the post on here when I set it up, as the address will be included within the post.  Detailed descriptions of these games will be posted, as well as development notation, and possibly code :D.&lt;br /&gt;&lt;br /&gt;Thanks for reading, :D.&lt;br /&gt;&lt;br /&gt;P.S. The white areas in the attached picture are actually supposed to be transparent, as they will appear when used within the engine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-527081073485894406?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/527081073485894406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/05/teaser-of-things-to-follow.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/527081073485894406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/527081073485894406'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/05/teaser-of-things-to-follow.html' title='Teaser of things to follow!'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/S_apZHYg8rI/AAAAAAAAAKE/TNv9NlPQed8/s72-c/Borealis.png' height='72' width='72'/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-8189986802361631271</id><published>2010-04-19T03:22:00.000+01:00</published><updated>2010-04-19T03:39:11.818+01:00</updated><title type='text'>Borealis- Game Engine</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/S8vCKDci34I/AAAAAAAAAJs/42lJP0zPhNU/s1600/ParticleEffects.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/S8vCKDci34I/AAAAAAAAAJs/42lJP0zPhNU/s400/ParticleEffects.bmp" alt="" id="BLOGGER_PHOTO_ID_5461672451096371074" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S8vCJ0TclwI/AAAAAAAAAJk/bSwT_zTvuBA/s1600/FireWork.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S8vCJ0TclwI/AAAAAAAAAJk/bSwT_zTvuBA/s400/FireWork.bmp" alt="" id="BLOGGER_PHOTO_ID_5461672447031678722" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S8vCJlK1l5I/AAAAAAAAAJc/VS6bBhIqGj8/s1600/Skull2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S8vCJlK1l5I/AAAAAAAAAJc/VS6bBhIqGj8/s400/Skull2.bmp" alt="" id="BLOGGER_PHOTO_ID_5461672442969036690" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/S8vCJUhddKI/AAAAAAAAAJU/JJQcerFEUyc/s1600/Skull.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/S8vCJUhddKI/AAAAAAAAAJU/JJQcerFEUyc/s400/Skull.bmp" alt="" id="BLOGGER_PHOTO_ID_5461672438500521122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hi all,&lt;br /&gt;&lt;br /&gt;It has been a long time since my last post, and I just thought I would fill you in on what I have been up to.  I have been working on a lot of projects lately, but the one which has taken the majority of my time up has consistently been one for Interactive3D Graphics.  I am making a game engine, which I have affectionately named "Borealis".  That is also the reason for this post today, as I have made quite a lot of progress with this engine lately.&lt;br /&gt;&lt;br /&gt;The game engine itself uses DirectX 9.0c for rendering and makes use of the Win32 API for the application side of this engine.  Due to this it is compatible only with Windows OS installed computers with the DirectX 9.0c drivers or later.&lt;br /&gt;&lt;br /&gt;There are a great many features of this engine which I have added in, and the first one that you may notice is that I have the ability to load meshes from file, which in itself is quite a simple task.  The truth is that I am loading the mesh into a data structure of my own, the BMesh, which contains a DirectX mesh, but also has several other data members.  The first is a shader, which is a small program that can be run on the graphics card.  It also has a large number of textures and materials, which are stored in dynamic arrays.  It has a position too.&lt;br /&gt;&lt;br /&gt;The interesting part about the shader I previously mentioned is that I have made my own data container for that too, BEffect.  In fact, quite a lot of the areas that my game engine uses DirectX functions from are covered in my own, so that I can make the engine multi-platform and more universal.&lt;br /&gt;&lt;br /&gt;With the shaders, I have been able to make particle effects, phong shading for meshes, terrain lighting, and more.  Some of the results I have been able to achieve are shown in the images displayed above.  The first image (the red skull) is actually an error which I received from a badly programmed shader.  The reason for it being so badly shaded is that I had incorrectly set the materials and normal vectors, so the entire lighting and shading of the object was incorrect for the Phong model.  The reason I have included it here is because I thought it had a certain visual aesthetic to it, which made it interesting.&lt;br /&gt;&lt;br /&gt;The particle effects that can be seen within the above images are entirely processed on the GPU (Graphical Processing Unit) instead of the CPU (Central Processing Unit), leavint the CPU to perform other tasks.  This is the reason that the frame counter sticks at a constant 60 FPS throughout the imagery, even though thousands of particles are being processed.&lt;br /&gt;&lt;br /&gt;There are many areas of this engine which I am not displaying in this post, as they are not yet entirely complete, however I hope this gives an insight into the development of a game engine.  I will update with another post containing more feature demos soon.  Expect to see bump mapping, environment mapping and much more next time.  Thanks for reading,&lt;br /&gt;&lt;br /&gt;Richard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-8189986802361631271?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/8189986802361631271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/04/borealis-game-engine.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/8189986802361631271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/8189986802361631271'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/04/borealis-game-engine.html' title='Borealis- Game Engine'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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://4.bp.blogspot.com/_1Puk2oGpljk/S8vCKDci34I/AAAAAAAAAJs/42lJP0zPhNU/s72-c/ParticleEffects.bmp' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-8292698423735051908</id><published>2010-02-17T01:21:00.000Z</published><updated>2010-02-17T01:38:25.950Z</updated><title type='text'>XNA Terrain Generator</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIg7BkLUI/AAAAAAAAAJM/1r2VQocSyBs/s1600-h/terrV7.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 258px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIg7BkLUI/AAAAAAAAAJM/1r2VQocSyBs/s400/terrV7.bmp" alt="" id="BLOGGER_PHOTO_ID_5439020705417276738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/S3tIgSpRDFI/AAAAAAAAAJE/K_KwE6bcJfc/s1600-h/terrV6.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 258px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/S3tIgSpRDFI/AAAAAAAAAJE/K_KwE6bcJfc/s400/terrV6.bmp" alt="" id="BLOGGER_PHOTO_ID_5439020694577941586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIgEErA_I/AAAAAAAAAI8/CMwSHgSTBCU/s1600-h/terrv5.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 309px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIgEErA_I/AAAAAAAAAI8/CMwSHgSTBCU/s400/terrv5.bmp" alt="" id="BLOGGER_PHOTO_ID_5439020690666357746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIfwIommI/AAAAAAAAAI0/xLBX3LYsLEE/s1600-h/terrV4.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 309px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIfwIommI/AAAAAAAAAI0/xLBX3LYsLEE/s400/terrV4.bmp" alt="" id="BLOGGER_PHOTO_ID_5439020685314267746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIfpwVD9I/AAAAAAAAAIs/8NBGu8LxIRQ/s1600-h/terr1.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 315px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S3tIfpwVD9I/AAAAAAAAAIs/8NBGu8LxIRQ/s400/terr1.bmp" alt="" id="BLOGGER_PHOTO_ID_5439020683601711058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hello all,&lt;br /&gt;&lt;br /&gt;I know I've not posted in quite a while, so I thought I'd make up for it by posting information about a terrain generator which I'm making for an assignment at University.  This is just an XNA rapidly created prototype, so all of the kinks aren't quite worked out yet.  It's fairly high-res with approximately 1 million verts being displayed in the most advanced outputs which it creates.&lt;br /&gt;&lt;br /&gt;The way that it does this in the most advanced version is that it fires "rays" around and then modifies the terrain height map using the distance from interpolated points along these rays which is then attenuated by a random value.  After this the verts are "smoothed" out using an averaging algorithm.  I know that it's fairly basic, but this is a basic prototype, I am planning to create a new prototype fairly soon using the quite fast, high detail Diamond-Square algorithm.  Thanks for reading,&lt;br /&gt;&lt;br /&gt;Richard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-8292698423735051908?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/8292698423735051908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/02/xna-terrain-generator.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/8292698423735051908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/8292698423735051908'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/02/xna-terrain-generator.html' title='XNA Terrain Generator'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/S3tIg7BkLUI/AAAAAAAAAJM/1r2VQocSyBs/s72-c/terrV7.bmp' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-5652498727036465502</id><published>2010-01-07T21:40:00.000Z</published><updated>2010-01-07T22:11:49.623Z</updated><title type='text'>Life Sim Game by Me</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/S0ZZFaGxJTI/AAAAAAAAAIk/Q1UQDVVY4SA/s1600-h/5.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/S0ZZFaGxJTI/AAAAAAAAAIk/Q1UQDVVY4SA/s400/5.jpg" alt="" id="BLOGGER_PHOTO_ID_5424120750656267570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S0ZZEwMN9FI/AAAAAAAAAIc/Sbx4eJIQ_GY/s1600-h/4.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S0ZZEwMN9FI/AAAAAAAAAIc/Sbx4eJIQ_GY/s400/4.jpg" alt="" id="BLOGGER_PHOTO_ID_5424120739404837970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/S0ZZEttxF5I/AAAAAAAAAIU/aDx_G3ee_Oo/s1600-h/3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/S0ZZEttxF5I/AAAAAAAAAIU/aDx_G3ee_Oo/s400/3.jpg" alt="" id="BLOGGER_PHOTO_ID_5424120738740246418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/S0ZZERdDJjI/AAAAAAAAAIM/NrZlkPJ5D38/s1600-h/2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/S0ZZERdDJjI/AAAAAAAAAIM/NrZlkPJ5D38/s400/2.jpg" alt="" id="BLOGGER_PHOTO_ID_5424120731153933874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/S0ZZETKEclI/AAAAAAAAAIE/o8rkmQ2Z3Nw/s1600-h/1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/S0ZZETKEclI/AAAAAAAAAIE/o8rkmQ2Z3Nw/s400/1.jpg" alt="" id="BLOGGER_PHOTO_ID_5424120731611198034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hi,&lt;br /&gt;&lt;br /&gt;Just thought I'd talk this week about a life simulator game that I've made.  It simulates the conditions in which cells must survive.  It is basically a toy, as it has no end goals or conditions, you just get to play with it, however it is quite interesting, as the cells can be created at will by pressing the "C" key and then you watch them flourish.  Their size is directly related to how many times that they have mated, however, if they are too sparsely spread they will die of loneliness.  They also cannot survive a single tool which I added, called "Fire".  At the moment the purpose of this application was an experiment into some AI type areas to be honest, however, it is quite impressive to watch it in action, due to the sheer speed of the mating of these cells.&lt;br /&gt;&lt;br /&gt;Fire can be spread to different cells, which makes this tool a chain reaction weapon, which can be used to test the hardiness of the cells which you have created.  It is surprising how fast that the cells actually recover their lost numbers after a wave of fire through their numbers.  Anyways, the images posted will show the rest.  This application only took me a few hours to be honest, but it is quite interesting in terms of the "Psychology" of the AI of the Cells.  Thanks for reading, I should have another post up quite soon about any other applications which I have been developing over Christmas and New Year.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-5652498727036465502?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/5652498727036465502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/01/life-sim-game-by-me.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/5652498727036465502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/5652498727036465502'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2010/01/life-sim-game-by-me.html' title='Life Sim Game by Me'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/S0ZZFaGxJTI/AAAAAAAAAIk/Q1UQDVVY4SA/s72-c/5.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-7603551549643251288</id><published>2009-12-03T00:13:00.000Z</published><updated>2009-12-03T00:20:01.373Z</updated><title type='text'>Renderer- Intro to 3d- Scanline rasterization</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/SxcEKioM6nI/AAAAAAAAAHY/_HjDjLi6N6Q/s1600-h/scanlin1.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/SxcEKioM6nI/AAAAAAAAAHY/_HjDjLi6N6Q/s400/scanlin1.bmp" alt="" id="BLOGGER_PHOTO_ID_5410798056449567346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I finally have scan-line rasterization working, which is, by far, the most complex mathematical thing I have EVER had to do.  It involves interpolating between the vertices which make up the triangle, in order to get a number of points on its surface.  These points are then used as pixels and the areas in between the extents of the pixels are filled with colour.  This is a kind of per-poly rasterization at the moment, but it is easy to make it a per-pixel rasterization technique, by simply interpolating colour across the surface of an object.&lt;br /&gt;&lt;br /&gt;At the moment I simple have scan-line flat shading, which I also have in Gdiplus.  However, scan line drawing does work significantly slower than using gdiplus.  However scan line, due to it's per-pixel nature does have a significant advantage over gdiplus, which is by nature shape and vector based.  I am looking forward to getting gouraud and some kind of phong shading working within this renderer too, since I already have scan line rasterization finished (which I only began implementing yesterday, not bad to say it's my birthday as of half an hour ago lol).&lt;br /&gt;&lt;br /&gt;The screenshots are shown above this text.  Thanks for reading,&lt;br /&gt;&lt;br /&gt;Richard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-7603551549643251288?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/7603551549643251288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/12/renderer-intro-to-3d-scanline.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/7603551549643251288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/7603551549643251288'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/12/renderer-intro-to-3d-scanline.html' title='Renderer- Intro to 3d- Scanline rasterization'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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://4.bp.blogspot.com/_1Puk2oGpljk/SxcEKioM6nI/AAAAAAAAAHY/_HjDjLi6N6Q/s72-c/scanlin1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-8112556261033092543</id><published>2009-11-26T17:41:00.000Z</published><updated>2009-11-26T17:51:58.026Z</updated><title type='text'>Game Dev Tech Radio Model</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/Sw7AN9gDkTI/AAAAAAAAAHQ/hzNrF6kpMug/s1600/rad1.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 321px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/Sw7AN9gDkTI/AAAAAAAAAHQ/hzNrF6kpMug/s400/rad1.bmp" alt="" id="BLOGGER_PHOTO_ID_5408471548598391090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hi,&lt;br /&gt;&lt;br /&gt;I'm writing today about a model which I've made for Game Development Techniques at University using my favourite (as by now most of you know) modelling software Blender.  It is supposed to be an old fashioned radio, for my Famous Five game.  It is fully UV Mapped and textured, using solid colours only at current, as I didn't have time to go through properly texturing it.  It is shown rendered with a space background which is within the settings for Blender, which I think is a really cool feature, which saves a lot of time, instead of having to find an image of a starry sky and set that as a background image.&lt;br /&gt;&lt;br /&gt;A cool thing about this radio too is its scale compared to the reference image, as it is pretty much on a 1:1 scale, and is pretty accurate as a representation.  The only downside as I say is the lack of complexity within the UV texture.  However, I don't think its a bad attempt, considering that I am a programmer, not an artist.&lt;br /&gt;&lt;br /&gt;Blender, due to its ability to export to .lwo file extensions is directly exportable into UnrealEd and from there into a static mesh package for Unreal Engine 2, making it really easy to make mods and things with Blender, as you can program the Unreal Script within notepad++ (a really cool tool that I highly recommend).  Another cool thing about this radio is that it was created by sub-surfing an extruded cube.  Subsurfing actually simply subdivides the original polygons and allows you to add 'crease' to the model before applying the subsurfacing modifier.  You can make faces and things within it, as is shown in some Blender tutorials, however, I am just a beginner with the entire 3D modelling thing, so I'm not going to be that ambitious.&lt;br /&gt;&lt;br /&gt;Creasing the model allows you to create different angles with the 'smoother' image, and in order to save on verts, you can even join or 'merge' verts which are only on flat surfaces together.  This results in no drop of model quality, however it does save on processing time by quite a lot. :D.  Other optimisations which can be made are adding spheres or other objects which are already subdivided into the object later on (after subsurfing).&lt;br /&gt;&lt;br /&gt;I hope you've enjoyed reading this as much as I have had writing, thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-8112556261033092543?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/8112556261033092543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/game-dev-tech-radio-model.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/8112556261033092543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/8112556261033092543'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/game-dev-tech-radio-model.html' title='Game Dev Tech Radio Model'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/Sw7AN9gDkTI/AAAAAAAAAHQ/hzNrF6kpMug/s72-c/rad1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-912952851784955383</id><published>2009-11-25T01:38:00.000Z</published><updated>2009-11-25T01:50:28.351Z</updated><title type='text'>Introduction to 3D Graphics Programming- Renderer Lighting</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/SwyNMuOLSzI/AAAAAAAAAHI/hi47YR7C8xQ/s1600/lightin2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 235px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/SwyNMuOLSzI/AAAAAAAAAHI/hi47YR7C8xQ/s400/lightin2.bmp" alt="" id="BLOGGER_PHOTO_ID_5407852502270561074" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/SwyNMuWaFQI/AAAAAAAAAHA/JfQkDIkDYrU/s1600/lightin1.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 235px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/SwyNMuWaFQI/AAAAAAAAAHA/JfQkDIkDYrU/s400/lightin1.bmp" alt="" id="BLOGGER_PHOTO_ID_5407852502305084674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hi and welcome to my latest post on my blog! :D.  I am writing to let you know that I finally have flat shading working correctly within my 3D Renderer for Introduction to 3D Graphics Programming.  I have modelled Ambient and Diffuse Lighting (for Directional Lighting).  On top of this I have also transformed the object from model space into world space, which effectively can be used for any models I wish to load into my project.  Within this world space transform I have made the model of my choice rotate around the 'Y' axis, so it has the effect of constantly turning and spinning at a fairly slow rate.&lt;br /&gt;&lt;br /&gt;The above images demonstrate what I have been talking about.&lt;br /&gt;&lt;br /&gt;Over this week I have also been working on a multi-source file application which is incredibly simple, however is also compiled within the Unix BASH terminal, which is very handy as it comes with Linux, as Linux is based on Unix and I have Linux installed on one of my computers :D.  I will post some code for the directional lighting soon, and there will also be notes on some of the errors which can be encountered whilst modelling this form of lighting (ones I ran into lol).  Thanks for reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-912952851784955383?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/912952851784955383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/introduction-to-3d-graphics-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/912952851784955383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/912952851784955383'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/introduction-to-3d-graphics-programming.html' title='Introduction to 3D Graphics Programming- Renderer Lighting'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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://4.bp.blogspot.com/_1Puk2oGpljk/SwyNMuOLSzI/AAAAAAAAAHI/hi47YR7C8xQ/s72-c/lightin2.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-5049694525079270625</id><published>2009-11-16T23:34:00.000Z</published><updated>2009-11-16T23:52:58.991Z</updated><title type='text'>Intro to 3D-- Finally Rendering!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/SwHlumK00fI/AAAAAAAAAG4/3yyP0Yw27yg/s1600/3.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 236px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/SwHlumK00fI/AAAAAAAAAG4/3yyP0Yw27yg/s400/3.bmp" alt="" id="BLOGGER_PHOTO_ID_5404853616504001010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/SwHluZNtu4I/AAAAAAAAAGw/txm9hT3B-3o/s1600/2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 236px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/SwHluZNtu4I/AAAAAAAAAGw/txm9hT3B-3o/s400/2.bmp" alt="" id="BLOGGER_PHOTO_ID_5404853613026458498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/SwHluFbwJSI/AAAAAAAAAGo/Ah7yknO3tyA/s1600/1.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 236px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/SwHluFbwJSI/AAAAAAAAAGo/Ah7yknO3tyA/s400/1.bmp" alt="" id="BLOGGER_PHOTO_ID_5404853607716627746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Yay, I have finally got my 3D software renderer to work for my University Module, Intro to 3D.  It is very simple at the moment as a renderer, and only has 3 options; draw wireframe, draw solid colour polygons, and very basic (and wrong) flat shading lol.  It is simply a starting point upon which further more advanced versions shall be created.&lt;br /&gt;&lt;br /&gt;So how does this renderer work.  Well to put it simply, under the hood it has a rendering pipline, which transforms 4-dimensional co-ordinates to 3-dimensional co-ordinates, to 2-dimensional co-ordinates, and then those co-ordinates are translated and scaled to become the screen transform.  When a set of vertices are transformed by these stages within my pipeline and my renderer, they are rendered to screen.  The actual 'drawing' code actually takes up a surprisingly small amount of space.  My "rasterizer" file is no more than 150 lines of code, and this draws the outputs of the different mathematical processes to a bitmap image, which is then drawn to screen.&lt;br /&gt;&lt;br /&gt;The actual steps which are followed by the program are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Build Camera Transform: the viewing transform is built which takes the position of the camera into account during the transformation process.  In later versions it may also deal with the rotation of the camera, however for now, it will only deal with its position.&lt;/li&gt;&lt;li&gt;Build Projection Transform: the projection transform is the transformation actually deforming the vertices you would see on screen, for instance, it is used in this code to produce a 'perspective' camera transform where vertices will appear closer to the horizon the further away they become.&lt;/li&gt;&lt;li&gt;Dehomogenise: dehomogenising the vertices literally means dividing all the elements by the fourth component of the vector which is also known as 'W'.  It is a very simple stage, and is used to transform 4-D co-ordinates to 3-D co-ordinates.&lt;/li&gt;&lt;li&gt;Build Screen Transform: the screen transform scales the vertices in order to put them onto screen and make them fit better inside the viewing window.  It also changes the origin to the top left corner of the screen, instead of the middle of the screen, as most applications use the top left corner of the screen as the origin point.&lt;/li&gt;&lt;li&gt;Draw Wireframe/Poly: this is the bit of the code which actually draws the data we have after all that mathematical mumbo-jumbo into a bitmap image.  It is fairly simple, and at this point, only uses Gdiplus to "rasterize" the image.&lt;/li&gt;&lt;li&gt;Draw to Screen: this is a tiny bit of code, which is actually really simple.  It simply takes the image being drawn in the rasterizer and copies it to screen in the window, using the windows generated window identification number (HWND).&lt;/li&gt;&lt;/ul&gt;After all this is performed, post-processing can also happen, but none is happening at the moment within my renderer.  In the above images, there is a helicopter renderer using wireframe rendering, solid colour polygon rendering and flat rendering.  Thanks for reading, I hope you enjoy the images, and the thought provoking description of my renderer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-5049694525079270625?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/5049694525079270625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/intro-to-3d-finally-rendering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/5049694525079270625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/5049694525079270625'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/intro-to-3d-finally-rendering.html' title='Intro to 3D-- Finally Rendering!'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/SwHlumK00fI/AAAAAAAAAG4/3yyP0Yw27yg/s72-c/3.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-4822403544296637091</id><published>2009-11-14T13:20:00.000Z</published><updated>2009-11-14T15:12:00.461Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Render'/><category scheme='http://www.blogger.com/atom/ns#' term='GDT'/><category scheme='http://www.blogger.com/atom/ns#' term='Intro to 3d'/><category scheme='http://www.blogger.com/atom/ns#' term='Modelling'/><category scheme='http://www.blogger.com/atom/ns#' term='Earth'/><category scheme='http://www.blogger.com/atom/ns#' term='Blender'/><title type='text'>Solar Blender Render</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/Sv7Iu3Zg5gI/AAAAAAAAAGg/lF_JbODCAvg/s1600-h/EarthBlenderRender1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 322px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/Sv7Iu3Zg5gI/AAAAAAAAAGg/lF_JbODCAvg/s400/EarthBlenderRender1.png" alt="" id="BLOGGER_PHOTO_ID_5403977310361675266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Wow, I'm even more busy than I was before, so I thought I'd take a little time out to write a post on here :).  See I do still think about all you guys.  I have finished working on a render of Earth and the Sun in Blender (not to actual sizes of course lol).  It's got UV texture mapping, different shaders applied and all sorts of cool stuff.  The render is shown in the attached image to this post.&lt;br /&gt;&lt;br /&gt;Right then, just a quick overview of how I made this ultra-cool scene in Blender.  Firstly I simply added an Icosphere, as the flow lines work better with texture mapping.  This was subdivided 5 times in its default properties, which means that each poly on the surface of the object was halved 5 times, effectively doubling the number of polys and giving a much more seamless effect.  I then mapped a large texture onto its surface using UV texture mapping.  This large image was actually taken from the NASA website, and is a picture from a satelite of North and South America.  I used this same image on both sides of the sphere, which means that there is 2 America's on the render and no other continents or countries.  For this reason the render is using the camera co-ordinates above one side of the sphere, so that you don't see America on both sides on the render.&lt;br /&gt;&lt;br /&gt;I then added the sun, which actually uses no textures as it is procedurally generated by Blender itself.  It simply uses the surface normals to establish where to put colour, which is randomly selected according to a few parameters, such as Halo size, Ring size, etc.  This emits a LOT of light, as a material, but this light didn't actually reach the Earth model, due to the distance it was away from it, so I also made a lamp and placed it in the correct position to give realistic results between the 'Earth' and 'Sun'.&lt;br /&gt;&lt;br /&gt;The only other effects that can be seen on the render include the starfield that populates the 'sky'.  This is simply another cool Blender feature.  It is created/used by modifying the material that the camera draws as its plane of projection.  It is literally a couple of checkboxes, and star density and stuff can be set.  It's a very useful feature.  Blender overall is also an incredibly useful software piece.&lt;br /&gt;&lt;br /&gt;The shaders used in this scene are mainly used on Earth, which is CookTorr specular and Lambert diffuse shading.  These produced the most realistic results, so I decided to use them.&lt;br /&gt;&lt;br /&gt;Note: on the 'Earth' model I also selected the option "set smooth".  This was to stop the shaders from doing any kind of flat shading and stuff, which looks quite ineffective for what I was trying to achieve.&lt;br /&gt;&lt;br /&gt;Special thanks to the good people of Linux, and to the different GNU software pieces.  I used the GIMP editor to create/modify the textures to the correct format, Blender for the actual modelling process, and Linux Mint as the operating system which I ran these different programs within.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-4822403544296637091?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/4822403544296637091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/solar-blender-render.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/4822403544296637091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/4822403544296637091'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/solar-blender-render.html' title='Solar Blender Render'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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://4.bp.blogspot.com/_1Puk2oGpljk/Sv7Iu3Zg5gI/AAAAAAAAAGg/lF_JbODCAvg/s72-c/EarthBlenderRender1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-418272159535572980</id><published>2009-11-03T23:41:00.000Z</published><updated>2009-11-03T23:47:02.204Z</updated><title type='text'>What's coming up in the next week or so</title><content type='html'>Dear all readers,&lt;br /&gt;&lt;br /&gt;I just thought I'd post this to let you know what's coming up in the next week or so.  I shall be posting the following list:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;All unreal script code so far&lt;/li&gt;&lt;li&gt;Any unfinished, or unposted MIPS tutorials I have done (about 3 chapters probs)&lt;/li&gt;&lt;li&gt;All code for 3D Renderer in C++ (Don't bother copying it, it won't work without the required resource files lol)&lt;/li&gt;&lt;li&gt;News of PPD Tutorials&lt;/li&gt;&lt;li&gt;Plans for IGF entrance (game competition)&lt;/li&gt;&lt;li&gt;Creators Club plans&lt;/li&gt;&lt;li&gt;Some AI programming in C# and UnrealScript&lt;/li&gt;&lt;li&gt;Anything else that comes to mind.&lt;/li&gt;&lt;/ul&gt;I hope you look forward to reading about all these cool things as much as I have enjoyed programming them.  Hope you're looking forward to my next post, news of PPD stuff lol.  Should be...interesting :P.  Thanks for reading,&lt;br /&gt;&lt;br /&gt;Richard&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-418272159535572980?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/418272159535572980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/whats-coming-up-in-next-week-or-so.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/418272159535572980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/418272159535572980'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/whats-coming-up-in-next-week-or-so.html' title='What&apos;s coming up in the next week or so'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-2966915427587910151</id><published>2009-11-01T21:41:00.000Z</published><updated>2009-11-01T23:56:58.862Z</updated><title type='text'>MIPS Assembly- Chapter 14/15 Kjell's Tutorials</title><content type='html'>I know that there's not been too much activity on here recently, I've just not had a chance to put things up on here too much recently lol.  So this time I've prepared the answers to some of Kjell's online MIPS assembly tutorials and things.  To find these tutorials, they're on the website, which can be found by typing "Kjell's MIPS Tutorials" into google.&lt;br /&gt;&lt;br /&gt;Ok, so the first tutorial that I'm going to show is the first question from  Chapter 14.  The task was as follows, which is the exact task as worded by Kjell on the website.&lt;br /&gt;&lt;h2&gt;*Exercise 1&lt;/h2&gt;  &lt;p&gt; Write a program to evaluate a polynomial, similar to &lt;code&gt;newMult.asm&lt;/code&gt; from the chapter. Evaluate the polynomial: &lt;/p&gt;  &lt;pre class="code"&gt;3x&lt;sup&gt;2&lt;/sup&gt; + 5x - 12&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; Pick a register to contain &lt;code&gt;x&lt;/code&gt; and initialize it to an integer value (positive or negative) at the beginning of the program. Assume that  &lt;code&gt;x&lt;/code&gt; is small enough so that all results remain in the  &lt;code&gt;lo&lt;/code&gt; result register. Evaluate the polynomial and leave its value in a register. &lt;/p&gt;  &lt;p&gt; Verify that the program works by using several initial values for &lt;code&gt;x&lt;/code&gt;. Use  &lt;code&gt;x = 0&lt;/code&gt; and  &lt;code&gt;x = 1&lt;/code&gt; to start since this will make debugging easy. &lt;/p&gt;  &lt;p&gt; &lt;b&gt;Optional:&lt;/b&gt; write the program following the hardware rule that two or more instructions must follow a &lt;code&gt;mflo&lt;/code&gt; instruction before another  &lt;code&gt;mult&lt;/code&gt; instruction. Try to put useful instructions in the two slots that follow the  &lt;code&gt;mflo&lt;/code&gt;. Otherwise put no-op instructions,  &lt;nobr&gt;&lt;code&gt;sll $0,$0,0&lt;/code&gt;&lt;/nobr&gt;, in the two slots.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So in order to achieve the desired result for the above question, I wrote the following code:&lt;/p&gt;&lt;p&gt;#Equation to work out: 3x (to the power of 2) + 5x - 12&lt;br /&gt;&lt;br /&gt;#Variable initialisation&lt;br /&gt;ori $8, $0, 1        #Register to contain x&lt;br /&gt;ori $9, $0, 0        #Register to contain result&lt;br /&gt;ori $10, $0, 3        #temporary register&lt;br /&gt;&lt;br /&gt;#First part of the equation&lt;br /&gt;multu $8, $10        #multiply reg 8 by reg 10&lt;br /&gt;mflo $9                #get result from lo register and put it into reg 9.  Result of 3 * x&lt;br /&gt;nop                    # Cannot perform any multiplier operations&lt;br /&gt;nop                    # within 2 instructions of mflo (hardware restriction)&lt;br /&gt;&lt;br /&gt;#Squaring the first part of the equation&lt;br /&gt;multu $9, $9        #square the result from the previous operation&lt;br /&gt;mflo $9                #store the result in the result register&lt;br /&gt;&lt;br /&gt;#Second part of the equation&lt;br /&gt;ori $10, $0, 5        #set reg 10 to 5&lt;br /&gt;nop                    #hardware restriction as earlier&lt;br /&gt;multu $8, $10        #multiply reg 8 (x) by reg 10 (5 atm)&lt;br /&gt;mflo $10            #store result in reg 10 temporarily&lt;br /&gt;&lt;br /&gt;#Assembling equation&lt;br /&gt;addu $9, $9, $10    #add 3x(squared) to 5x and store the result of that operation in reg 9&lt;br /&gt;ori $10, $0, 12        #temporary value for 12, which is used in the latter part of the equation&lt;br /&gt;&lt;br /&gt;#Last part of assembling the equation&lt;br /&gt;subu $9, $9, $10    #subtract 12 from the previously computed value&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As can be seen, the code is very well commented, and is quite easy to read due to this :D.  It's quite simple, and achieves the required results quite well.  If you want to see this, simply plug this code into the MARS software or SPIM and take a look at the assembly of this code.  Swiftly moving on, got loads to get through after all, we are going to take a look at question 2, which is a little more difficult than the first question, obviously lol.  The actual question is shown below:&lt;/p&gt;&lt;h2&gt;*Exercise 2&lt;/h2&gt;  &lt;p&gt; Write a program similar to &lt;code&gt;divEg.asm&lt;/code&gt; from the chapter to evaluate a rational function: &lt;/p&gt;  &lt;pre class="code"&gt;(3x+7)/(2x+8)&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; Verify that the program works by using several initial values for &lt;code&gt;x&lt;/code&gt;. Use  &lt;code&gt;x = 0&lt;/code&gt; and  &lt;code&gt;x = 1&lt;/code&gt; to start since this will make debugging easy. Try some other values, then check what happens when  &lt;code&gt;x = -4&lt;/code&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In order to complete this question, I wrote the following code shown below:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#Designed to run the following equation: (3x+7)/(2x+8)&lt;br /&gt;&lt;br /&gt;ori $8, $0, 2        #x register&lt;br /&gt;ori $9, $0, 0        #result register&lt;br /&gt;ori $10, $0, 3        #temporary store, at the moment contains the first multiplier of x&lt;br /&gt;&lt;br /&gt;#first bracket&lt;br /&gt;&lt;br /&gt;#first multiplication&lt;br /&gt;multu $8, $10        #multiplies x by 3 (contained in reg 10)&lt;br /&gt;mflo $9                #store what's in the lo register in reg 9&lt;br /&gt;&lt;br /&gt;ori $10, $0, 7        #set reg 10 to a value of 7&lt;br /&gt;addu $9, $9, $10    #add 7 (stored in reg 10) to the result of the previous op&lt;br /&gt;&lt;br /&gt;#second bracket&lt;br /&gt;&lt;br /&gt;ori $11, $0, 0        #bracket 2 result&lt;br /&gt;ori $10, $0, 2        #second multipler, 2 in reg 10&lt;br /&gt;&lt;br /&gt;#second multiplication&lt;br /&gt;multu $8, $10        #multiply x by 2&lt;br /&gt;mflo $11            #store whatever's in reg lo in reg 11&lt;br /&gt;ori $10, $0, 8        #addition in second bracket number required&lt;br /&gt;addu $11, $11, $10    #store the result of adding registers 11 and 10 in register 11&lt;br /&gt;&lt;br /&gt;#overall divide&lt;br /&gt;divu $9, $11        #Divides the two separate results.&lt;br /&gt;mflo $9                #stores the result in register 9&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Again, this code is quite well commented, and is quite simple to read.  To fully evaluate this code, simply stick this code into your assembler simulator thingy and check out the assembly of the above code.  In order to assign different values to x, simply change the first line (the initialisation of register 8) to whatever value you want x to be.  Moving on again, I didn't complete Question 3, but question 4's completed answer can be seen below:&lt;/p&gt;&lt;h2&gt;*Exercise 4&lt;/h2&gt;  &lt;p&gt; Write a program that determines the value of the following expression: &lt;/p&gt;  &lt;pre&gt;(x*y)/z&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; Use &lt;code&gt;x = 1600000&lt;/code&gt;     (=0x186A00),     &lt;code&gt;y =   80000&lt;/code&gt;     (=0x13880), and &lt;code&gt;z =  400000&lt;/code&gt;     (=61A80). Initialize three registers to these values. Since the immediate operand of the &lt;code&gt;ori&lt;/code&gt; instruction is only 16 bits wide, use shift instructions to move bits into the correct locations of the registers. &lt;/p&gt;  &lt;p&gt; Choose wisely the order of multiply and divide operations so that the significant bits always remain in the &lt;b&gt;&lt;code&gt;lo&lt;/code&gt;&lt;/b&gt; result register.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So, the solution to the above problem is demonstrated below:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#Designed to demonstrate ways around bit width for immediates and stuff&lt;br /&gt;#Does the following equation: (x*y)/z&lt;br /&gt;&lt;br /&gt;ori $8, $0, 1562            #x- 1600000- all shifted right, needs to be shifted left to be 32 bit, its shift is 10&lt;br /&gt;ori $9, $0, 78                #y- 80000- shifted right 10, needs to be shifted left to be 32 bit wide&lt;br /&gt;ori $10, $0, 390            #z- 400000- shifted right 10, needs to be shifted left to be 32 bit wide&lt;br /&gt;&lt;br /&gt;ori $11, $0, 0                #temp register&lt;br /&gt;&lt;br /&gt;multu $8, $9                #x * y&lt;br /&gt;mflo $11                    #temporarily store the result of x and y&lt;br /&gt;&lt;br /&gt;nop&lt;br /&gt;nop&lt;br /&gt;&lt;br /&gt;divu $11, $10                #divides z by the result of x * y&lt;br /&gt;mflo $11                    #stores the result in register 11&lt;br /&gt;&lt;br /&gt;sll $11, $11, 10            #shifts the binary left&lt;br /&gt;&lt;br /&gt;#end of program&lt;br /&gt;#result is almost as good as doing left shift earlier in code, but its good enough.  It's got a margin of error of&lt;br /&gt;#about 1000 or so.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The above code simply shifts a binary number right to a certain number of places, performs a function on the values, then shifts the number left again, in order to fit 32 bit calculations into 16 bit areas and stuff.  It works :D.  Again, stick this into your MIPS assembly simulator to check out the result, it's pretty cool.  Now that is the end of Chapter 14, lets move quickly onwards to Chapter 15.  This chapter is mostly about storing and loading data to and from memory and then to perform an operation, then stick the resulting data back into memory.  The first question can be seen below:&lt;/p&gt;&lt;h2&gt;Exercise 1&lt;/h2&gt;  &lt;p&gt; &lt;b&gt;Modify&lt;/b&gt; exercise 1 of the previous chapter so that the value &lt;code&gt;x&lt;/code&gt; is  in memory. Store the value of the polynomial back to memory. The program will be similary to &lt;em&gt;poly.asm&lt;/em&gt; from this chapter. Evaluate the polynomial: &lt;/p&gt;  &lt;pre class="code"&gt;3x&lt;sup&gt;2&lt;/sup&gt; + 5x - 12&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; Use symbolic addresses &lt;code&gt;x&lt;/code&gt; and  &lt;code&gt;poly&lt;/code&gt;. Assume that  the value in &lt;code&gt;x&lt;/code&gt; is small enough so that all results fit into 32 bits. Since load delays are turned on in SPIM be careful what instructions are placed in the load delay slot. &lt;/p&gt;  &lt;p&gt; Verify that the program works by using several initial values for &lt;code&gt;x&lt;/code&gt;. Use  &lt;code&gt;x = 0&lt;/code&gt; and  &lt;code&gt;x = 1&lt;/code&gt; to start since this will make debugging easy. Then try some other values, such as &lt;code&gt;x = 10&lt;/code&gt; and  &lt;code&gt;x = -1&lt;/code&gt;. &lt;/p&gt;  &lt;p&gt; &lt;b&gt;Optional:&lt;/b&gt; write the program following the hardware rule that two or more instructions must follow a &lt;code&gt;mflo&lt;/code&gt; instruction before another  &lt;code&gt;mult&lt;/code&gt; instruction. Try to put useful instructions in the two slots that follow the  &lt;code&gt;mflo&lt;/code&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In order to solve the above problem, I wrote the following code:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Evaluates the following equation&lt;br /&gt;# And also uses memory locations :D.&lt;br /&gt;# 3x(squared) + 5x - 12&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        .text&lt;br /&gt;        .globl main&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;       &lt;br /&gt;        lui $14, 0x1001            #Finds base value and stores it inside&lt;br /&gt;        lw $9, 0($14)            #Loads x into register 9&lt;br /&gt;&lt;br /&gt;        ori $10, $0, 3            #Multiplier value in reg 10&lt;br /&gt;&lt;br /&gt;        multu $9, $9            #Multiplies registers 9 by itself (x(squared))&lt;br /&gt;        mflo $11                #Stores the result in register 11&lt;br /&gt;&lt;br /&gt;        nop&lt;br /&gt;        nop&lt;br /&gt;&lt;br /&gt;        multu $11, $10            #Multiplies registers 11 and 10 together (3x)&lt;br /&gt;        mflo $12                #Stores the result in register 12&lt;br /&gt;&lt;br /&gt;        nop&lt;br /&gt;        ori $10, $0, 5            #Multiplier&lt;br /&gt;&lt;br /&gt;        multu $9, $10            #Multiplies registers 9 and 10 together (5x)&lt;br /&gt;        mflo $13                #Stores result in register 13&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        addu $11, $13, $12        #Adds 3x(squared) to 5x and stores in reg 11&lt;br /&gt;        ori $10, $0, 12            #Stores 12 in reg 10&lt;br /&gt;        subu $11, $11, $10        #Subtracts 12 from the result so far&lt;br /&gt;&lt;br /&gt;        sw $11, 4($14)            #Stores result in poly&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        .data&lt;br /&gt;x:        .word    10&lt;br /&gt;poly:    .word    0&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note: the symbollic addresses at the bottom aren't really the assembly code stuff, they're just messages to the compiler to reserve a little bit of memory and initialise some data at the default spot within MARS.  I have tested the above code quite thoroughly and am confident that it works to a sufficient level.  It's pretty awesome :).  And again, stick it into your assembly simulator to see how it performs and things :). Don't worry, you have my permission to view this code in action :P.  Anyways, swiftly moving onwards yet again.  Below is question&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Exercise 2&lt;/h2&gt;  &lt;p&gt; Evaluate the expression: &lt;/p&gt;  &lt;pre class="code"&gt;17xy - 12x - 6y + 12&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; Use symbolic addresses &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, and  &lt;code&gt;answer&lt;/code&gt;. Assume that  the values are small enough so that all results fit into 32 bits. Since load delays are turned on in SPIM be careful what instructions are placed in the load delay slot. &lt;/p&gt;  &lt;p&gt; Verify that the program works by using several initial values for &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;. Use  &lt;code&gt;x=0, y=1&lt;/code&gt; and  &lt;code&gt;x=1, y=0&lt;/code&gt; to start since this will make debugging easy. Then try some other values. As an option, follow the precaution for multiplication, as above.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To solve the above problem, I wrote the following code:&lt;/p&gt;&lt;p&gt;#Evaluates the following expression, and also uses memory :D.&lt;br /&gt;#17xy - 12x - 6y + 12&lt;br /&gt;&lt;br /&gt;        .text&lt;br /&gt;        .globl main&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;&lt;br /&gt;        lui $15, 0x1001            #Loads base into reg 15&lt;br /&gt;        lw    $9, 0($15)            #Loads x into reg 9&lt;br /&gt;        nop&lt;br /&gt;       &lt;br /&gt;        lw    $10, 4($15)            #Loads y into reg 10&lt;br /&gt;       &lt;br /&gt;        ori    $14, $0, 17            #Multiplier register init&lt;br /&gt;       &lt;br /&gt;        multu $9, $10&lt;br /&gt;        mflo $13                #Result of xy&lt;br /&gt;&lt;br /&gt;        nop&lt;br /&gt;        nop&lt;br /&gt;       &lt;br /&gt;        multu $13, $14            #Multiplies result of xy by 17&lt;br /&gt;        mflo $13                #Stores result of 17xy&lt;br /&gt;&lt;br /&gt;        nop&lt;br /&gt;        ori $14, $0, 12            #Changes multiplier to 12&lt;br /&gt;&lt;br /&gt;        multu $9, $14            #12x&lt;br /&gt;        mflo $12                #Stores result in reg 12&lt;br /&gt;&lt;br /&gt;        subu $13, $13, $12        #17xy - 12x&lt;br /&gt;&lt;br /&gt;        ori $14, $0, 6            #Multiplier changed to 6&lt;br /&gt;&lt;br /&gt;        multu $10, $14            #6y&lt;br /&gt;        mflo $12                #6y stored in reg 12&lt;br /&gt;&lt;br /&gt;        subu $13, $13, $12        #17xy - 12x - 6y&lt;br /&gt;        ori $14, $0, 12            #Multiplier changed to 12&lt;br /&gt;       &lt;br /&gt;        addu $13, $13, $14        #17xy - 12x - 6y + 12&lt;br /&gt;       &lt;br /&gt;        sw $13, 8($15)            #Stores result in answer&lt;br /&gt;&lt;br /&gt;            .data&lt;br /&gt;x:            .word    10&lt;br /&gt;y:            .word    10&lt;br /&gt;answer:        .word    0&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It's not the most efficient code in the world, however for this instance it will do :).  The results that it produces are very accurate too, try it out :D.  Oh yes, and it's also commented quite thoroughly too, to make sure that it's quite easy to understand what each line does exactly.  I'm afraid to say that I didn't attempt questions 3 or 4, because I found out by this stage that I had already been using Horner's method in some of my code and understand it quite well already :D.  To make up for this though, I will show my answers to chapter 17 questions 1 and 2.  These are displayed below:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;*Exercise 1 -- Non-ending Loop&lt;/h2&gt;  &lt;p&gt; Write a program that computes the sum: &lt;/p&gt;  &lt;pre&gt;1 + 2 + 3 + 4 + 5 + ...&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; Do this by using the &lt;code&gt;j&lt;/code&gt; instruction to implement a non-ending loop. Before the loop, initialize a register to zero to contain the sum, and initialize another register to one to be the counter. Inside the loop add the counter to the sum, increment the counter, and jump to the top of the loop. &lt;/p&gt;  &lt;p&gt; Execute the program by single-stepping (by pushing F10). After you have done this enough to confirm that the program works, look at SPIM's menu and select &lt;u&gt;S&lt;/u&gt;imulator and &lt;u&gt;M&lt;/u&gt;ultiple Step. Enter a number of steps (such as 40) into the window and click "OK". Each step is the execution of one machine cycle. Once you see how this works you can do the same thing more easily by pushing F11.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The solution to this is shown below:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Designed to be a non-ending loop&lt;br /&gt;# Calculates the sum of 1 + 2 + 3 + 4 + 5.....&lt;br /&gt;&lt;br /&gt;        .text&lt;br /&gt;        .globl init&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;init:&lt;br /&gt;        ori $8, $0, 0            #Initialises variable (reg 8) to 0&lt;br /&gt;        ori $9, $0, 0            #Loop counter&lt;br /&gt;        j main                    #Jumps to the loop :D&lt;br /&gt;        nop                        #Branch delay slot&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;        addi $9, $9, 1    #Increment reg 9(loop counter) by 1 per loop cycle&lt;br /&gt;        addu $8, $8, $9    #Add count number to reg 8&lt;br /&gt;        j main            #Jump to beginning of label "main"&lt;br /&gt;        nop                #Branch delay slot&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As can be seen, this code is simple, and quite efficient.  It, like all my code, is heavily commented, so it's quite easy to see exactly what each line does.  Take note of the "j" instruction.  This is the instruction that modifies the program counter to jump to a certain instruction label, in this case, the jumps all lead to the label "main".  Also take note of the fact that a "nop" instruction has been used in the instruction slot directly after each of the jump instructions.  This is because the instruction directly after the jump command is always executed, even though the program counter has been changed.  This is simply because it takes on machine cycle to change the program counter, so until it's been properly changed it just keeps executing the different instructions.  Moving on to question 2:&lt;/p&gt;&lt;h2&gt;*Exercise 2 -- Non-ending Loop with Overflow&lt;/h2&gt;  &lt;p&gt; Write a program that adds $8 to itself inside a non-ending loop. Initialize $8 before the loop is entered. Use the &lt;code&gt;add&lt;/code&gt; instruction so that when overflow is detected the program ends with a trap. &lt;/p&gt;  &lt;p&gt; Now change the  &lt;code&gt;add&lt;/code&gt;  instruction to &lt;code&gt;addu&lt;/code&gt;. Now when overflow occurs, nothing happens. Run the program and observe the difference.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Ok, so the solution to this is below:&lt;/p&gt;&lt;p&gt;# Overflow program :D.  Adds reg 8 to itself to cause overflow within the loop.&lt;br /&gt;&lt;br /&gt;        .text&lt;br /&gt;        .globl init&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;init:&lt;br /&gt;        ori $8, $0, 1        #Initialises variable (reg 8)&lt;br /&gt;        j main                #Jumps to main&lt;br /&gt;        nop                    #Branch delay slot&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;        addu $8, $8, $8        #Add reg 8 to itself.&lt;br /&gt;        j main                #Jump to the beginning of the loop&lt;br /&gt;        nop                    #Branch delay slot&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Ok then, so in order to change between the different version of this program, to look at the overflow trap, the "u" on addu must simply be deleted.  The current, no overflow trapped version executes the code, and then, when the value overflows, the register is set to a value of 0.  With overflow trap, the program exits and it simply stops itself.  That is the only difference, therefore add will not be a regularly used command, as most programmers want their programs to keep going.  Anyways, that is all for tonight, thanks for reading, and I hope you'll stop by this site again to read more interesting mips stuff, and also unrealscript and C++ program code.  Thanks :D.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-2966915427587910151?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/2966915427587910151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/mips-assembly-chapter-1415-kjells.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/2966915427587910151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/2966915427587910151'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/11/mips-assembly-chapter-1415-kjells.html' title='MIPS Assembly- Chapter 14/15 Kjell&apos;s Tutorials'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-666511598461429623</id><published>2009-10-23T11:32:00.000+01:00</published><updated>2009-10-23T11:35:03.441+01:00</updated><title type='text'>What's coming soon!</title><content type='html'>I've got loads of new content on this blog coming up, should have some more on over the weekend :D.  Mainly I'll have a renderer coming up at some point, but first I'll have a virtual camera class added over the weekend, and then hopefully I should have some more MIPS up too.  I'm yet to start my Famous Five map yet, just working out the details in my head, but screenies of v1.0 will be up over the next week :D.  Thanks for reading, and I hope you'll stay tuned in to this blog, lol.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-666511598461429623?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/666511598461429623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/whats-coming-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/666511598461429623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/666511598461429623'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/whats-coming-soon.html' title='What&apos;s coming soon!'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-1189713846637647057</id><published>2009-10-21T19:15:00.000+01:00</published><updated>2009-10-22T02:20:19.150+01:00</updated><title type='text'>MIPS Assembly Exercises</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/St9bUWALsiI/AAAAAAAAAGY/WzkG6I7cjvs/s1600-h/3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 241px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/St9bUWALsiI/AAAAAAAAAGY/WzkG6I7cjvs/s400/3.png" alt="" id="BLOGGER_PHOTO_ID_5395131283675001378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/St9bUEzXHKI/AAAAAAAAAGQ/fOYqNiXl-IA/s1600-h/2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 241px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/St9bUEzXHKI/AAAAAAAAAGQ/fOYqNiXl-IA/s400/2.png" alt="" id="BLOGGER_PHOTO_ID_5395131279057820834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/St9bTs4EoaI/AAAAAAAAAGI/LArIc6tcuT8/s1600-h/1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 241px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/St9bTs4EoaI/AAAAAAAAAGI/LArIc6tcuT8/s400/1.png" alt="" id="BLOGGER_PHOTO_ID_5395131272635130274" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hi,&lt;br /&gt;&lt;br /&gt;I've been doing some MIPS assembly programming recently, for a module at University called Console Development, and I've been doing some tutorials and exercises online.  This entry will cover some of those exercises, and some of the different instructions that I've been looking at.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So, what is MIPS?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;MIPS is an assembly level language used in many micro-processors in small devices and some console platforms.  MIPS chips are often found in phones, MP3 players, in the Sony PlayStation Portable, and Sony PlayStation 2.  It is the base of many games for the PlayStation 2 and stuff, as some parts of the game engines for certain games are written in Assembly code, in order to optimise and increase efficiency, although all code, at some point, is compiled into machine code.  Assembly's just closer to machine code than a high level code, like C++ or C#.&lt;br /&gt;&lt;br /&gt;A major difference with an assembly level language is that only one operation can be performed per instruction, which means that the number of lines of binary are directly proportional to the number of lines of assembly code.  Also assembly level languages use assesmblers to convert it into machine code, whereas high level languages use compilers, which do more, so the code you write in assembly looks more like the output than what the high level equivalent does.&lt;br /&gt;&lt;br /&gt;So here's some code:&lt;br /&gt;&lt;br /&gt;#Designed to demonstrate ways around bit width for immediates and stuff&lt;br /&gt;#Does the following equation: (x*y)/z&lt;br /&gt;&lt;br /&gt;ori $8, $0, 1562            #x- 1600000- all shifted right, needs to be shifted left to be 32 bit, its shift is 10&lt;br /&gt;ori $9, $0, 78                #y- 80000- shifted right 10, needs to be shifted left to be 32 bit wide&lt;br /&gt;ori $10, $0, 390            #z- 400000- shifted right 10, needs to be shifted left to be 32 bit wide&lt;br /&gt;&lt;br /&gt;ori $11, $0, 0                #temp register&lt;br /&gt;&lt;br /&gt;multu $8, $9                #x * y&lt;br /&gt;mflo $11                    #temporarily store the result of x and y&lt;br /&gt;&lt;br /&gt;nop&lt;br /&gt;nop&lt;br /&gt;&lt;br /&gt;divu $11, $10                #divides z by the result of x * y&lt;br /&gt;mflo $11                    #stores the result in register 11&lt;br /&gt;&lt;br /&gt;sll $11, $11, 10            #shifts the binary left&lt;br /&gt;&lt;br /&gt;#end of program&lt;br /&gt;#result is almost as good as doing left shift earlier in code, but its good enough.  It's got a margin of error of&lt;br /&gt;#about 1000 or so.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As can be seen from the above code, variables aren't really used, registers are used to store values instead, which is useful, lol.  The code shown above makes use of registers to temporarily hold values, and also store them for use later in the code.  None of this operation uses any of the RAM however, as no load word or store word commands are used.  Ok, so lets go through the code and see what each part of it does.  The ori command is first.  It basically means or immediate (not evil anti-ancient stargate SG1 beings lol).  It is used to store a value within a register.  The register that the value will be stored in is shown first, then the zero register is called, and finally the value is shown within the syntax.&lt;br /&gt;&lt;br /&gt;The next new command that you'll come across is the multu command, which means multiply unsigned.  This operation multiplies values stored in registers, which are unsigned binary values.  You may be confused however by the way that this operation works as the destination register is not called within the multu command.  Instead the value is stored within 2 registers, called hi and lo.  Lo stores the quotient, which is the lower portion of the number, or the significant part.  Hi stores the remainder, which is used when the value to be stored is too big to fit into just the lo register.  In order to get the value from the lo or lo register, the command mflo or mfhi is used, and the only argument this requires is the destination register.  Also when mflo or mfhi is used, no multiplication/divide instructions can be used within 2 instruction spaces after it, as it takes a moment to update whilst still keeping the program running and performing active calculations.  That is why I have used nop in certain places within this code.  It literally performs no operations, which is what it also means.  Useful for creating a blank instruction space.&lt;br /&gt;&lt;br /&gt;Finally the last major part of this code is sll, which shifts the bits to the left, in terms of their position in the binary sequence.  This increases their value.  The arguments passed into this are the destination register first, the register to be operated on or the first operand, and then the register containing a number which states how many positions to shift the binary numbers by.&lt;br /&gt;&lt;br /&gt;There is also right shift, which decreases the value of the binary number sequence, and this works in the same way.&lt;br /&gt;&lt;br /&gt;That is all for this post anyway.  I have included a few screenshots of the code in action and the results, within the MARS simulator, so I hope you have fun looking at these, and I'll be back very soon with another post, maybe containing some more MIPS assembly.&lt;br /&gt;&lt;br /&gt;Thanks for reading :D.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-1189713846637647057?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/1189713846637647057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/mips-assembly-exercises.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1189713846637647057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1189713846637647057'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/mips-assembly-exercises.html' title='MIPS Assembly Exercises'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/St9bUWALsiI/AAAAAAAAAGY/WzkG6I7cjvs/s72-c/3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-2771416723449908017</id><published>2009-10-21T00:56:00.000+01:00</published><updated>2009-10-21T01:04:56.476+01:00</updated><title type='text'>Matrix/Vector Code</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/St5QHVkE4PI/AAAAAAAAAGA/kEJa4-8yLlI/s1600-h/Matrix1TestConsole.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 202px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/St5QHVkE4PI/AAAAAAAAAGA/kEJa4-8yLlI/s400/Matrix1TestConsole.png" alt="" id="BLOGGER_PHOTO_ID_5394837490614198514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hi,&lt;br /&gt;&lt;br /&gt;This time I've decided to put up some code that I've written in C++, which is a Matrix class, and also there are some improvements on the Vector class which was shown in one of my previous posts.  This has been done mainly for Introduction to 3D Graphics Programming (a university module).  This code also times the test code for the matrix class and the vector class is only used for an incredibly small portion of this code.  That is creating a transformation matrix.  So here's some code to look over, have fun :D.&lt;br /&gt;&lt;br /&gt;MatrixApp:&lt;br /&gt;&lt;br /&gt;// MatrixApp.cpp : Defines the entry point for the console application.&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;#include "stdafx.h"&lt;br /&gt;#include "Matrix.h"&lt;br /&gt;#include "Vector.h"&lt;br /&gt;#include "conio.h"&lt;br /&gt;#include "windows.h"&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;void test_addition(int iterations);&lt;br /&gt;void test_subtraction(int iterations);&lt;br /&gt;void test_multiply(int iterations);&lt;br /&gt;void test_matrixMultiply(int iterations);&lt;br /&gt;void test_transform(int iterations);&lt;br /&gt;&lt;br /&gt;int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;{&lt;br /&gt;   int iterations = 1000000;&lt;br /&gt;&lt;br /&gt;   test_addition(iterations);&lt;br /&gt;   test_subtraction(iterations);&lt;br /&gt;   test_multiply(iterations);&lt;br /&gt;   test_matrixMultiply(iterations);&lt;br /&gt;   test_transform(iterations);&lt;br /&gt;&lt;br /&gt;   // Wait for keypress.&lt;br /&gt;   getch();&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void test_addition(int iterations)&lt;br /&gt;{&lt;br /&gt;   DWORD start;&lt;br /&gt;   DWORD finish;&lt;br /&gt;   DWORD time;&lt;br /&gt;&lt;br /&gt;   Matrix matrix1(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);&lt;br /&gt;   Matrix matrix2(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);&lt;br /&gt;&lt;br /&gt;   Matrix result;&lt;br /&gt;&lt;br /&gt;   start = GetTickCount();&lt;br /&gt;&lt;br /&gt;   for (int i = 0; i &lt; finish =" GetTickCount();" time =" finish" x =" 0;" y =" 0;" start =" GetTickCount();" i =" 0;" finish =" GetTickCount();" time =" finish" x =" 0;" y =" 0;" scalar =" 2.0;" start =" GetTickCount();" i =" 0;" finish =" GetTickCount();" time =" finish" x =" 0;" y =" 0;" start =" GetTickCount();" i =" 0;" finish =" GetTickCount();" time =" finish" x =" 0;" y =" 0;" start =" GetTickCount();" i =" 0;" finish =" GetTickCount();" time =" finish"&gt;&lt;br /&gt;#include &lt;string&gt;&lt;br /&gt;&lt;br /&gt;// Initialises all variables&lt;br /&gt;Matrix::Matrix()&lt;br /&gt;{&lt;br /&gt;   for(int x = 0; x &lt; y =" 0;" x =" 0;" y =" 0;"&gt;_m[x][y] = toCopy._m[x][y];&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Matrix::Matrix(float a, float b, float c, float d, float e, float f, float g, float h , float i, float j, float k, float l, float m, float n, float o, float p)&lt;br /&gt;{&lt;br /&gt;   _m[0][0] = a;&lt;br /&gt;   _m[1][0] = b;&lt;br /&gt;   _m[2][0] = c;&lt;br /&gt;   _m[3][0] = d;&lt;br /&gt;   _m[0][1] = e;&lt;br /&gt;   _m[1][1] = f;&lt;br /&gt;   _m[2][1] = g;&lt;br /&gt;   _m[3][1] = h;&lt;br /&gt;   _m[0][2] = i;&lt;br /&gt;   _m[1][2] = j;&lt;br /&gt;   _m[2][2] = k;&lt;br /&gt;   _m[3][2] = l;&lt;br /&gt;   _m[0][3] = m;&lt;br /&gt;   _m[1][3] = n;&lt;br /&gt;   _m[2][3] = o;&lt;br /&gt;   _m[3][3] = p;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Almost forgot to put this in, gave weird errors, even though its unused.&lt;br /&gt;Matrix::~Matrix(void)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Goes through each different addition operation required and perform, using for loops.&lt;br /&gt;void Matrix::Add(const Matrix&amp;amp; a, const Matrix&amp;amp; b, Matrix&amp;amp; c)&lt;br /&gt;{&lt;br /&gt;   for (int x = 0; x &lt; y =" 0;" x =" 0;" y =" 0;" x =" 0;" y =" 0;" x =" 0;" y =" 0;"&gt;&lt;br /&gt;&lt;br /&gt;// default constructor&lt;br /&gt;Vector::Vector(void)&lt;br /&gt;{&lt;br /&gt;   _x = 0;&lt;br /&gt;   _y = 0;&lt;br /&gt;   _z = 0;&lt;br /&gt;   _w = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// parameterised constructor&lt;br /&gt;Vector::Vector(float x, float y , float z, float w)&lt;br /&gt;{&lt;br /&gt;   _x = x;&lt;br /&gt;   _y = y;&lt;br /&gt;   _z = z;&lt;br /&gt;   _w = w;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// copy constructor&lt;br /&gt;Vector::Vector(const Vector&amp;amp; rhs)&lt;br /&gt;{&lt;br /&gt;   _x = rhs._x;&lt;br /&gt;   _y = rhs._y;&lt;br /&gt;   _z = rhs._z;&lt;br /&gt;   _w = rhs._w;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// destructor&lt;br /&gt;// Unused currently&lt;br /&gt;Vector::~Vector(void)&lt;br /&gt;{&lt;br /&gt;   // do nothing&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// assignment operator&lt;br /&gt;Vector&amp;amp; Vector::operator=(Vector&amp;amp; rhs)&lt;br /&gt;{  &lt;br /&gt;   _x = rhs._x;&lt;br /&gt;   _y = rhs._y;&lt;br /&gt;   _z = rhs._z;&lt;br /&gt;   _w = rhs._w;&lt;br /&gt;   return *this;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// ARITHMETIC OPERATIONS //------------------------------&lt;br /&gt;&lt;br /&gt;Vector Vector::Add(Vector rhs)&lt;br /&gt;{&lt;br /&gt;   // TODO: this is not correct implementation yet&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x + rhs._x;&lt;br /&gt;   result._y = _y + rhs._y;&lt;br /&gt;   result._z = _z + rhs._z;&lt;br /&gt;   result._w = _w + rhs._w;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// TODO: implement subtract&lt;br /&gt;Vector Vector::Subtract(Vector rhs)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x - rhs._x;&lt;br /&gt;   result._y = _y - rhs._y;&lt;br /&gt;   result._z = _z - rhs._z;&lt;br /&gt;   result._w = _w - rhs._w;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// TODO: implement multiply with a scalar&lt;br /&gt;Vector Vector::Multiply(float scalar)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x * scalar;&lt;br /&gt;   result._y = _y * scalar;&lt;br /&gt;   result._z = _z * scalar;&lt;br /&gt;   result._w = _w * scalar;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// TODO: implement divide with a scalar&lt;br /&gt;Vector Vector::Divide(float scalar)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x / scalar;&lt;br /&gt;   result._y = _y / scalar;&lt;br /&gt;   result._z = _z / scalar;&lt;br /&gt;   result._w = _w / scalar;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// END ARITHMETIC OPERATIONS //--------------------------&lt;br /&gt;&lt;br /&gt;// OTHER OPERATIONSN //----------------------------------&lt;br /&gt;&lt;br /&gt;float Vector::Magnitude()&lt;br /&gt;{&lt;br /&gt;   _x = _x * _x;&lt;br /&gt;   _y = _y * _y;&lt;br /&gt;   _z = _z * _z;&lt;br /&gt;   _w = _w * _w;&lt;br /&gt;   float result;&lt;br /&gt;   result = _x + _y + _z + _w;&lt;br /&gt;   result = sqrtf(result);&lt;br /&gt;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void  Vector::MakeUnit()&lt;br /&gt;{&lt;br /&gt;   float mag = Magnitude();&lt;br /&gt;   _x = _x / mag;&lt;br /&gt;   _y = _y / mag;&lt;br /&gt;   _z = _z / mag;&lt;br /&gt;   _w = _w / mag;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;float Vector::DotProduct(Vector v)&lt;br /&gt;{&lt;br /&gt;   float result;&lt;br /&gt;   return result = (_x * v._x) + (_y * v._y) + (_z * v._z);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Vector Vector::CrossProduct(Vector v)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = (_y * v._z) - (_z * v._y);&lt;br /&gt;   result._y = (_x * v._z) - (_z * v._x);&lt;br /&gt;   result._z = (_x * v._y) - (_y * v._x);&lt;br /&gt;   result._w = 1;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Setters and getters&lt;br /&gt;// sets x based on the parameter passed.&lt;br /&gt;void Vector::SetX(float x)&lt;br /&gt;{&lt;br /&gt;   _x = x;&lt;br /&gt;}&lt;br /&gt;// returns x&lt;br /&gt;float Vector::GetX()&lt;br /&gt;{&lt;br /&gt;   return _x;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Sets y based on a parameter&lt;br /&gt;void Vector::SetY(float y)&lt;br /&gt;{&lt;br /&gt;   _y = y;&lt;br /&gt;}&lt;br /&gt;// returns y&lt;br /&gt;float Vector::GetY()&lt;br /&gt;{&lt;br /&gt;   return _y;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Sets z based on the parameter passed.&lt;br /&gt;void Vector::SetZ(float z)&lt;br /&gt;{&lt;br /&gt;   _z = z;&lt;br /&gt;}&lt;br /&gt;// returns z&lt;br /&gt;float Vector::GetZ()&lt;br /&gt;{&lt;br /&gt;   return _z;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Sets w based on the float parameter&lt;br /&gt;void Vector::SetW(float w)&lt;br /&gt;{&lt;br /&gt;   _w = w;&lt;br /&gt;}&lt;br /&gt;// Returns the w aspect.&lt;br /&gt;float Vector::GetW()&lt;br /&gt;{&lt;br /&gt;   return _w;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// END OTHER OPERATIONS //--------------------------------&lt;br /&gt;&lt;br /&gt;// print&lt;br /&gt;std::ostream&amp;amp; operator&lt;&lt;(std::ostream&amp;amp; out, const Vector&amp;amp; vec) {     return out &lt;&lt; "&lt;" &lt;&lt;&gt;" &lt;&lt; std::endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Also included in this post is some screenshots of this console application at work, displaying some generic efficiency values.  Note that where it says Total Time within the screenshots, the number displayed afterwards is time in milli-seconds as its the number of ticks that the windows API has generated.  Interestingly enough, these timings are not descriptive of individual operations, instead they are of the different operations being carried out 1000000 times.&lt;br /&gt;&lt;br /&gt;Thanks for reading, I hope you've enjoyed looking at this code :D.&lt;br /&gt;&lt;/math.h&gt;&lt;/string&gt;&lt;/math.h&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-2771416723449908017?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/2771416723449908017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/matrixvector-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/2771416723449908017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/2771416723449908017'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/matrixvector-code.html' title='Matrix/Vector Code'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/St5QHVkE4PI/AAAAAAAAAGA/kEJa4-8yLlI/s72-c/Matrix1TestConsole.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-5401853558200083453</id><published>2009-10-20T20:47:00.000+01:00</published><updated>2009-10-20T20:49:22.435+01:00</updated><title type='text'>New Posts Very Soon!</title><content type='html'>Hi, I've finished working on a few pieces of code, some classes, and have begun work on a virtual camera class, as well as a MIPS assembly based array system.  It should be interesting on here for the next few days so stop by and check it out if you're interested :D.  Should also have some XNA style code, for 2D pixel shaders and things like that in HLSL, which is incredibly simple however unfortunately at the moment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-5401853558200083453?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/5401853558200083453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/new-posts-very-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/5401853558200083453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/5401853558200083453'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/new-posts-very-soon.html' title='New Posts Very Soon!'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-1917636052349197632</id><published>2009-10-16T22:04:00.000+01:00</published><updated>2009-10-16T22:12:43.015+01:00</updated><title type='text'>C++ Vector class</title><content type='html'>Hi all readers,&lt;br /&gt;&lt;br /&gt;This time I'm posting about a C++ class that I've written for a university module called Introduction to 3D Graphics.  It's a Vector class, which is quite basic, although it's still pretty cool.  I know that it's also not the best way to implement this class.  I wrote this about a week or so ago, so it's a bit of a late addition :(.&lt;br /&gt;&lt;br /&gt;So here's the code:&lt;br /&gt;&lt;br /&gt;Vector.cpp:&lt;br /&gt;&lt;br /&gt;#include "StdAfx.h"&lt;br /&gt;#include "Vector.h"&lt;br /&gt;#include &lt;math.h&gt;&lt;br /&gt;&lt;br /&gt;// default constructor&lt;br /&gt;Vector::Vector(void)&lt;br /&gt;{&lt;br /&gt;   _x = 0;&lt;br /&gt;   _y = 0;&lt;br /&gt;   _z = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// parameterised constructor&lt;br /&gt;Vector::Vector(float x, float y , float z)&lt;br /&gt;{&lt;br /&gt;   _x = x;&lt;br /&gt;   _y = y;&lt;br /&gt;   _z = z;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// copy constructor&lt;br /&gt;Vector::Vector(const Vector&amp;amp; rhs)&lt;br /&gt;{&lt;br /&gt;   _x = rhs._x;&lt;br /&gt;   _y = rhs._y;&lt;br /&gt;   _z = rhs._z;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// destructor&lt;br /&gt;Vector::~Vector(void)&lt;br /&gt;{&lt;br /&gt;   // do nothing&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// assignment operator&lt;br /&gt;Vector&amp;amp; Vector::operator=(Vector&amp;amp; rhs)&lt;br /&gt;{  &lt;br /&gt;   _x = rhs._x;&lt;br /&gt;   _y = rhs._y;&lt;br /&gt;   _z = rhs._z;&lt;br /&gt;   return *this;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// ARITHMETIC OPERATIONS //------------------------------&lt;br /&gt;&lt;br /&gt;Vector Vector::Add(Vector rhs)&lt;br /&gt;{&lt;br /&gt;   // TODO: this is not correct implementation yet&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x + rhs._x;&lt;br /&gt;   result._y = _y + rhs._y;&lt;br /&gt;   result._z = _z + rhs._z;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// TODO: implement subtract&lt;br /&gt;Vector Vector::Subtract(Vector rhs)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x - rhs._x;&lt;br /&gt;   result._y = _y - rhs._y;&lt;br /&gt;   result._z = _z - rhs._z;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// TODO: implement multiply with a scalar&lt;br /&gt;Vector Vector::Multiply(float scalar)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x * scalar;&lt;br /&gt;   result._y = _y * scalar;&lt;br /&gt;   result._z = _z * scalar;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// TODO: implement divide with a scalar&lt;br /&gt;Vector Vector::Divide(float scalar)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = _x / scalar;&lt;br /&gt;   result._y = _y / scalar;&lt;br /&gt;   result._z = _z / scalar;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// END ARITHMETIC OPERATIONS //--------------------------&lt;br /&gt;&lt;br /&gt;// OTHER OPERATIONSN //----------------------------------&lt;br /&gt;&lt;br /&gt;float Vector::Magnitude()&lt;br /&gt;{&lt;br /&gt;   _x = _x * _x;&lt;br /&gt;   _y = _y * _y;&lt;br /&gt;   _z = _z * _z;&lt;br /&gt;   float result;&lt;br /&gt;   result = _x + _y + _z;&lt;br /&gt;   result = sqrtf(result);&lt;br /&gt;&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void  Vector::MakeUnit()&lt;br /&gt;{&lt;br /&gt;   float mag = Magnitude();&lt;br /&gt;   _x = _x / mag;&lt;br /&gt;   _y = _y / mag;&lt;br /&gt;   _z = _z / mag;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;float Vector::DotProduct(Vector v)&lt;br /&gt;{&lt;br /&gt;   float result;&lt;br /&gt;   return result = (_x * v._x) + (_y * v._y) + (_z * v._z);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Vector Vector::CrossProduct(Vector v)&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;   result._x = (_y * v._z) - (_z * v._y);&lt;br /&gt;   result._y = (_x * v._z) - (_z * v._x);&lt;br /&gt;   result._z = (_x * v._y) - (_y * v._x);&lt;br /&gt;   return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// END OTHER OPERATIONS //--------------------------------&lt;br /&gt;&lt;br /&gt;// print&lt;br /&gt;std::ostream&amp;amp; operator&lt;&lt;(std::ostream&amp;amp; out, const Vector&amp;amp; vec) {     return out &lt;&lt; "&lt;" &lt;&lt;&gt;" &lt;&lt;&gt;&lt;br /&gt;&lt;br /&gt;void test_addition();&lt;br /&gt;void test_subtraction();&lt;br /&gt;void test_multiplication();&lt;br /&gt;void test_division();&lt;br /&gt;void test_dotproduct();&lt;br /&gt;void test_cross();&lt;br /&gt;&lt;br /&gt;int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;{&lt;br /&gt;   test_addition();&lt;br /&gt;   test_subtraction();&lt;br /&gt;   test_multiplication();&lt;br /&gt;   test_division();&lt;br /&gt;   test_dotproduct();&lt;br /&gt;   test_cross();&lt;br /&gt;&lt;br /&gt;   _getch();&lt;br /&gt;&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// tests addition.&lt;br /&gt;// Outputs the result.&lt;br /&gt;void test_addition()&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; "additions" &lt;&lt; std::endl;&lt;br /&gt;   std::cout &lt;&lt; "---------" &lt;&lt; std::endl;&lt;br /&gt;&lt;br /&gt;   // a&lt;br /&gt;   Vector a1(3.0f, 4.0f, 5.0f);&lt;br /&gt;   Vector a2(3.0f, 2.0f, 1.0f);&lt;br /&gt;   result = a1.Add(a2);&lt;br /&gt;   std::cout &lt;&lt; result;&lt;br /&gt;&lt;br /&gt;   // add some more tests&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// tests subtraction.&lt;br /&gt;// Outputs the result.&lt;br /&gt;void test_subtraction()&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; "subtractions" &lt;&lt; std::endl;&lt;br /&gt;   std::cout &lt;&lt; "------------" &lt;&lt; std::endl;&lt;br /&gt;&lt;br /&gt;   // a&lt;br /&gt;   Vector a1(5, 4, 3);&lt;br /&gt;   Vector a2(3, 3, 4);&lt;br /&gt;   result = a1.Subtract(a2);&lt;br /&gt;   std::cout &lt;&lt; result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// tests multiplication.&lt;br /&gt;// Outputs the result.&lt;br /&gt;void test_multiplication()&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; "multiplications" &lt;&lt; std::endl;&lt;br /&gt;   std::cout &lt;&lt; "---------------" &lt;&lt; std::endl;&lt;br /&gt;&lt;br /&gt;   //a&lt;br /&gt;   Vector a(5, 5, 5);&lt;br /&gt;   float aScalar = 2.0f;&lt;br /&gt;   result = a.Multiply(aScalar);&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// tests division.&lt;br /&gt;// Outputs the result.&lt;br /&gt;void test_division()&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; "divisions" &lt;&lt; std::endl;&lt;br /&gt;   std::cout &lt;&lt; "---------" &lt;&lt; std::endl;&lt;br /&gt;&lt;br /&gt;   //a&lt;br /&gt;   Vector a(8, 3, 6);&lt;br /&gt;   float aScalar = 2.0f;&lt;br /&gt;   result = a.Divide(aScalar);&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// tests dot product.&lt;br /&gt;// Outputs the result.&lt;br /&gt;void test_dotproduct()&lt;br /&gt;{&lt;br /&gt;   float result;&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; "Dot Product" &lt;&lt; std::endl;&lt;br /&gt;   std::cout &lt;&lt; "-----------" &lt;&lt; std::endl;&lt;br /&gt;&lt;br /&gt;   //a&lt;br /&gt;   Vector a(1,1,1);&lt;br /&gt;   Vector b(1,1,1);&lt;br /&gt;   result = a.DotProduct(b);&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; result &lt;&lt; std::endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void test_cross()&lt;br /&gt;{&lt;br /&gt;   Vector result;&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; "Cross Product" &lt;&lt; std::endl;&lt;br /&gt;   std::cout &lt;&lt; "-------------" &lt;&lt; std::endl;&lt;br /&gt;&lt;br /&gt;   //a&lt;br /&gt;   Vector a(1,1,1);&lt;br /&gt;   Vector b(1,1,1);&lt;br /&gt;   result = a.CrossProduct(b);&lt;br /&gt;&lt;br /&gt;   std::cout &lt;&lt; result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;And that's the entire class.  It runs quite slowly, so there is room for optimisation, but it does work with a really low margin of error from my tests that I've been running.  I hope you've found today's post informative.  Thanks :D.&lt;/conio.h&gt;&lt;/math.h&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-1917636052349197632?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/1917636052349197632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/c-vector-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1917636052349197632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1917636052349197632'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/c-vector-class.html' title='C++ Vector class'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-2819825923506993875</id><published>2009-10-14T12:26:00.000+01:00</published><updated>2009-10-14T12:27:27.432+01:00</updated><title type='text'>More Posts Very Soon</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Just thought I'd let you know that I've not put up all my work yet, so I'll have some more posts up very soon :D.  Thanks for reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-2819825923506993875?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/2819825923506993875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/more-posts-very-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/2819825923506993875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/2819825923506993875'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/more-posts-very-soon.html' title='More Posts Very Soon'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-1102181642988687454</id><published>2009-10-12T22:16:00.001+01:00</published><updated>2009-10-12T22:46:11.424+01:00</updated><title type='text'>UnrealEd- Resident Evil Shaft to Train</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/StOjW2u8lvI/AAAAAAAAAF0/E5mHhfzebKM/s1600-h/8.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/StOjW2u8lvI/AAAAAAAAAF0/E5mHhfzebKM/s400/8.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832791937488626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/StOjWg9blEI/AAAAAAAAAFs/pWwph1PpsPM/s1600-h/7.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/StOjWg9blEI/AAAAAAAAAFs/pWwph1PpsPM/s400/7.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832786092659778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/StOjWT21b7I/AAAAAAAAAFk/rCBMZRXu3-o/s1600-h/6.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/StOjWT21b7I/AAAAAAAAAFk/rCBMZRXu3-o/s400/6.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832782575333298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/StOiziDXzeI/AAAAAAAAAFc/JvigTxEXgBw/s1600-h/5.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/StOiziDXzeI/AAAAAAAAAFc/JvigTxEXgBw/s400/5.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832185090592226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/StOizE0CJqI/AAAAAAAAAFU/EPD_Djh31Z0/s1600-h/4.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/StOizE0CJqI/AAAAAAAAAFU/EPD_Djh31Z0/s400/4.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832177241630370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/StOiy7XSwnI/AAAAAAAAAFM/fOLH29c4zmY/s1600-h/3.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/StOiy7XSwnI/AAAAAAAAAFM/fOLH29c4zmY/s400/3.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832174705164914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/StOiyJisLhI/AAAAAAAAAFE/wVPQApitBXg/s1600-h/2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/StOiyJisLhI/AAAAAAAAAFE/wVPQApitBXg/s400/2.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832161331195410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/StOix14AuoI/AAAAAAAAAE8/T39PU4o9_U0/s1600-h/1.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/StOix14AuoI/AAAAAAAAAE8/T39PU4o9_U0/s400/1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391832156051913346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/StOhrGdLvsI/AAAAAAAAAE0/fWZjuvigi5A/s1600-h/9.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/StOhrGdLvsI/AAAAAAAAAE0/fWZjuvigi5A/s400/9.bmp" alt="" id="BLOGGER_PHOTO_ID_5391830940732079810" border="0" /&gt;&lt;/a&gt;Hi,&lt;br /&gt;&lt;br /&gt;As some of you may know I am doing a piece of work to use in a large group collection for 10% of my grade in one of my modules at university.  For those of you that didn't know, I am.  The entire of the Computer Games Programming course at the University of Derby is in two groups, Group A (The good guys) and Group B (The bad guys).  Note: group A are the good guys because I'm in group A :P.&lt;br /&gt;&lt;br /&gt;Group A (my group) have opted to model the entire of the Hive and the mansion/train line from the first resident evil film, whereas our evil counterparts (Group B) are modelling Red Dwarf.  We are also using Unreal Ed 3 with the Unreal 2 Engine.  Although this does not contain the best graphics in the world, it can produce some VERY nice effects :D.  Some of them are resource intensive, and some are not so much so, yet do produce some very nice effects.  One of the major advantages of this engine is the Unreal Script technology, as I've probably already mentioned before, but I'm not going to go into that again in this post.&lt;br /&gt;&lt;br /&gt;As can be seen from the images on the top part of this post, I have already completed a major section of this map, using textures gathered from the internet, from a CD provided with the Unreal Mastering Technologies book and with ones from the game Unreal Tournament 2004 itself.  This has produced the effects that you can see in the above images.  However I have also included several actor classes to produce a large number of effects.  The most common of these is the lighting tool, but that is an incredibly common tool to use.  Another actor class I have used is the ZoneInfo actor, which can be used to set zones up which provide certain effects.  Within this context, it produces a small amount of black fog to make the level slightly darker and more eery.&lt;br /&gt;&lt;br /&gt;Other than that I have included a variety of different other features, such as a vast quantity of static meshes, again gained from the Unreal Mastering Technologies accompanying CD and many other things.  I have used a large quantity of different sized BSP brushes which are generated by UnrealEd itself, and can 'Add' mass to the environment and surfaces, or 'Subtract' them from the game world.&lt;br /&gt;&lt;br /&gt;The main source of pride for me in this map however, is its design and its use of light, as different areas that I wanted to emphasize during gameplay are emphasized to the player through the creative use of lighting, of different brightnesses and shades.&lt;br /&gt;&lt;br /&gt;If you have any questions feel free to e-mail me at richard.pickering@hotmail.co.uk.  Thanks for reading and hope you stop by again soon :D!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-1102181642988687454?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/1102181642988687454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/unrealed-resident-evil-shaft-to-train.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1102181642988687454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1102181642988687454'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/unrealed-resident-evil-shaft-to-train.html' title='UnrealEd- Resident Evil Shaft to Train'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/StOjW2u8lvI/AAAAAAAAAF0/E5mHhfzebKM/s72-c/8.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-1526461231604908778</id><published>2009-10-10T01:00:00.000+01:00</published><updated>2009-10-10T01:17:33.100+01:00</updated><title type='text'>Game Dev Tech 2009</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Just thought I'd put yet another post up on here.  I've found myself boooored and stuff in the early hours of the mornin so I thought what the hell, I'll bore you with another little talk on programming lol.&lt;br /&gt;&lt;br /&gt;Unreal Engine is a fantastic piece of technology and software design whether you're trying to create a first person shooter, an RPG or even a flight sim type game.  It includes masses of different software modules to create an impressive, high graphics game engine.  This is why I'm so impressed that we're going to be using it in a module at uni called Game Development Techniques. :D.&lt;br /&gt;&lt;br /&gt;At first glances unreal can be extremely daunting, but after taking a second look, it soon becomes bit by bit more familiar.  The interface of UnrealEd is a scary sight for a newcomer to it, but for those already experienced in using the earlier versions of this software, it can be even more confusing.  The buttons have changed, some things have been dropped and other things added.  The main thing is to stick with it and weather the storm through re-learning quite a lot of tricks and techniques.&lt;br /&gt;&lt;br /&gt;For my assignment for Game Dev Tech I've been told that I must create a game based around the Famous Five IP, preferably an action adventure or a point and click type adventure game.  After reading the first book, and deciding that I didn't want to read any more of them, I decided on using that story as the basis for my game.  Hopefully it will be a multi-genred, high graphic, slightly schitzophrenic masterpiece, but things don't always turn out that way.  In this post I just thought I'd post a few tips for beginners to unreal engine to maybe follow to avoid some of the problems I've run into.&lt;br /&gt;&lt;br /&gt;The first problem that I've run into was in unreal scripting.  To put it plainly, I didn't want to be between applications, coding, then compiling that code, so I found out that there's a software you can use in conjunction with Visual Studio 2008 called nFringe.  If you're interested, type it into a search engine, I'm sure it will come up with a download.  Although you have to buy a licence if you want to use it commercially, this software is especially useful for non-commercial projects, such as Mutator creation for unreal games, and just scripting actor classes in general.&lt;br /&gt;&lt;br /&gt;The next problem that I ran into was with UnrealEd itself, and this was that it keeps crashing after about an hour or two of using it, but I solved this by backing up more often and now it hardly affects me at all :D.&lt;br /&gt;&lt;br /&gt;At the moment I am about two-thirds of the way towards finishing the main bulk of my level and have until Christmas to deliver the goods, so if I run into any more problems, there'll probably be another blog post or something, so watch out for that :D.  I'm sure that more problems will crop up eventually knowing my luck.&lt;br /&gt;&lt;br /&gt;Overall I think that this assignment should go well for me, and I will provide updates on this blog with screenshots and other media.  Keep an eye out and thanks for reading :D.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-1526461231604908778?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/1526461231604908778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/game-dev-tech-2009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1526461231604908778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1526461231604908778'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/game-dev-tech-2009.html' title='Game Dev Tech 2009'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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-6484199206811781145.post-835347856431822052</id><published>2009-10-09T00:07:00.000+01:00</published><updated>2009-10-09T00:37:10.679+01:00</updated><title type='text'>Harvesting System</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/Ss500HRIJMI/AAAAAAAAADE/QHywq3TgVJU/s1600-h/gatherer1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/Ss500HRIJMI/AAAAAAAAADE/QHywq3TgVJU/s400/gatherer1.jpg" alt="" id="BLOGGER_PHOTO_ID_5390374242661967042" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/Ss500pq3t4I/AAAAAAAAADM/yJzuiB0-LBk/s1600-h/gatherer2.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/Ss500pq3t4I/AAAAAAAAADM/yJzuiB0-LBk/s400/gatherer2.bmp" alt="" id="BLOGGER_PHOTO_ID_5390374251896747906" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/Ss5006orRwI/AAAAAAAAADU/3fxn_sG6U_I/s1600-h/gatherer3.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/Ss5006orRwI/AAAAAAAAADU/3fxn_sG6U_I/s400/gatherer3.bmp" alt="" id="BLOGGER_PHOTO_ID_5390374256450946818" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1Puk2oGpljk/Ss51USRd1hI/AAAAAAAAADs/AxO0b0K3FBU/s1600-h/gatherer4.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://3.bp.blogspot.com/_1Puk2oGpljk/Ss51USRd1hI/AAAAAAAAADs/AxO0b0K3FBU/s400/gatherer4.bmp" alt="" id="BLOGGER_PHOTO_ID_5390374795371992594" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/Ss501nHJcxI/AAAAAAAAADk/wA1DDE9L3ws/s1600-h/gatherer5.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/Ss501nHJcxI/AAAAAAAAADk/wA1DDE9L3ws/s400/gatherer5.bmp" alt="" id="BLOGGER_PHOTO_ID_5390374268389913362" border="0" /&gt;&lt;/a&gt;Hi,&lt;br /&gt;&lt;br /&gt;Wow, two posts in two days or so, not bad at the minute, I'm shooting them out :D.  Ok so this post is about a small system that I've set up which I'm quite proud of.  It involves one object which gathers resources from three other ones (the number can be scaled up if need be) and when the resources reach a thousand it offloads the resources at another object.  It repeats this process until there are no more resources to collect at which point it stays at the resource "refinery" and waits for more resources to appear.&lt;br /&gt;&lt;br /&gt;The images included in this post show this harvesting system.  The triangle is the harvester, and each of the circles are resources.  The resource collection point is more of an elipse shape (don't ask why I chose that shape, I just don't know, but it doesn't matter for a first try anyways :D).&lt;br /&gt;&lt;br /&gt;The first image shows how the harvester sets straight off to the 'closest' set of resources to itself using a simple algorithm to select the closest one.  When it reaches it (is at 12 pixels distance), the harvesting begins, and it takes one hundred resources per second from the resource cache.  As soon as the first is dried up it moves onto the next until it has collected one thousand resources.&lt;br /&gt;&lt;br /&gt;When it has collected one thousand resources it goes to the resource collection point to give the resources to that and transfers them at the same rate at which it gathers them.  After all of the resources are offloaded the harvester goes away to collect more resources.  And this is the cycle which this system follows.&lt;br /&gt;&lt;br /&gt;I am planning on putting this system into a strategy game of some kind, but first I am going to rethink some of its selection code; I just think it has to be a bit more refined and intelligent than it is at current.&lt;br /&gt;&lt;br /&gt;Note: the last image shows my trail particle system from the last post which I've included in this system.  Just thought I'd point that out, because I am quite proud of it :D.&lt;br /&gt;&lt;br /&gt;So to finish off, this system allows for some quite simple behaviour to be given to a game object in order for it to collect resources.  For me the best part of it is the fact that it collects the resources without me having to input anything, so I am quite proud of that.  Thanks for reading, and I'm sure I'll have something else up in the next few days.  Keep checking back if you're interested :D.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-835347856431822052?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/835347856431822052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/harvesting-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/835347856431822052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/835347856431822052'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/harvesting-system.html' title='Harvesting System'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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/_1Puk2oGpljk/Ss500HRIJMI/AAAAAAAAADE/QHywq3TgVJU/s72-c/gatherer1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-1403581744085352862</id><published>2009-10-07T17:57:00.000+01:00</published><updated>2009-10-07T19:20:46.337+01:00</updated><title type='text'>Particle System</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/SszKTXPMN6I/AAAAAAAAAAU/AhyHCSBY5AA/s1600-h/ParticleSystem2.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/SszKTXPMN6I/AAAAAAAAAAU/AhyHCSBY5AA/s400/ParticleSystem2.bmp" alt="" id="BLOGGER_PHOTO_ID_5389905288059697058" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/SszMfRAd_FI/AAAAAAAAAAc/Y-nZKOiaQHU/s1600-h/ParticleSystem1.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/SszMfRAd_FI/AAAAAAAAAAc/Y-nZKOiaQHU/s400/ParticleSystem1.bmp" alt="" id="BLOGGER_PHOTO_ID_5389907691569019986" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/SszSuNCCIBI/AAAAAAAAAAs/eooXhemwgEA/s1600-h/ParticleSystem4.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/SszSuNCCIBI/AAAAAAAAAAs/eooXhemwgEA/s400/ParticleSystem4.bmp" alt="" id="BLOGGER_PHOTO_ID_5389914545269645330" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1Puk2oGpljk/SszSth6U38I/AAAAAAAAAAk/PMhJI6eTWws/s1600-h/ParticleSystem3.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_1Puk2oGpljk/SszSth6U38I/AAAAAAAAAAk/PMhJI6eTWws/s400/ParticleSystem3.bmp" alt="" id="BLOGGER_PHOTO_ID_5389914533694595010" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/SszTxp3BbZI/AAAAAAAAAA0/mDzu7Rytv0U/s1600-h/ParticleSystem5.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/SszTxp3BbZI/AAAAAAAAAA0/mDzu7Rytv0U/s400/ParticleSystem5.bmp" alt="" id="BLOGGER_PHOTO_ID_5389915704059325842" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Puk2oGpljk/SszVQKi9UrI/AAAAAAAAAA8/U__q3rxn3cg/s1600-h/ParticleSystem6.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://4.bp.blogspot.com/_1Puk2oGpljk/SszVQKi9UrI/AAAAAAAAAA8/U__q3rxn3cg/s400/ParticleSystem6.bmp" alt="" id="BLOGGER_PHOTO_ID_5389917327741244082" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1Puk2oGpljk/SszVQg-Jg1I/AAAAAAAAABE/zJRW1a_IRkA/s1600-h/ParticleSystem7.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://2.bp.blogspot.com/_1Puk2oGpljk/SszVQg-Jg1I/AAAAAAAAABE/zJRW1a_IRkA/s400/ParticleSystem7.bmp" alt="" id="BLOGGER_PHOTO_ID_5389917333760869202" border="0" /&gt;&lt;/a&gt;This is a post detailing some of my recent work which I've been doing over the summer. :D.  The pictures which you can see above show a particle system which I've made within XNA Game Studio 3.0 using the programming language C#.&lt;br /&gt;&lt;br /&gt;There are multiple features to this particle system, including a series of different particle effects.  For instance, there are 'drone' particles which follow the tank and whizz around it like bees, explosion particles, for explosions, and trail particles which create trails behind objects.  Each of these different effects also have a fair few settings which can be changed to achieve different looks of the effects, such as having longer trails, smaller particles, etc.&lt;br /&gt;&lt;br /&gt;The next image in this blog shows the trail particles in 'neutral' position.  This means that the parent object is at a stand still, and the particles fly in every direction at random angles.  Each particle currently has a life of one second and are 'destroyed' after that time.  They are faded in on rendering and faded out by increasing their colour along with each update iteration and when they are at half their life span, they are faded out by the reverse of the previous method.&lt;br /&gt;&lt;br /&gt;The image at the top of the screen shows the actual trail in effect.  It is essentially the same as the previous method of particle creation except these aren't fired off at random angles.  They simply stay still, creating a kind of trail effect for the parent object.&lt;br /&gt;&lt;br /&gt;The next image shows another feature of my particle system in effect.  This is my 'drone' particles.  They circle and follow the tank around the screen acting as little 'follower' particles.  They could be used for a number of things within games, like healing the tank when it's damaged, or taking fire from enemy tanks within an RTS.&lt;br /&gt;&lt;br /&gt;The next image now is there to show that the 'drone' particles do not have any behaviour sub-routines or code to prevent them from overlapping, so all kinds of weird shapes form when they are created, however this three pronged shape is the most common that I have seen so far.&lt;br /&gt;&lt;br /&gt;The next image shown is a demonstration of the particles flying in unison, however across their own paths, showing the fact that each particle has its own 'AI' behaviour, even if it is incredibly low level.  It also shows that a relatively low number of particles can provide some very confusing and even overpopulated images, as there are 190 'drone' particles shown here, and my computer can handle numbers in the tens of thousands.&lt;br /&gt;&lt;br /&gt;Next on display is the 'explode' feature of the particles, in which they turn away from the tank and just accelerate away from the tank.&lt;br /&gt;&lt;br /&gt;The next two images show the explode effect.  I have included two images to show the explosion properly occur.  The first shows the first stage of the explosion, where the particles turn away from the tank and start moving.  The next image shows them accelerate away from the tank and continue off the screen.&lt;br /&gt;&lt;br /&gt;There are several features that aren't shown in the images which are included in this particle system.  The main one being that the particles resize themselves to that of the parent tank or smaller, using a recursive algorithm.  Another feature is that as many tanks as you like can be created, as long as your PC can handle it.&lt;br /&gt;&lt;br /&gt;All in all this particle system is one that I'm proud of, mainly because it was one of the first projects that I've worked on in which I took the ideas of object oriented programming and put them into practice with a game uses and stuff.  I hope you've enjoyed reading this post, and I look forward to putting more up- there'll probably be another up tomorrow :D.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-1403581744085352862?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/1403581744085352862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/particle-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1403581744085352862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/1403581744085352862'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/particle-system.html' title='Particle System'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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://4.bp.blogspot.com/_1Puk2oGpljk/SszKTXPMN6I/AAAAAAAAAAU/AhyHCSBY5AA/s72-c/ParticleSystem2.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6484199206811781145.post-6712927086910401342</id><published>2009-10-05T23:59:00.000+01:00</published><updated>2009-10-06T00:07:10.688+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='First Post'/><title type='text'>First Post!</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;My name's Richard Pickering and I'm nearly 20 years old.  I live in Dronfield in Derbyshire, and go to the University of Derby studying Computer Games Programming.  This blog is going to show off my different projects that I'm working on at any particular time, so please stop by to have a look!  Thanks for reading, and I hope you enjoy the blog in the months that follow.  Please keep checking for new content, or any content at all at the moment lol.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6484199206811781145-6712927086910401342?l=richardkennethpickering.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardkennethpickering.blogspot.com/feeds/6712927086910401342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/first-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/6712927086910401342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6484199206811781145/posts/default/6712927086910401342'/><link rel='alternate' type='text/html' href='http://richardkennethpickering.blogspot.com/2009/10/first-post.html' title='First Post!'/><author><name>Richard Pickering</name><uri>http://www.blogger.com/profile/13708686999576698109</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>
