Fix T38209: Curve's didn't account for negative scale

Would use the face winding from the previously drawn mesh
This commit is contained in:
Campbell Barton 2014-01-15 00:35:43 +11:00
parent 1fb9bb815a
commit 54e56cd309
Notes: blender-bot 2023-02-14 11:20:30 +01:00
Referenced by issue #38209, Curves with depth and subsurf results in inverted normals when zooming
Referenced by issue #38214, Input Values followed by - does not invert Value
1 changed files with 10 additions and 8 deletions

View File

@ -3801,17 +3801,10 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag,
glEnable(GL_LIGHTING);
glEnableClientState(GL_VERTEX_ARRAY);
if (ob->type == OB_MBALL) { /* mball always smooth shaded */
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
else glFrontFace(GL_CCW);
glShadeModel(GL_SMOOTH);
}
else {
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CCW);
else glFrontFace(GL_CW);
}
dl = lb->first;
while (dl) {
@ -3929,6 +3922,8 @@ static bool drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d,
return true;
}
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
if (dt > OB_WIRE && dm->getNumTessFaces(dm)) {
int glsl = draw_glsl_material(scene, ob, v3d, dt);
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
@ -3969,6 +3964,13 @@ static bool drawDispList_nobackface(Scene *scene, View3D *v3d, RegionView3D *rv3
return false;
}
if (ob->type == OB_MBALL) {
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
}
else {
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CCW : GL_CW);
}
switch (ob->type) {
case OB_FONT:
case OB_CURVE: