gettingstarted
[Top] [All Lists]

Re: "Curves" control

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: "Curves" control
From: FreeFL <freefl at free dot fr>
Date: Mon, 28 Nov 2005 09:18:53 +0100
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <254 dot 49a943 dot 309e3fc7 at aol dot com> <4F484050-06AD-47B4-8DB7-B63D57A3A1CA at shaw dot ca> <p06230902bfa24abfd929 at [192 dot 168 dot 0 dot 2]> <6DD06D7A-D3A9-4BD5-9CB2-87FC4286BD81 at freaksw dot com> <B6540003-D184-42F2-9C0F-1A0CE59355B4 at freaksw dot com> <p06230915bfa3f828699a at [192 dot 168 dot 0 dot 2]> <874124DE-13B8-4709-AC44-F96BEF89A546 at freaksw dot com> <p06230916bfa4163173c1 at [192 dot 168 dot 0 dot 2]> <6E3D32D7-923A-49B0-8189-C88BFB3044AA at freaksw dot com> <p06230919bfa56843e226 at [192 dot 168 dot 0 dot 2]> <p0623091abfa568e808f4 at [192 dot 168 dot 0 dot 2]> <AA35C722-6ADF-4E76-8B6C-D199CB25A331 at freaksw dot com> <p06230900bfa5f14d3b34 at [192 dot 168 dot 0 dot 2]> <D1A7F49A-886B-4951-B769-41B1268677E5 at freaksw dot com> <p06230908bfa6a5512fec at [192 dot 168 dot 0 dot 2]> <C96CF6DC-2FAB-4D76-84FA-A8D33A4C1604 at freaksw dot com> <p0623090cbfa6c19ad116 at [192 dot 168 dot 0 dot 2]> <36EE01AF-D7EA-41FB-A806-80EECDFA5FC2 at freaksw dot com> <p0623090dbfa73873931b at [192 dot 168 dot 0 dot 2]> <D3552186-705F-4CFC-A06A-E176AEB4417F at freaksw dot com> <p06230902bfae368d4ef5 at [192 dot 168 dot 0 dot 2]> <DD7AA1CC-12F8-47B1-A092-058D4E339951 at freaksw dot com>
|    27/11/05 ~ 17:56 -0800 :
|    Seth Willits,
|         " Re: "Curves" control "


On Nov 26, 2005, at 7:59 AM, FreeFL wrote:

Hello!

Is there a way to retrieve the coordinates of running point on a CurveShape object ?
I mean getting the y = ?(x) corresponding to the curve...

y = FX(x)

Yeah, if the curveshape is the parabolic function you put in the beginning.
But if it is a curveshape whose points are dragged wherever... (example project to be posted soon)

I found one answer for the Bezier curves on the web (i dumped the url, sorry) and cleaned it a bit.
It sounds like this (© Janis Joplin) :

  dim mu,ax,ay,bx,by,cx,cy,p0x,p0y,p1x,p1y,p2x,p2y,p3x,p3y,px,py as double
  dim k,maxk as integer
  //end points of curve are p0 and p3, control points are p1 and p2

    cx = 3 * (p1x - p0x)
    cy = 3 * (p1y - p0y)
    bx = 3 * (p2x -2*p1x+ p0x)
    by = 3 * (p2y -2*p1y + p0y)
    ax = p3x + 3*p1x - 3*p2x - p0x
    ay = p3y + 3*p1y - 3*p2y - p0y
for k = maxk downto 0
      mu = (k/maxk)
      px = ax * mu * mu * mu + bx * mu * mu + cx * mu + p0x
      Map(px) =  = ay * mu * mu * mu + by * mu * mu + cy * mu + p0y
    next

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>