Follow-up Comment #5, bug #21735 (project mypaint):

Well changing that to -1 didn't work at all-- just made things worse.  So, I
decided to try The Gimp and see if this behavior existed there... Gimp 2.8..
downloaded a tilt brush.  It acts the same!  Finally I try another program--
Krita.  Download a tilt brush-- it works fine!  The tilt is consistent
regardless of ascension.  Somehow Krita is getting it right.  I checked out
the source and I see almost the exact same code as MyPaint

qreal KisPaintInformation::declination(const KisPaintInformation& info, qreal
maxTiltX, qreal maxTiltY, bool normalize)
{
    qreal xTilt = qBound(qreal(-1.0), info.xTilt() / maxTiltX , qreal(1.0));
    qreal yTilt = qBound(qreal(-1.0), info.yTilt() / maxTiltY , qreal(1.0));
   
    qreal e;
    if (fabs(xTilt) > fabs(yTilt)) {
        e = sqrt(qreal(1.0) + yTilt*yTilt);
    } else {
        e = sqrt(qreal(1.0) + xTilt*xTilt);
    }
   
    qreal cosAlpha    = sqrt(xTilt*xTilt + yTilt*yTilt)/e;
    qreal declination = acos(cosAlpha); // in radians in [0, 0.5 * PI]
   
    // mapping to 0.0..1.0 if normalize is true
    return normalize ? (declination / (M_PI * qreal(0.5))) : declination;
}

I tried adjusting mypaint code to look more like this, and even leave the
values in Radians and normalized.  I adjusted my brush in Mypaint to use
values from 0 to 1 (instead of 0 to 90) and....  it was still weird had more
tilt N/S versus E/W.

Back to the drawing board.  (no pun intended)  

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?21735>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Mypaint-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-bugs

Reply via email to