Constant speed in Director

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

  1. #1

    Default Constant speed in Director

    Hi all,

    I'm progressing well with my crane project. An issue I have next on my
    'checklist' is getting the speed to be the same on any machine. At the moment,
    when a button is pressed, it sets a variable to a value, i.e 'inchLoad' which
    calls a function to move the load up.

    on inchLoad()

    translationValue = gLoad.getWorldTransform().position.z

    if (translationValue < 410 ) then --make sure not go too high
    gLoad.translate(0,0,0.2)
    else
    craneMove = "stopCrane"
    end if

    end

    This works great, but if the computer is faster, the load moves faster, and
    vice versa. Is there a way I can set it so it will be the same on any computer
    I try it on.

    Thanks, Andy

    AndrewNock Guest

  2. Similar Questions and Discussions

    1. Constant Freezing
      Well, I've had this problem before. No, it does not crash when it's loading. It doesn't crash when loading fonts or anything like that. Before I had...
    2. unexpected constant #293 65
      I've wasted a full days trying to install CF 7 on my local machine. I kept getting the message saying that location was full and I need to select a...
    3. undefined constant
      Ok, echo "value is ".$_POST; values is Notice: Use of undefined constant merkid - assumed 'merkid' in .... echo "value is ".$_POST; value is...
    4. The constant FALSE
      Or is it a constant at all? "James Jiao" <jamesjiao@paradise.net.nz> wrote in message news:CZw3b.109$4a.20772@news02.tsnz.net... 0
    5. Does Ruby 1.8.0 improve in file I/O speed and pattern match speed?
      Hi, rubyists, I'm using ruby 1.6.8 (2002-12-24) and find file I/O too slow. Is ruby 1.8.0 faster? Some one in the list said speed is quite...
  3. #2

    Default Re: Constant speed in Director

    To get comparable motions on a wide range of machines you need some timebased
    motion. This can be done by using Timeoutobjects, mesure the elapsed
    milliseconds between frames or "registerforevent".
    I posted some time ago a littel demo with the "registerforevent" method, you
    can find it here:

    [url]http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=11&catid=26[/url]
    8&threadid=1158427&highlight_key=y&keyword1=158400 %20polygones%20and%20registerF
    orEvent%20%28read%2Fdemo%2Fsource%29

    I think the best way is to mesure the elapsed milliseconds and use the result
    to calculate the motion. Using registerforevent is not very confortable because
    you can not "unregister" a single script.

    regards!



    hondo3000 Guest

  4. #3

    Default Re: Constant speed in Director

    In short, you need to pass a 'time delta' to your function, and multiply your
    distance (0.2) by your time delta. The time delta should be calculated by
    examining the amount of time elapsed since the last frame.

    Alternatively you could reduce the distance moved each time the function is
    called, and call your function a number of times each frame. The number of
    times you call it should be based on the time elapsed since the last frame.

    For a more detailed explanation, see:


    [url]http://www.robotduck.com/content/articles/director/programmingTechniques/timeBas[/url]
    edMotion/

    - Ben



    duckets 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