[gegl/soc-2013-n-point-deformation: 12/28] libs: npd: add alpha parameter to MLS weights



commit 8a0db88738bda0b32688b667cec09aba04084117
Author: Marek Dvoroznak <dvoromar gmail com>
Date:   Tue Aug 13 16:04:18 2013 +0200

    libs: npd: add alpha parameter to MLS weights

 libs/npd/npd_common.c |    3 ++-
 libs/npd/npd_common.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libs/npd/npd_common.c b/libs/npd/npd_common.c
index e9f856e..d31bb6d 100644
--- a/libs/npd/npd_common.c
+++ b/libs/npd/npd_common.c
@@ -34,6 +34,7 @@ npd_init_model (NPDModel *model)
   model->hidden_model = hidden_model;
   hidden_model->ASAP                      = FALSE;
   hidden_model->MLS_weights               = FALSE;
+  hidden_model->MLS_weights_alpha         = 1;
   hidden_model->num_of_bones              = 0;
   hidden_model->num_of_overlapping_points = 0;
 
@@ -400,7 +401,7 @@ npd_compute_MLS_weights (NPDModel *model)
         }
 
       if (npd_equal_floats (min, 0.0)) min = 0.0000001;
-      MLS_weight = 1 / min;
+      MLS_weight = 1 / pow (min, hm->MLS_weights_alpha);
       npd_set_overlapping_points_weight (op, MLS_weight);
     }
 }
diff --git a/libs/npd/npd_common.h b/libs/npd/npd_common.h
index 06f4bc8..e99350a 100644
--- a/libs/npd/npd_common.h
+++ b/libs/npd/npd_common.h
@@ -67,6 +67,7 @@ typedef struct
                                             * use npd_set_deformation_type function */
   gboolean              MLS_weights;       /* don't change directly!
                                             * use npd_set_deformation_type function */
+  gfloat                MLS_weights_alpha;
   NPDBone              *current_bones;     /* array of current bones */
   NPDBone              *reference_bones;   /* array of reference bones */
   NPDOverlappingPoints *list_of_overlapping_points; /* array of overlapping points */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]