Added normals to viz
@@ -165,15 +165,19 @@ function create_tracked_object(info) {
if (info.config && info.config.lighthouse_config) {
for (var idx in info.config.lighthouse_config.modelPoints) {
var p = info.config.lighthouse_config.modelPoints[idx];
- var color = 0xFFFFFF; // / info.points.length * idx;
- if (idx === 10)
+ var pn = info.config.lighthouse_config.modelNormals[idx];
+ var color = idx / info.config.lighthouse_config.modelPoints * 0xFFFFFF;
+ if (idx === 6)
color = 0x00ff00;
- if (idx === 12)
- color = 0x0000ff;
var sensorMaterial = new THREE.MeshBasicMaterial({color : color});
var newSensor = new THREE.Mesh(sensorGeometry, sensorMaterial);
newSensor.position.set(p[0], p[1], p[2]);
+ var normalGeom = new THREE.Geometry();
+ normalGeom.vertices.push(newSensor.position,
+ new THREE.Vector3(p[0] + pn[0] * .02, p[1] + pn[1] * .02, p[2] + pn[2] * .02));
+ var normal= new THREE.Line(normalGeom, new THREE.LineBasicMaterial({color : idx == 6 ? 0xFF0000 : 0x00FF00}));
+ group.add(normal);
group.sensors[idx] = sensorMaterial;
group.add(newSensor);
}
