diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-25 13:47:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-25 13:47:19 +0300 |
commit | 9eb191083ac79121a19ebc970575b10437f669f1 (patch) | |
tree | 74668f61bc39e22063168d536190aa0e31d90c9c | |
parent | 89f5a09ab4660cd0d5bdf4b82899549b50ee2f16 (diff) |
Fix neg-scaled project-paint in perspective mode
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index d75b3f8ea3d..3ceaaff2f5d 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -1403,6 +1403,9 @@ static float project_paint_uvpixel_mask( viewDirPersp[1] = (ps->viewPos[1] - (w[0] * co1[1] + w[1] * co2[1] + w[2] * co3[1])); viewDirPersp[2] = (ps->viewPos[2] - (w[0] * co1[2] + w[1] * co2[2] + w[2] * co3[2])); normalize_v3(viewDirPersp); + if (UNLIKELY(ps->is_flip_object)) { + negate_v3(viewDirPersp); + } angle_cos = dot_v3v3(viewDirPersp, no); } @@ -3384,6 +3387,9 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps) else { sub_v3_v3v3(viewDirPersp, ps->viewPos, mv->co); normalize_v3(viewDirPersp); + if (UNLIKELY(ps->is_flip_object)) { + negate_v3(viewDirPersp); + } if (dot_v3v3(viewDirPersp, no) <= ps->normal_angle__cos) { /* 1 vert of this face is towards us */ ps->vertFlags[a] |= PROJ_VERT_CULL; } |