สิ่งที่ฉันกำลังพยายามทำคือขยายกลุ่มจุดบนหน้าจอให้ห่างจากจุดศูนย์กลาง ฉันกำลังใช้รหัสนี้อยู่ (หมายเหตุ ฉันได้แก้ไขรหัสนี้เพื่อให้เข้าใจง่ายขึ้น):
#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 จุดอยู่ในตำแหน่งที่ถูกต้อง แต่เมื่อฉันเพิ่มระดับการซูม จุดจะขยายไปในทิศทางที่ไม่ถูกต้อง แทนที่จะขยายออกไปด้านนอกจากจุดศูนย์กลาง การเดินทางในทิศทางตรงกันข้าม กำลังเดินทางไปสู่จุดศูนย์กลาง
คำแนะนำใด ๆ เกี่ยวกับวิธีแก้ไขปัญหานี้จะได้รับการชื่นชมอย่างมาก
[แก้ไข] - ฉันไม่ได้พูดสิ่งนี้ แต่แต่ละจุดจะกระจายออกไปที่จุดสุ่มรอบจุดศูนย์กลาง
dis_x
และdis_y
อย่างไร - person Kevin   schedule 04.06.2013zoom level
ของคุณมีเครื่องหมาย +/- ผิดเมื่อจุดเคลื่อนที่ไปในทิศทางที่ผิด - person chux - Reinstate Monica   schedule 05.06.2013