简体   繁体   English

如何使用2D图形实现3D空间潜水

[英]How to implement 3D space diving using 2D graphic

I'm trying to get something like this http://www.fotosearch.com/CSV008/k6834584/ 我正在尝试获取类似的信息http://www.fotosearch.com/CSV008/k6834584/

But I have a trouble with moving stars at 2D screen. 但是我很难在2D屏幕上移动星星。

I'm looking for algoritm, that simulate 3D space diving. 我正在寻找可模拟3D太空潜水的算法。

Your question is extremely vague, I doubt you will be able to get a satisfying answer this way. 您的问题非常含糊,我怀疑您是否可以通过这种方式获得满意的答复。 If you have already tried implementing this, you should show your code and the specific parts you are having trouble with. 如果您已经尝试实现此功能,则应显示您的代码以及遇到问题的特定部分。 I would think the most important basic points to keep in mind would be that 我认为最重要的基本要点是

  1. the stars get bigger as they approach the screen 星星接近屏幕时变大
  2. stars that are not exactly in the center of the screen would move away to the sides as they got closer 并非完全位于屏幕中心的星星会随着距离的增加而移向侧面
  3. stars need to be removed once they pass a certain threshold of proximity to the "camera" 一旦它们超过“相机”的某个特定阈值,就需要将其移除

Its perfectly feasible to implement something as simple as this using GDI+, however, more complex scenarios should probably be solved using some form of 3D graphics library (like Direct3D) to take care of perspective and projection. 使用GDI +实现像这样的简单操作是完全可行的,但是,应该使用某种形式的3D图形库(如Direct3D)解决透视和投影问题,解决更复杂的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM