如何构建移动对象模拟器 [英] how to build Moving object Simulator
问题描述
大家好。
我想用c#开发一个模拟器,这样一个移动的圆圈应该从特定的位置移动到计算的最终位置。
我将通过一些算法计算结束位置。 (我知道怎么做)但是我不知道应该如何启动这个模拟器?
要么采用位图并绘制圆圈移动的区域?或者在窗口表格上?
我将这个程序扩展到复杂的情况。就像我想要的那样,如果例如阻挡移动圆的路径,那么而不是与阻挡(墙壁或其他)碰撞圆圈,
移动的圆圈应该在碰撞前做出决定。 />
现在我不知道要么开始使用多线程。 ??或通过活动处理??
有什么想法吗?
提前谢谢。
hello everybody.
i want to develop a simulator in c# , such that a moving circle should move around, from specific location to a calculated end location.
i will calculate the end location through some algorithm. ( i know how to do this) but i don't know that how should start this simulator?
either taking a bitmap and draw the area where the circle should move? or on the window form??
i will extend this program to complex situation. like i want that , if for example to block the path of moving circle, so rather than to collide circle with the blocking ( wall or whatever),
the moving circle should take decision before collision .
Now i don't know either take start with multi-threading. ?? or through event handling ??
any idea please??
thanks in advance.
推荐答案
最简单的多线程形式可能在.NET库的Parallel类中,因为我用它来加速我的模拟:
< a href =http://www.codeproject.com/Articles/661257/Transmission-Line-Matrix-for-Acoustic-Simulations>声学模拟的传输线矩阵 [ ^ ]
至于你的另一个问题,你可以尝试一些碰撞检测算法,网上有大量的...
The simplest forms of multithreading is perhaps in the Parallel class in .NET library, as I have used it to speed up my simulation:
Transmission Line Matrix for Acoustic Simulations[^]
As for your other question, you could try some collition detection algorithms, there are loads of the on the web...
这篇关于如何构建移动对象模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!