From 82d38973d17693ed9a31ab816f1dd3b51901d898 Mon Sep 17 00:00:00 2001 From: mk Date: Mon, 30 Aug 2010 23:29:43 +0100 Subject: [PATCH] the coordinate system should be okay now. merit-function now also delivers values --- frontend/draw-model.lisp | 9 ++++----- frontend/merit.lisp | 7 ++++--- run.lisp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/draw-model.lisp b/frontend/draw-model.lisp index 5c3762d..82dab75 100644 --- a/frontend/draw-model.lisp +++ b/frontend/draw-model.lisp @@ -127,17 +127,16 @@ update-view-center." (gl:scale s s s)) #+nil (gl:translate 0 0 (- nf)) (rotate-translate-sample-space) - (draw-axes) ;; move axes into focal plane - (gl:with-pushed-matrix ;; move current stack plane into focal plane - (translate-v (v* ez (- z-plane-mm))) - (draw-hidden-spheres model)) + (draw-axes) ;; move axes into focal plane + (draw-hidden-spheres model) (let ((lens (make-instance 'lens:disk :center center :radius bfp-radius)) (bfp (make-instance 'lens:disk :center (v- center (make-vec 0d0 0d0 f)) :radius bfp-radius))) (gl:color .4 .4 .4) ;; draw planes defining the objective - (gui::draw lens) (gui::draw bfp)) + (gui::draw lens) + (gui::draw bfp)) (labels ((plane (direction position) "Define a plane that is perpendicular to an axis and crosses it at POSITION." diff --git a/frontend/merit.lisp b/frontend/merit.lisp index 41bed15..b423f94 100644 --- a/frontend/merit.lisp +++ b/frontend/merit.lisp @@ -181,7 +181,7 @@ positions (positions is a list of 2-lists of complex numbers)." (cons params) (values double-float &optional)) (destructuring-bind (objective model nucleus-index - window-radius positions z-mm-from-objective) + window-radius positions) params (let* ((border-value 0d0) ;; value to return when outside of bfp ;; this has to be considerably bigger than the maxima on the bfp @@ -206,11 +206,12 @@ positions (positions is a list of 2-lists of complex numbers)." #+nil (let* ((obj (lens:make-objective :center (v) :normal (v 0 0 1))) (window-radius .2d0) - (positions (sample-circles 3 12 12))) + (positions (sample-circles 3 12 12)) + (z-plane-mm (vec-z (elt (raytrace::centers-mm *model*) 0)))) (with-slots ((c lens::center) (ri lens::immersion-index) (f lens::focal-length)) obj - (setf c (make-vec 0d0 0d0 (- (* ri f)))) ;; small shift for sample is missing + (setf c (make-vec 0d0 0d0 (+ (- (* ri f)) z-plane-mm))) (let* ((params (list obj *model* 0 diff --git a/run.lisp b/run.lisp index 2e8e647..0ef9e0a 100644 --- a/run.lisp +++ b/run.lisp @@ -67,14 +67,14 @@ (center (make-vec (vec-x nucleus-position) (vec-y nucleus-position)))) (update-view-center nucleus-position) - (update-scale 300 20)) + (update-scale 200 20)) #+nil (defun draw-all () (draw *model* :nucleus 0 - :win-x/r -.2d0 - :win-r/r 0.1d0)) + :win-x/r 0d0 + :win-r/r .98d0)) #+nil (with-gui -- 2.11.4.GIT