From 70fc02258c605aa02abab3bce786c672aaa561ab Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 2 Nov 2023 12:42:46 -0700 Subject: [PATCH] add dirt box to bottom of street --- src/aframe-streetmix-parsers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 48ea31743..edf365a6a 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -1113,6 +1113,17 @@ function processSegments (segments, showStriping, length, globalAnimated, showVe // append the new surfaceElement to the segmentParentEl streetParentEl.append(segmentParentEl); } + // create new brown box to represent ground underneath street + let dirtBox = document.createElement('a-box'); + const xPos = cumulativeWidthInMeters / 2; + console.log('xPos', xPos) + console.log('`${xPos} -1.1 0`', `${xPos} -1.1 0`) + dirtBox.setAttribute('position', `${xPos} -1.1 0`); // what is x? x = 0 - cumulativeWidthInMeters / 2 + dirtBox.setAttribute('height', 2); // height is 2 meters from y of -0.1 to -y of 2.1 + dirtBox.setAttribute('width', cumulativeWidthInMeters); + dirtBox.setAttribute('depth', length - 0.2); // depth is length - 0.1 on each side + dirtBox.setAttribute('material', 'color: #664B00;'); + streetParentEl.append(dirtBox); return streetParentEl; } module.exports.processSegments = processSegments;