I'm very close to getting something "playable" but I've run into a problem that I just can't seem to fix.
Here's what my rendered looked like:
Okay, but see that perspective is VERY wrong. It's especially obvious when turning as everything gets a very funnel/spiral distortion. So I want to correct this. What I need to do is make the render shrink as it nears the horizon. Sounded easily enough but I just can't seem to get it to work. I ended up with ONE result that works
perfectly, visually, but with the sideeffect of... flipping the view vertically.
I desperately need to figure this out. That view is perfect, especially when you're moving. Everything is normalized great, but I just can't get the view oriented right.
Here is the portion of the script that deals with the positioning of the vertices:
PHP Code:
for (temp.p= 0;p<4;p++) {
// Rotate vertices
vert_px[p] = (vert_x[p] * cos(this.cam.angle)) - (vert_y[p] * sin(-this.cam.angle));
vert_py[p] = (vert_x[p] * sin(-this.cam.angle)) + (vert_y[p] * cos(this.cam.angle));
// Stretch horizontal view as it nears the camera
vert_px[p] *= ((vert_py[p]+(screenheight/1.5))/256);
// Problem line. This is what's currently rendering the distance, but also flipping the render
vert_py[p] *= abs(vert_py[p])/-screenheight;
// Orient new render to center of viewing
vert_px[p] += screenwidth/2;
vert_py[p] += screenheight;
}
Any help from you math guys would be awesome.