Before I go..

A quick guide to some of the fundamental math behind 3D programming. I won't explain to much as there is plenty of information on the net.

BTW a great article I found explaining the co-ordinate system.

http://creators.xna.com/Headlines/whitepapers/archive/2007/04/26/Shader-Series-supplemental-article-_1320_-Coordinate-systems.aspx

Tips:

1. Vectors:

What is a vector? simple its a point from a origin. Imagine a world with your axis, lets take the 0,0 (or in 3D 0,0,0) as the origin. When we create a new vector we are creating a point a certain distance away from that origin, so (5,2) is a vector 5,2 from the origin.

It is important to grasp this as we may want to manipulate a vector. Imagine we have two vectors in the world, (3,5) and (8,-1). They are both specifying a distance away from the origin, however what if we wanted (3,5) to be a distance away from the other point (8,-1)? Easy, we subtract (8,-1) from (3,5) we are now left with a vector that does just what we want.

2. Matrices

Transforming a point - When we transform a point we are applying one or more transformation matrice to a set of verticies. The order that we apply them in will affect the result.

Rotating a point (vector) - When we rotate a point we are rotating it around the origin, so if a point(vector) is for example (4,2) from the origin then when we rotate it it will be rotated as if orbiting this origin, thus if we want to rotate an object (like a spinning top) and not have it orbiting we need to move this object via translation to the origin, so -(4,2), then apply our rotation, then move the point back to its original position (4,2)
Read more

Bye bye XNA hello Silverlight

Hi all,

Reluctantly I have decided to stop blogging on XNA and instead concentrate on Silverlight.

I have found XNA to be a great framework to get your feet wet in the big wide world of game programming, however creating a substantial game still takes a very long time to complete.

As such I have decided to concentrate on simpler web based flash type games utilising the power of Silverlight.

As I come to learn more I will start up a new blog so keep an eye out for silverlight4noobs ;-)



Read more

Drawing primitives with game components

For anyone drawing with primitives in their main draw class and a game components draw class make sure that you set the verticies and indicies on the graphics device in each draw class as the graphics device is shared:

graphics.GraphicsDevice.Vertices[0].SetSource(vertexBuffer, 0, VertexPositionNormalTexture.SizeInBytes);

graphics.GraphicsDevice.Indices = indexBuffer;
graphics.GraphicsDevice.Indices.SetData(indices);


otherwise you may be wondering why your objects are not being drawn how you intended.
Read more

Simple collision detection


Image source - http://news.bbc.co.uk

Thought this might come in handy for anyway wanting to test their code with some very basic collision detecion, it's by no means particulary accurate but is very simple to implement.

Click on image to view - you will be redirected to the image on imageshack - as blogger does not let you format code nicely ;-)

XNA simple collision detection code

After having a little look with Reflector it seems that when a .fbx model is compiled into a .xnb file that it automatically works out a BoundingSphere for that mesh, storing the information in the .xnb file. Then when creating a model and its subsequent meshes the ContentManager sets the BoundingSphere of that mesh to the value found in the .xnb file.

In my case I was using the spaceship model from the starter kit which only has one mesh. The BoundingSphere is rather large and so the spaceship only had to be in close proximity to the other and it detected it as a collision.
Read more

SOFTIMAGE|XSI Mod Tool - Free pro tool for XNA

FYI any budding modellers out there may be interested in "SOFTIMAGE|XSI Mod Tool" a free 400mb modeling and animation package that integrates straight into XNA (and Half-Life 2).

link to software:
http://www.softimage.com/products/modtool/default.aspx


Source - http://en.wikipedia.org/wiki/Softimage_XSI
Read more

The next step

Welp in the midst of dreaming up gigantic projects to tackle I have instead taken the sensible choice of taking my line of sight system into the third dimension :-) ...keep an eye out.. hmm donuts

Edit: Well maybe not that sensible, unhappy with just using bounding spheres I will attempt ObjectOrientedBoundingBoxes.. potentily involving some scary maths :-) hehe

Source - http://math.sfsu.edu/beck/images/simpsons.math.gif
Read more

It's here!!


Well the time has come where I have finished my XNA line of sight demo :D. You can find it at http://www.codeplex.com/XNAlineofsight
I intend to publish a utility tool that creates the vertice arrays for anyone using the source code. Also I will publish a tutorial that will explain in depth the code. Hope you enjoy
Read more

Line Of Sight demo video

Not long now ;-) I am still playing around with my code at the moment. I plan on adding some functionality to allow the user to drag around objects etc so for the mean time I have uploaded a video of what I have so far done. Note the bottom right square is what we are trying to see, and if we spot it then the screen background turns red :-)

Read more

Blog look and feel nearly complete

Well here it is - a complete queer eye make over for this blog. I still may tweak a few of the graphics in time but for the most part it's done. Please let me know what you think via the online poll!
Read more

Line of sight update

horray, I have the line of sight functioning correctly now. All that is remaining is to test it out a bit more and optimise some of the code :-)
Read more

Blog currently in development

Status: In Development

Aims:

  • To help those who are brand new to the world of game programming using XNA
  • To provide tutorials that clearly explain what is going on
  • Provide theory behind the programming
  • Provide math bridging tutorials
  • Share my learnings and creations

Coming Up:

  • Creating a sprite line of sight algorithm and XNA code for it
  • Reworking the look and feel of this blog :-)
Read more