[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23019] trunk/blender/source/blender: Option to correct for 3D curve twist error.

Martin Poirier theeth at yahoo.com
Sun Sep 6 15:27:08 CEST 2009



--- On Sun, 9/6/09, Campbell Barton <ideasman42 at gmail.com> wrote:

> from talking to ZanQdo and Martin the
> current method used to minimize
> twist could be changed/improved
> At the moment its not totally animation safe, since the
> minimum twist
> can change when the point positions move (hooks or shape
> keys).
> though is not likely to flicker, just rotate as the curve
> moves which
> is noticeable if you have a bevel shape rather then a
> circle,
> presumably if your using UV textures too.

What it does is break the curve property of piecewise independence. So if you move a CV, it will affect the orientation of the curve for all points after that one (in the direction of the curve) and not just in 180 degrees rotations. That also breaks direction invariance, obviously.

That's very nasty.

> Martin suggests the existing Z-up method could check for
> flipping and
> correct for that but otherwise stay as it is.
> I'll test some different methods and see if one can be used
> or maybe
> it can be an option per curve since they give such
> different results.

What I'm suggesting is one of two things: either (1) using the tangent and cotangent (first and second derivative) directly calculate the orientation, detecting zero crossings in the cotangent to avoid flips or (2) simply detecting flips in the current method (they happen invariably when the tangent become parallel to the reference up axis).

In both cases, when a flip is detected, it should do a 180 rotation of the flipped orientation. This is the "classic" solution (taught in school classes), it works all the time and keeps piecewise independence.

Variances caused by changes of direction are strictly 180 degrees and can be fixed by twisting the whole curve by a fixed amount (unlike the current solution). Orientations are still perpendicular before and after.

The advantage of (1) is that the orientation of the curve is now dependent on its curvature and will result in more "natural" looking motion. It also means that rotating a curve in 3d in edit mode doesn't affect the orientation with regards to the curve itself. (2) on the other hand has the advantage of being closer to what we have right now (which is slightly more predictable than the cotangent method) and, if wanted, code could be written to add back twists when reading old files (meaning that this option would always be on, but old files that showed the bug would still show it BUT could be correct by changing the tilt).

Martin


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.


More information about the Bf-committers mailing list