Skip to content

Commit

Permalink
add dirt box to bottom of street
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed Nov 2, 2023
1 parent 8c40c30 commit 70fc022
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/aframe-streetmix-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 70fc022

Please sign in to comment.