Showing posts with label linear algebra. Show all posts
Showing posts with label linear algebra. Show all posts

24 March, 2012

Spring Break and Math Stuff

So I have finally come to spring break this semester, though it won't be much of one as I said that I would be available to work in the computer labs (which I anticipate that those labs will be empty).  It will be nice to have a little break from new information though.

On the brighter side I finally got to the section of linear algebra that helps me figure out how to do the triangular tessellations that I was hoping to construct the landscape from.  Standard Minecraft style games use the standard x = 1, y = 1, z =1 3d coordinate system, which makes a lot of sense since that is by far the easiest way to represent something in 3d.  These are known as the unit vectors and are written as = (1,0,0), y = (0,1,0), and z = (0,0,1).  There is a lot more to it, but I won't bore you with the details.  For games the screen will represent an x,y plane because well, lets face it, it is really a 2 dimensional space.  Even "3d" monitors and TVs are just a combination of 2 2d planes which creates the illusion of 3d.

So taking the height component as the y, I have figured out that y will still remain a good old 1.  The x component will need to be .5, but not on every line rather every other line.  The z component is the nasty one as it will be the square root of 3 divided by 2 instead of 1.  So my plan is to create a constant variable called DEPTH ( constants are supposed in all caps like that) which is equal to the square root of 3 divided by 2.  The z can be expressed as a number of DEPTHS, then if there is an even amount of z the x component will be the normal 1, 2 ,3 etc. but if the amount of z is odd, then x will be 1.5, 2.5, 3.5, etc...  Now I wish to clarify that this is just for finding the points which are the corners of each triblock.

Now many of you are probably thinking why not copy the cubic approach that everyone else is using, since it equates to much less work.  I guess that the answer is that I am just stubborn, that and I don't wan this to be dismissed as yet another Minecraft ripoff ( which may happen anyway, but at least I can claim that it is different).

10 February, 2012

Linear Algebra, Matrices, and 3D math

I realize that it appears that I have not made any real progress on this game for some time now.  I'm finding that there are many principles that I need to learn before trying to tackle 3D.  Part of that is math, which I have been struggling through for a little while.  I highly recommend that anyone who is interested in doing anything 3D learn about linear algebra.  A brief explanation is that it is the math that helps give the illusion of 3D on a 2D surface (like your TV or monitor).  Anyway the learning process is slow as I'm not as young as in times past.  As I have said before this will take a long time, especially since I want to do it right.