4. An equivalent of FF6 style Mode 7 works with no slow down (thanks to Fat Cerberus)
Quote from: Rhuan on August 19, 2017, 12:26:46 pm4. An equivalent of FF6 style Mode 7 works with no slow down (thanks to Fat Cerberus)I guess that means you figured out the projection matrices.
If you're doing a 3D projection then the Z coordinate affects how close or far away the vertex is from the screen, extending from zero (the camera "lens") to negative-infinity. Anything outside of the Z clipping distances (defined by the near and far parameters of project3D) won't be rendered. That's why there's a Z translation just before the projection in my example.Note: Anything with positive Z will be clipped by definition because it lies "behind" the camera.In any case, good that you got it working at least. 3D is hard.
var file = OpenRawFile("output.txt",true);var avgs = [0,0,0,0];for(var i = 0; i < m_render_times.length; ++i){ avgs[0] += (m_render_times[i] / m_render_times.length); avgs[1] += (s_render_times[i] / s_render_times.length); avgs[2] += (m_update_times[i] / m_update_times.length); avgs[3] += (s_update_times[i] / s_update_times.length);}file.write(CreateByteArrayFromString("average m_r = " + avgs[0] + "\n average s_r = " + avgs[1] + "\n average m_u = " + avgs[2] + "\n average s_u = " + avgs[3]));file.close();
// [snip: calculate averages]FS.writeFile("~/output.txt", "average m_r = " + avgs[0] + "\n average s_r = " + avgs[1] + "\n average m_u = " + avgs[2] + "\n average s_u = " + avgs[3]);
Just skimming real quick, I came across this bit of ugly Sphere v1 code: