我目前正在尝试做的是将屏幕上的一组点从中心点扩展开。我目前正在使用此代码(注意我已修改此代码以便于理解):
#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 时,点位于正确的位置,但是当我增加缩放级别时,点向错误的方向扩展,而不是从中心点向外扩展,相反的方向,向中心点行进。
任何有关如何解决此问题的建议将不胜感激。
[编辑] - 我没有这么说,但每个点都分布在中心点周围的随机点上。