Commit: 09bf8f4a69603ad4faefc2c5777a3b485680ad3a
Author: Campbell Barton
Date:   Thu Apr 20 18:56:53 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB09bf8f4a69603ad4faefc2c5777a3b485680ad3a

Use reflect for calculating second normal

===================================================================

M       source/blender/blenkernel/intern/curve_render.c

===================================================================

diff --git a/source/blender/blenkernel/intern/curve_render.c 
b/source/blender/blenkernel/intern/curve_render.c
index d2ca9ab7729..dbeb5351dc9 100644
--- a/source/blender/blenkernel/intern/curve_render.c
+++ b/source/blender/blenkernel/intern/curve_render.c
@@ -560,18 +560,15 @@ static VertexBuffer 
*curve_batch_cache_get_normal_verts(CurveRenderData *rdata,
                                vec_a[1] = 0.0f;
                                vec_a[2] = 0.0f;
 
-                               vec_b[0] = -fac;
-                               vec_b[1] = 0.0f;
-                               vec_b[2] = 0.0f;
-
                                mul_qt_v3(bevp->quat, vec_a);
-                               mul_qt_v3(bevp->quat, vec_b);
+                               madd_v3_v3fl(vec_a, bevp->dir, -fac);
+
+                               reflect_v3_v3v3(vec_b, vec_a, bevp->dir);
+                               negate_v3(vec_b);
+
                                add_v3_v3(vec_a, bevp->vec);
                                add_v3_v3(vec_b, bevp->vec);
 
-                               madd_v3_v3fl(vec_a, bevp->dir, -fac);
-                               madd_v3_v3fl(vec_b, bevp->dir, -fac);
-
                                VertexBuffer_set_attrib(vbo, pos_id, 
vbo_len_used++, vec_a);
                                VertexBuffer_set_attrib(vbo, pos_id, 
vbo_len_used++, bevp->vec);
                                VertexBuffer_set_attrib(vbo, pos_id, 
vbo_len_used++, vec_b);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to