diff --git a/src/xrt/auxiliary/util/u_distortion_mesh.c b/src/xrt/auxiliary/util/u_distortion_mesh.c index 102281cfb..ef56bd2bb 100644 --- a/src/xrt/auxiliary/util/u_distortion_mesh.c +++ b/src/xrt/auxiliary/util/u_distortion_mesh.c @@ -143,7 +143,7 @@ u_compute_distortion_vive(struct u_vive_values *values, float u, float v, struct float r2 = m_vec2_dot(texCoord, texCoord); float d_inv = - ((r2 * val.coefficients[2][i] + val.coefficients[1][i]) * r2 + val.coefficients[0][i]) * r2 + 1.0; + ((r2 * val.coefficients[i][2] + val.coefficients[i][1]) * r2 + val.coefficients[i][0]) * r2 + 1.0; float d = 1.0 / d_inv; struct xrt_vec2 offset = {0.5, 0.5}; diff --git a/src/xrt/drivers/ohmd/oh_device.c b/src/xrt/drivers/ohmd/oh_device.c index 047dc83d7..956703072 100644 --- a/src/xrt/drivers/ohmd/oh_device.c +++ b/src/xrt/drivers/ohmd/oh_device.c @@ -628,6 +628,7 @@ oh_device_create(ohmd_context *ctx, ohmd_device *dev, const char *prod) ohd->distortion.vive[1].center[2].x = -0.08933516629552526f; ohd->distortion.vive[1].center[2].y = -0.006014565287238661f; + //! @todo These values are most likely wrong, needs to be transposed and correct channel. // left // green ohd->distortion.vive[0].coefficients[0][0] = -0.188236068524731f; diff --git a/src/xrt/drivers/survive/survive_driver.c b/src/xrt/drivers/survive/survive_driver.c index cd3f8a633..2b2d5292a 100644 --- a/src/xrt/drivers/survive/survive_driver.c +++ b/src/xrt/drivers/survive/survive_driver.c @@ -902,7 +902,7 @@ _get_color_coeffs(struct u_vive_values *values, const cJSON *coeffs, uint8_t eye size_t i = 0; cJSON_ArrayForEach(item, coeffs) { - values->coefficients[i][channel] = (float)item->valuedouble; + values->coefficients[channel][i] = (float)item->valuedouble; ++i; if (i == 3) { break; diff --git a/src/xrt/drivers/vive/vive_config.c b/src/xrt/drivers/vive/vive_config.c index 7808e8658..9f4f8c78a 100644 --- a/src/xrt/drivers/vive/vive_config.c +++ b/src/xrt/drivers/vive/vive_config.c @@ -37,7 +37,7 @@ _get_color_coeffs(struct u_vive_values *values, const cJSON *coeffs, uint8_t eye size_t i = 0; cJSON_ArrayForEach(item, coeffs) { - values->coefficients[i][channel] = (float)item->valuedouble; + values->coefficients[channel][i] = (float)item->valuedouble; ++i; if (i == 3) { break;