Saturday, August 13, 2016

the array

Writing now of

an array of points

P1, P2, ... Pn where P = (xp, yp, zp).

They describe - are arranged into - a rectangle, A

w = number of columns

h = number of rows

c = column number

r = rownumber

xp = getxp(r, c)
yp = getyp(r, c)
zp = getzp(r, c).


In order to maximally simplify our calculation let us say that A is on the x - y axial plane, P0 is on the origin, it is (0, 0, 0), c and r increase incrementally by units of 1. Calculate the center point of A. A.C.x = w / 2; A.C.y = h / 2. Point E: .x = A.C.x; .y = A.C.y; .z = - (w / 2).


for (r == 0; r < w; r = r + 1) {dorow(r)}
dorow(r): {for (c == 0; c < h; c = c + 1) {p = r;c; dopoint(P)}

dopoint(E,P): {
if ((E.x - P.x) == 0: {colorpixel(nocolor)}; {colorPixel(
L.mxy =  (E.y - P.y) / (E.x - P.x); L.mxz = (E.z - P.z) / (E.x - P.x)
L.b.x = solvefor(b.x, L.mxz = (E.z - 0) / (E.x - b.x))
L.b.y = solvefor(b.y, L.mxy = (E.y - b.y) / (E.x - b.x)))
colorPixel(L)}}