我目前试图做的是在屏幕上远离中心点展开一组点。我目前使用此代码(注意我已经修改这个代码更容易理解):从中心点移动坐标
#d_x - the x coordinate of the dot at its default position
#d_y - the y coordinate of the dot at its default position
#dis_x - the distance along the x grid the point is away from the centre point
#dis_y - the distance along the y grid the point is away from the centre point
#zoom_level - the zoom level increased or decreased depending on the mouse wheel
z_x = (d_x + (dis_x * (1 + (zoom_level * 0.01))))
z_y = (d_y + (dis_y * (1 + (zoom_level * 0.01))))
drawText("*",z_x,z_y,)
此代码几乎工作,唯一的问题是,当zoom_level为0的点是在正确的位置,但是当我增加了缩放级别,使点沿着错误的方向扩展,而不是从中心点向外扩展,而是以相反的方式向中心点移动。
有关如何解决此问题的任何意见将不胜感激。
[编辑] - 我没有说这个,但是每个点都是围绕中心点随机点展开的。
适用于我的机器。见[这里](http://pastebin.com/YvZV6Cxw)。执行100,000次试验时,当增加缩放级别时,点总会从中心点走得更远。 – Kevin
你是如何计算'dis_x'和'dis_y'的? – Kevin
魔法8球:当点向错误方向移动时,您的“缩放级别”具有错误的+/-符号。 – chux