Restore WebGL control overlay and page grid
This commit is contained in:
@@ -9,6 +9,7 @@ export const PROCEDURAL_BOOK = {
|
||||
PAGE_WIDTH: 2.24 * 2 / 3,
|
||||
COVER_DEPTH: 2.30,
|
||||
OPEN_SEAM_GAP: 0.003,
|
||||
PAGE_TEXTURE_FORE_EDGE_INSET_RATIO: 0.075,
|
||||
PROFILE: {
|
||||
tableY: 0,
|
||||
coverThickness: 0.03,
|
||||
@@ -569,7 +570,8 @@ function createLoftedLineBody(model, lines, depth) {
|
||||
const pageDistance = side > 0
|
||||
? point.x - model.spineHalf
|
||||
: -model.spineHalf - point.x;
|
||||
const pageU = THREE.MathUtils.clamp(pageDistance / model.pageWidth, 0, 1);
|
||||
const textureInset = model.pageWidth * PROCEDURAL_BOOK.PAGE_TEXTURE_FORE_EDGE_INSET_RATIO;
|
||||
const pageU = THREE.MathUtils.clamp(pageDistance / Math.max(0.001, model.pageWidth - textureInset), 0, 1);
|
||||
return {
|
||||
u: side < 0 ? 1 - pageU : pageU,
|
||||
v: 1 - ((z + depth * 0.5) / depth)
|
||||
|
||||
Reference in New Issue
Block a user