diff --git a/src/engine/r_camera.ts b/src/engine/r_camera.ts index bd58199..139e0d0 100644 --- a/src/engine/r_camera.ts +++ b/src/engine/r_camera.ts @@ -152,7 +152,7 @@ // // R_UpdateCamera - // Update the orientation and the position of the camera in world-space + // Update the orientation and the position of the camera in world space // function R_UpdateCamera (mult: number): void { diff --git a/src/engine/r_draw.ts b/src/engine/r_draw.ts index 88c0ca1..d35f601 100644 --- a/src/engine/r_draw.ts +++ b/src/engine/r_draw.ts @@ -586,7 +586,7 @@ if (lx !== undefined && ly !== undefined && lz !== undefined) lightLevel = lx * nXUnit + ly * nYUnit + lz * nZUnit; /* draw a single pixel in screen-space sampled from the - * perspective-corrected texture-space + * perspective-corrected texture space */ const sampleIndex = (sY * texWidth + sX) << 2; const sampleRed = bitmap[sampleIndex]; @@ -639,7 +639,7 @@ let topX = ax, topY = ay; let midX = bx, midY = by; let bottomX = cx, bottomY = cy; - /* coordinates of the triangle in perspective-corrected texture-space */ + /* coordinates of the triangle in perspective-corrected texture space */ let topC = ac / aw, midC = bc / bw, bottomC = cc / cw; let topU = au * topC, topV = av * topC; let midU = bu * midC, midV = bv * midC; @@ -761,11 +761,11 @@ let xUpper = preStepFromTop * stepXAlongUpper + topX; let xLower = preStepFromMid * stepXAlongLower + midX; let xMajor = preStepFromTop * stepXAlongMajor + topX; - /* current `u` coordinates in perspective-correct texture-space */ + /* current `u` coordinates in perspective-correct texture space */ let uUpper = preStepFromTop * stepUAlongUpper + topU; let uLower = preStepFromMid * stepUAlongLower + midU; let uMajor = preStepFromTop * stepUAlongMajor + topU; - /* current `v` coordinates in perspective-correct texture-space */ + /* current `v` coordinates in perspective-correct texture space */ let vUpper = preStepFromTop * stepVAlongUpper + topV; let vLower = preStepFromMid * stepVAlongLower + midV; let vMajor = preStepFromTop * stepVAlongMajor + topV; @@ -773,19 +773,19 @@ let cUpper = preStepFromTop * stepCAlongUpper + topC; let cLower = preStepFromMid * stepCAlongLower + midC; let cMajor = preStepFromTop * stepCAlongMajor + topC; - /* current `nx` coordinates in perspective-correct world-space */ + /* current `nx` coordinates in perspective-correct world space */ let nXUpper = preStepFromTop * stepNXAlongUpper + topNX; let nXLower = preStepFromMid * stepNXAlongLower + midNX; let nXMajor = preStepFromTop * stepNXAlongMajor + topNX; - /* current `ny` coordinates in perspective-correct world-space */ + /* current `ny` coordinates in perspective-correct world space */ let nYUpper = preStepFromTop * stepNYAlongUpper + topNY; let nYLower = preStepFromMid * stepNYAlongLower + midNY; let nYMajor = preStepFromTop * stepNYAlongMajor + topNY; - /* current `nz` coordinates in perspective-correct world-space */ + /* current `nz` coordinates in perspective-correct world space */ let nZUpper = preStepFromTop * stepNZAlongUpper + topNZ; let nZLower = preStepFromMid * stepNZAlongLower + midNZ; let nZMajor = preStepFromTop * stepNZAlongMajor + topNZ; - /* current `nw` coordinates in perspective-correct world-space */ + /* current `nw` coordinates in perspective-correct world space */ let nWUpper = preStepFromTop * stepNWAlongUpper + topNW; let nWLower = preStepFromMid * stepNWAlongLower + midNW; let nWMajor = preStepFromTop * stepNWAlongMajor + topNW; @@ -930,7 +930,7 @@ /* determine how bright & translucent the image is going to be drawn */ const ALPHA = alpha !== undefined ? alpha : 1; const LIGHT_LEVEL = lightLevel !== undefined ? lightLevel : 1; - // 1 step in screen-space equals how many steps in texture-space + // 1 step in screen-space equals how many steps in texture space const scaleX = sw / dw, scaleY = sh / dh; // raster clipping: clip the screen coordinates against the bounds of // the buffer @@ -947,29 +947,29 @@ */ const preStepFromLeft = dStartX + 0.5 - dx; const preStepFromTop = dStartY + 0.5 - dy; - /* where to start sampling in the texture-space */ + /* where to start sampling in the texture space */ const sampleStartX = preStepFromLeft * scaleX + sx; const sampleStartY = preStepFromTop * scaleY + sy; - let sampleY = sampleStartY; // current `y` coordinate in texture-space + let sampleY = sampleStartY; // current `y` coordinate in texture space for (let y = dStartY; y < dEndY && y < SCREEN_H; ++y) { const imgY = Math.floor(sampleY); // skip drawing this scanline if we're not yet within the bounds of - // the texture-space along the y-axis + // the texture space along the y-axis if (imgY < 0) { sampleY += scaleY; continue; } // stop drawing any further scanlines if we've gone out-of-bounds in - // the texture-space along the y-axis + // the texture space along the y-axis else if (imgY >= imgHeight) break; - // current `x` coordinate in texture-space + // current `x` coordinate in texture space let sampleX = sampleStartX; for (let x = dStartX; x < dEndX && x < SCREEN_W; ++x) { const imgX = Math.floor(sampleX); // skip drawing this pixel if we're not yet within the bounds of - // the texture-space along the x-axis + // the texture space along the x-axis if (imgX < 0) { sampleX += scaleX; continue; } // stop drawing any further pixels if we've gone out-of-bounds - // in the texture-space along the x-axis + // in the texture space along the x-axis else if (imgX >= imgWidth) break; const sampleIndex = (imgY * imgWidth + imgX) << 2; const sampleRed = bitmap[sampleIndex]; diff --git a/src/engine/r_geometry.ts b/src/engine/r_geometry.ts index 60efb25..33c1dfb 100644 --- a/src/engine/r_geometry.ts +++ b/src/engine/r_geometry.ts @@ -386,7 +386,7 @@ /* ...the same goes for the vertex normals */ clippedTriVertexNormalQueue[0] = Tri3(nInside[0], nInside[1], nInside[2]); - // ...the same goes for the vertices in the texture-space + // ...the same goes for the vertices in the texture space clippedUvMapQueue[0] = Tri3(uvInside[0], uvInside[1], uvInside[2]); /* the vertices that fall inside the near-clipping plane form a quad, * triangulate it by forming an additional triangle and save that in the @@ -398,7 +398,7 @@ /* ...the same goes for the vertex normals */ clippedTriVertexNormalQueue[1] = Tri3(nInside[2], nInside[3], nInside[0]); - // ...the same goes for the vertices in the texture-space + // ...the same goes for the vertices in the texture space clippedUvMapQueue[1] = Tri3(uvInside[2], uvInside[3], uvInside[0]); } diff --git a/tools/obj.js b/tools/obj.js index d1f79f0..0641519 100644 --- a/tools/obj.js +++ b/tools/obj.js @@ -131,7 +131,7 @@ function ObjToTmp3D (pathToObj, pathToMtl, outputFilename, zOffset) { case "v": // vertex { - const vertex = tokens.slice(1); // world-space coordinates + const vertex = tokens.slice(1); // world space coordinates /* rotate the vertex read around the x-axis by π radians as the * +y axis in Tmp3D point down whereas in Blender it points up */ @@ -144,7 +144,7 @@ function ObjToTmp3D (pathToObj, pathToMtl, outputFilename, zOffset) } case "vt": // texture vertices { - const uv = tokens.slice(1); // texture-space coordinates + const uv = tokens.slice(1); // texture space coordinates // flip the `v` coordinate, as it points up in Blender but down // in Tmp3D uvVertices.push([parseFloat(uv[0]), 1 - parseFloat(uv[1])]);