aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/reflections.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/reflections.c b/src/reflections.c
index ba68baa..a490364 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -178,6 +178,12 @@ void reflection_add_from_dp(ControlContext *ctx, double x, double y, ImageRecord
ny = cos(tilt)*y_temp - sin(tilt)*z_temp;
nz = -sin(tilt)*y_temp - cos(tilt)*z_temp;
+ /* Finally, reverse the omega rotation to restore the location of the image in 3D space */
+ x_temp = nx; y_temp = ny; z_temp = nz;
+ nx = x_temp*cos(-omega) + y_temp*-sin(-omega);
+ ny = x_temp*sin(-omega) + y_temp*cos(-omega);
+ nz = z_temp;
+
reflection_add(ctx->reflectionctx, nx, ny, nz, intensity, REFLECTION_NORMAL);
}