Ask a Question related to Macromedia Director 3D, Design and Development.
-
just_mik3 #1
measure distance of 2 or more 3d object
hi,
i need to measure the distance between 2 or more 3d objects and give warning if the distance is less then 60 cm.
can anyone tell me how to do this?
thanks
=Mike=
just_mik3 Guest
-
how to measure the streaming bandwidth
hi We are hosting a Media Server applications on our server, we wanna measure the bandwidth the application consume. so, please could any one tell... -
measure the height of a model
how can i measure the height of a model? -
Measure space of surface
how can i measure how many space of a plain surface remains if i put a model on it? regards, mike -
snap distance > pick distance impossible?
In the General Preferences, I tried to set the value for the pick distance to 1, and the snap distance to 5, but after several tries (and thinking... -
Measure Ink Coverage
I would like to know if Illustrator or Photoshop can calculate the amount of ink coverage a particular image or letter will use as compared to... -
Karl Sigiscar #2
Re: measure distance of 2 or more 3d object
v1 = member("scene").model("modelName1").worldPosition. duplicate()
v2 = member("scene").model("modelName1").worldPosition. duplicate()
dist = v1.distanceTo(v2)
if dist < 0.6000 then
put "warning"
-- Insert warning code here
end if
Be careful to not use distanceTo() in a repeat while or in a repeat with or
in an on enterFrame or in an on exitFrame script as it implies heavy
calculation.
Cheers,
Karl.
Karl Sigiscar Guest
-
Karl Sigiscar #3
Re: measure distance of 2 or more 3d object
v2 = member("scene").model("modelName2").worldPosition. duplicate()
Karl Sigiscar Guest
-
hondo3000 #4
Re: measure distance of 2 or more 3d object
hi karl,
you said not to use distanceTo() in a repeat loop. do you know a faster way to
calculate the distance between two object?
i need something that checks the distance of many objects in a repeat loop.
hondo3000 Guest
-
Karl Sigiscar #5
Re: measure distance of 2 or more 3d object
Actually, the technique I use is to call distanceTo() on enterFrame or on
stepFrame ONLY ONCE OR TWICE EVERY SECOND. I compare the current ticks with
the previously saved ticks to check time everytime I reenter the frame. If a
certain amount of time has elapsed, I check the distance.
If you call distanceTo() everytime the playhead reenters the frame, it slows
things down very much.
Cheers,
Karl.
Karl Sigiscar Guest
-
Karl Sigiscar #6
Re: measure distance of 2 or more 3d object
If you do it on a repeat with loop, it clogs up the CPU.
Karl Sigiscar Guest
-
just_mik3 #7
Re: measure distance of 2 or more 3d object
than'x
i'll try it right away.
just_mik3 Guest
-
bgsBS #8
Re: measure distance of 2 or more 3d object
Karl -
2 things came up in my head, seeing this thered:
1. why do you have to duplicate the objects transform, in order to calculate
the distance bitween them?
2. wouldn't actually calculating the transform, with real math be faster?
bgsBS Guest
-
Karl Sigiscar #9
Re: measure distance of 2 or more 3d object
1. It's not necessary in this case indeed but it does no harm. I'm used to
duplicating so as to use the transform data rather than a reference to the
transform. Otherwise, you might modify the original transform unwittingly
and it might be the cause of a bug in your program.
2. As every Lingo instruction, distanceTo() is a wrapper to a C++ function.
Everything written in C++ is faster than anything you can come up with
written in Lingo.
"bgsBS" <webforumsuser@macromedia.com> a écrit dans le message de news:
d3qiiv$1db$1@forums.macromedia.com...> Karl -
> 2 things came up in my head, seeing this thered:
>
> 1. why do you have to duplicate the objects transform, in order to
> calculate
> the distance bitween them?
>
> 2. wouldn't actually calculating the transform, with real math be faster?
>
Karl Sigiscar Guest



Reply With Quote

