Ask a Question related to Macromedia Director 3D, Design and Development.
-
AndrewNock #1
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
-
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... -
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... -
undefined constant
Ok, echo "value is ".$_POST; values is Notice: Use of undefined constant merkid - assumed 'merkid' in .... echo "value is ".$_POST; value is... -
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 -
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... -
hondo3000 #2
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
-
duckets #3
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



Reply With Quote

