Moving Along a Curve in 3D

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default Moving Along a Curve in 3D


    Does anyone out there know how to do the math to make an object in 3D space transform from point A through point B to point C, in a smooth curve?

    To put it another way, I'd like a 3D object to move from one point in space to another, passing through a specified intermediate point, all using a regular arc.

    Sort of like the cool 2D curve math on the Hairybobbies site ([url]http://www.geocities.com/hairybobby2000/mathhome.html[/url]), but now in 3D.

    Anyone done this yet?

    :-)




    MartyPlumbo Guest

  2. Similar Questions and Discussions

    1. Length of curve?
      I have a closed curve of irregular shape, and I would like to divide it into segments of equal length. Does Freehand have any features to deal with...
    2. Paths-Drawing a curve on a curve
      Probably a simple task, but if I start out drawing a curved path and I want to make my next section a curve also, how do I do it? For example, if I...
    3. Moving Randomly Moving Sprite To New Location on mouseEnter
      Hi All, This is way over my head. I am currently using Director 8. I have a randomly moving sprite(call it X) on stage (I accomplished this...
    4. just half a bezier curve please
      Does anyone know the lingo for animating a vertex list . I understand how to create a bezier curve in code. but lets say i have a curve - how can I...
    5. curve effect
      Hi, How do I get the curve effect here. It's on the top of the page. http://www.regmovies.com Thanks David
  3. #2

    Default Re: Moving Along a Curve in 3D

    I asked the same thing a year or two ago and saved the response from Paul
    L...





    Here is a parent script modified to work in 3d.

    usage is:-

    bezierCurver=script("3d

    bezier").new(vector(0,0,0),vector(100,100,100),vec tor(-20,20,20),vector(120,

    100,100))

    then work out your time t as a value between 0 and 1

    currentPosition=bezierCurver.getPosition(t)



    read on for parent script (put it in a parent script cast member called "3d

    bezier"



    -- 3d bezier curve parent script

    -- Paul Lemon (paull@pilotinteractive.co.uk)

    property a,b,c

    property start



    on new me, istart, end, control1,control2

    -- istart is a vector representing the start position in 3d space

    -- end is a vector representing the end position in 3d space

    -- control1 is a vector representing the first control point

    -- control2 is a vector representing the second control point

    start=istart

    c=3*(control1-start)

    b=3*(control2-control1) - c

    a=end-start-c-b



    return me

    end

    on getPosition me,t

    -- returns a vector describing the beziers position at a point in time t

    -- 0<= t <=1

    t2=t*t

    t3=t*t2

    return a*t3 + b*t2 + c*t + start

    end




    on getOrientation me,t

    -- returns a vector describing the direction(velocity) the beziers is

    -- pointing in at time t

    -- 0<= t <=1

    t2=t*t

    return 3*a*t2 + 2*b*t +c

    end

    on getspeed me,t

    return=me.getOrientation(t).magnitude

    end

    "MartyPlumbo" <martyp@insightbb.com> wrote in message
    news:bstv3f$8u6$1@forums.macromedia.com...
    >
    > Does anyone out there know how to do the math to make an object in 3D
    space transform from point A through point B to point C, in a smooth curve?


    paul Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139