Skip to content

Commit

Permalink
pcd: Fix color = 0 after loading (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
namndtth authored and ibgreen committed Aug 8, 2020
1 parent b5c795c commit 55595db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/pcd/src/lib/parse-pcd.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ function parsePCDASCII(PCDheader, textData) {
if (offset.rgb !== undefined) {
const c = new Float32Array([parseFloat(line[offset.rgb])]);
const dataview = new DataView(c.buffer, 0);
color.push(dataview.getUint8(0) / 255.0);
color.push(dataview.getUint8(1) / 255.0);
color.push(dataview.getUint8(2) / 255.0);
color.push(dataview.getUint8(0));
color.push(dataview.getUint8(1));
color.push(dataview.getUint8(2));
}

if (offset.normal_x !== undefined) {
Expand Down Expand Up @@ -220,9 +220,9 @@ function parsePCDBinary(PCDheader, data) {
}

if (offset.rgb !== undefined) {
color.push(dataview.getUint8(row + offset.rgb + 0) / 255.0);
color.push(dataview.getUint8(row + offset.rgb + 1) / 255.0);
color.push(dataview.getUint8(row + offset.rgb + 2) / 255.0);
color.push(dataview.getUint8(row + offset.rgb + 0));
color.push(dataview.getUint8(row + offset.rgb + 1));
color.push(dataview.getUint8(row + offset.rgb + 2));
}

if (offset.normal_x !== undefined) {
Expand Down

0 comments on commit 55595db

Please sign in to comment.