Skip to content

Commit

Permalink
Flatten sensor visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
hobinjk-ptc committed Jun 12, 2024
1 parent bb73066 commit bd1ee92
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/spatialSensor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,29 +210,31 @@ function updateSensorPosition() {
function makeSpatialSensor() {
let group = new THREE.Group();
// Should be 0.8 2 0.8
let geo = new THREE.BoxGeometry(sensorWidth * mToUnit, sensorHeight * mToUnit, sensorDepth * mToUnit);
let geo = new THREE.PlaneGeometry(sensorWidth * mToUnit, sensorDepth * mToUnit);
let mat = new THREE.MeshBasicMaterial({
color: sensorColor,
opacity: 0.3,
transparent: true,
});
let obj = new THREE.Mesh(geo, mat);
obj.position.x = 0;
obj.position.y = sensorHeight / 2 * mToUnit;
obj.position.y = 0;
obj.position.z = 0;
obj.rotateX(Math.PI / 2);
sensorMesh = obj;
group.add(obj);

geo = new THREE.BoxGeometry(sensorWidth * mToUnit, sensorHeight * mToUnit, sensorDepth * mToUnit);
geo = new THREE.PlaneGeometry(sensorWidth * mToUnit, sensorDepth * mToUnit);
mat = new THREE.MeshBasicMaterial({
color: sensorColor,
wireframe: true,
});
obj = new THREE.Mesh(geo, mat);
sensorWireframe = obj;
obj.position.x = 0;
obj.position.y = sensorHeight / 2 * mToUnit;
obj.position.y = 0;
obj.position.z = 0;
obj.rotateX(Math.PI / 2);
group.add(obj);

// note: sensor gets added to mainContainerObj, which is positioned at the anchor
Expand Down

0 comments on commit bd1ee92

Please sign in to comment.