Tuesday, February 26, 2013

More Isometric?

Okay, so hopefully last issue with my isometric view and textures.  The texture files feature stuff that is drawn in a diamond shape... essentially exactly what you want to see on the screen should be what the texture looks like.  This also lets me ask artists to draw something and when they go "what are the restrictions?" then I call them artist-style stuff like "I want 64x64 png with transparent background, and you can't draw outside the diamond inside the box".  That last restriction is for technical reasons but one that artists can handle.

So what's the issue now?  The x-axis rotation that I didn't account for in my previous attempts at spewing stuff onto the screen.  When you angle the camera "downwards" by 30 degrees, everything looks more squished.  That's how you get that nice rhombus appearance.

But then my textures are also squished.  D:

Let's look at the problem sideways.  Literally:

The top two corners of the square are rotated back in the z-plane.  In order to counteract this, I rotate the top corners of the square "upward".  From the diagram you can see that the calculation involves a simple triangle.  If I were a calculus professor, I would say "Obviously".

Obviously, the value of z is determined by this equation (remembering that the length of the side of the square was square root of 2):

cos60 = z / sqrt(2)
z = sqrt(2) / 2

I offset the top corners and then bam it is good.

Not that much has changed but I did get three new textures courtesy of a man named z00t, but these were just something he whipped up in a few minutes for me until he can make real textures.  I also drew people!  I intend the game to have stone age humans, elves and ogres but for now, here are some humans.


1 comment:

  1. Who is this 'z00t'? The mysterious man who disarms his foes as easily as he 'disarms' the women!

    ReplyDelete