Test Cube ISO Projection w Linear Texture Mapping

Channel:
Subscribers:
531
Published on ● Video Link: https://www.youtube.com/watch?v=8FGs5Gjr3LA



Duration: 1:00
12 views
0


Javascript Canvas test. I'm trying to get my 3D coordinates to match up
to 128x64 tiles for an isometric renderer. The basic projection formulas are
listed below. Zbuffering here : https://www.youtube.com/watch?v=6HZB1H9mAZM

px = each.x * 0.5; //scale original values from a 128x128x128 3D cube
py = each.y * 0.5;
pz = each.z * 0.5;

nx_x = viewport.centerx + px;
nx_y = viewport.centery + px * 0.5;

nz_x = nx_x + pz;
nz_y = nx_y - pz * 0.5;

//final pixel location on screen. 0,0,0 is at cx cy
screen.x = nz_x;
screen.y = nz_y + py;