移动物体 [英] Moving Objects

查看:57
本文介绍了移动物体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有一个想回答的问题.
我是vb.net程序员
假设我们有两个对象(A,B)
如何使用vb.net直接将对象"A"从其位置移至对象"B"位置.

谢谢.

Hello
I have a question that i wish to answer it.
I''m vb.net programmer
Let''s say that we have two objects (A,B)
how can I move object "A" from its location toward object "B" location straightly with vb.net.

And Thank You.

推荐答案

获取两个对象AX,AY和BX,BY的坐标.
现在您必须要点,并且可以线性插值所有
AX,AY和BX,BY之间的直线上的点.
使用AX,AY作为起点,使用BX,BY作为端点.
使用插值点将对象A移向对象B.


干杯,


曼弗雷德(Manfred)
Take the coordinates for both objects AX,AY and BX,BY.
Now you have to points and you linearily interpolate all
the points on the line between AX,AY and BX,BY.
Use AX,AY as start point and BX,BY as the endpoint.
Use the interpolated points to move object A towards object B.


Cheers,


Manfred


我假设您想将一个对象移向屏幕上的另一个对象.

假设对象a比对象b低100个单位,并且也比对象b右200个单位.这意味着每向上移动一个单位,它就必须向左移动1 * (200 / 100) = 2个单位.这也意味着,每移动一个单位,它就必须向左移动1 * (100 / 200) = 0.5个单位.

祝你好运!
I assume you would like to move an object towards another on screen.

Lets say object a is 100 units below object b and also 200 units right of object b. This means that for every unit a moves up it has to move 1 * (200 / 100) = 2 units to the left. This also means that for every single unit it moves to the left it has to move 1 * (100 / 200) = 0.5 units up.

Good luck!


这篇关于移动物体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆