
! Thanks, I was quite impressed with it when things started working a little earlier too.

!
I know, it's a little disorientating when your digging around down there and you get stuck tryna find the way back or something.
Hopefully when I sort out some better lighting and the looking straight up/down problems it'll flow a little better.
First though if anyone reading this thinks they know a better way to raycast from 1 point in a 3D matrix at an angle in the matrix to find the first collision point that
doesn't involve using a for loop to test each square along a line, please tell me. - I'm desperately looking for a faster way to do my raycasts. - My PC struggles when I switch it to high detail mode because 2400 for loops all of about 500 odd lines each (i.e. 1200000 lines of code) tends to slow my PC down a little bit.
I know there's a way to do the intersection of a line to a plane, but this would be the intersection of a line to a point. (And those points can be thought of as filling space so they'd almost become boxes.)
EDIT:
Wow, I just gained like 5FPS on high-detail mode by pre-calculating the value of pi/180 for all the conversions from degrees to radians the math's library requires you to use.
Still don't know how to solve this looking down problem. - It seems when you're looking directly down, you're actually looking at 45 degrees because all holes you dig will be diagonal; it just seems to stretch the last voxels so you can't see what's directly underneath you.
For anyone wishing to see the code I'm using for raycasts in order to help with this problem, or the one further up about more efficient raycasts, here's the raycasting method I'm using to do all the rendering:
// Cast a ray based on a start point and an angle
private double rayCastAng(int sx,int sy,int sz,double xangle,double yangle)
{
xangle=xangle*radVal;
yangle=yangle*radVal;
float dx=(float)Math.sin(xangle);
float dy=(float)Math.cos(xangle);
float dz=(float)Math.cos(yangle);
int ray,castx,casty,castz;
byte testing;
return1=0;
for(ray=0;ray<512;ray++)
{
castx=(sx+(int)(ray*dx));
casty=(sy+(int)(ray*dy));
castz=(sz+(int)(ray*dz));
if(castx<1024&&casty<1024&&castz<128&&castx>-1&&casty>-1&&castz>-1)
{
testing=bsp[castx][casty][castz];
if(testing>0)
{
return1=testing;
break;
}
}
}
return ray;
}