Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Split Bezier curve



Hi,
thanks for your suggestion. I am currently looking into the problem.
I have found some interesting docs at:

    http://www.antigrain.com/research/adaptive_bezier/index.html
    http://www.gamedev.net/community/forums/topic.asp?topic_id=313018
    http://people.inf.ethz.ch/fischerk/pubs/bez.pdf
    http://www.tinaja.com/glib/midpoint.pdf
    http://www.tinaja.com/glib/nubzlen1.pdf
    http://www.cit.gu.edu.au/~anthony/info/graphics/bezier.curves

Anyway, I don't think that the Casteljau's methods lets me calculate the
half-a-distance point on the curve. Please confirm. In the meantime I am
going to verify that.
To reply to Shamyl, yes I have already used the "rough subdivision" method,
but it is not so accurate and fast. I am sure there is an analytic way to do
it.



Best Regards
-- 
Lorenzo
email: email@hidden

> From: Ben Supnik <email@hidden>
> Date: Thu, 17 May 2007 12:35:38 -0400
> To: Lorenzo <email@hidden>
> Subject: Re: Split Bezier curve
> 
> Hi Lorenzo,
> 
> I'm afraid I don't have a formula for equal-length bezier curves...I've
> looked at a bunch of bezier formulas for my app.  Here are a few
> formulas I have found...if any help you build a good approximation from
> pieces, let me know, I can send you code.
> 
> 1. Derivative (describes the tangent at any point, whose length will
> give you a sense of how far you'll go as you increment T).
> 
> 2. Zero crossings of derivatives (via the quadratic formula) give you
> the point where the bezier changes direction.
> 
> 3. Arbitrary split at a time T.
> 
> 4. Combining 2 and 3, you can cut any bezier into a "monotone" segment,
> one that doesn't "change direction" in any dimension...that's handy
> because the monotone segment is fully contained within the bounding
> box/cube of the endpoints of the segment.
> 
> 5. Once you have the bounding box of monotone segments, you can easily
> apply recursive binary algorithms to do things like intersections.
> (That may be getting away from your original goal. :-)
> 
> As a final thought, our app renders beziers not by advancing T an
> arbitrary distance, but by a recursive subdivision, e.g. we keep adding
> points to the curve until we meet a minimum error requirement or a
> maximum point count.  Theoretically this helps us put our segments to
> the most good.
> 
> Sorry, none is a length curve, but if any of these help you build a
> workaround, let me know.
> 
> cheers
> Ben
> 
> 
> 
> 
> Lorenzo wrote:
>> Hi,
>> in my OpenGL application I draw a 3D Bezier cubic curve in the 3D space.
>> 
>> Now, I have to split the 3D Bezier curve in 8 segments having the same
>> length. I iterate the curve from t = 0.0 to t = 1.0 using a t constant
>> interval of 1/8, so t = 0.125, t = 0.250... I get 8 segments, but they have
>> different length. Closer I go to the endPoint of the curve, each segment is
>> shorter.
>> Instead I would need they had the same length. So e.g, when I pass t = 0.5
>> I need to get the xyz coordinates of the point placed at half a distance
>> from the first point. Any idea?
>> 
>> 
>> Best Regards
> 
> -- 
> Scenery Home Page: http://scenery.x-plane.com/
> Scenery blog: http://xplanescenery.blogspot.com/
> Plugin SDK: http://www.xsquawkbox.net/xpsdk/
> Scenery mailing list: email@hidden
> Developer mailing list: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.