欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    游戏2D技术毕业论文外文文献翻译.doc

    • 资源ID:4028740       资源大小:32KB        全文页数:6页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    游戏2D技术毕业论文外文文献翻译.doc

    毕业设计(论文)外文资料翻译学院(系): 计算机科学与技术学院 专 业: 网络工程 姓 名: 学 号: 外文出处: AI for game developers 附 件: 1.外文原文;2.外文译文。 指导教师评语: 签名: 年 月 日English text: Game 2 D technology To realize the quality of the games said animation, many people will be immediately thought DirectX, yes DirectDraw are very strong, but not have to use DirectDraw to just go. Behind the animation theory and techniques are all the same, this and end use what API not much (if the API is not too slow words). Is the author of the realization of the NewImage Lib testing results, internal all the pixel data storage and computation are pure software to realize, the last step output to screen use GDI performance than DirectDraw low less than 10%, in Window9X system to low 20% left and right sides, this for many software is absolutely acceptable.The application now interface more does more luxuriant, in addition to support the SKIN, a lot of people want to join in a program in some such as Sprite animation this originally used in game technology, for this reason introducing DirectX API, apparently was not worth (besides DX version to upgrade frequent, with DirectGraphic DX8 already replaced DirectDraw). In this paper the author use standard to realize commercial game GDI functions as an example, take you into the high quality 2 D animation programming domain, and ensure the equipment independence.In we have a proper time to execute the update operation, now let us try animation it. The following code will no longer provide Win32 version.In order to narrative is convenient, I need a play the animation window, it must be a derived class of CWnd, assuming this class is called CMyView, we will draw animation in the window. First we for the class add a member function "void CMyView: : RenderView ()", you can use the above mentioned method calls this function.Are now ready to work very well, our animation how to store? Don't mention animation GIF89a format (if you think only have animation GIF words, I advise you to do art good, don't do programs), if you just want a simple animation playback of course, but if you want to do complex point, interactive animation, I advise you still don't use that things. Assume we have a 4 frame of animation, how to store it? First thing I thought of was save four BMP file, and then read to a CBitmap object the array, but respected master Scott Meyers warned us not to use polymorphism arrays, because the compiler in some cases can't accurately calculate the size of the array object, so subscript operators will have dire effects. Then I thought of use CBitmap pointer arrays, this to is nice, but management up a little trouble. Now look at my final solution itThen use it to create a CImageList object, let us create a careful look at the method, and useBOOL CImageList: : Create (int cx, int cy, UINT nFlags, int nInitial, int nGrow);Function, the front two parameters used to specify the size of the animation to us. This created an empty ImageList, the advantage of this is extensible line is stronger. Next, we need to put the frames the document Load to a CBitmap object, you can be put into JPG or GIF files to save capacity (If you truly achieve the above code words, you will find that screen flash, very uncomfortable. Many people will blame the GDI head, and they will be called MS, said GDI is too slow. In fact not also any write directly the operation of the screen will have flash, under the video memory write directly in DOS or use DirectDraw API to write directly Primary Surface will shine, because you each update the operation of the show will be users soon see (because the reason and vertical back, may have delay).Eliminate flash the simplest and most classical approach is Double buffer (Double buffer). The so-called double buffer in fact, the truth is very simple, that is to say we in other places (simple said is not aimed at the screen, and don't show place) to open up a storage space, we put all the animation will render to this place, not the direct rendering to screen (on the screen of the storage area). In the GDI, directly to the screen is window DC, "not visible place" general can use Memory DC. In the animation rendering all go to the backstage buffer, then a whole is copied to the buffer screen next time!In pure software 2 D graphics engine, the double buffer generally means that in memory open up a region used to store pixel data. And in the Back Surface DirectDraw can create, in all the animation rendering to Back Suface after on, and then use the Flip operation is visible, Flip operation because of just set the address of the visible Surface, so very fast中文译文: 游戏2D技术说到实现游戏品质的动画,很多人会立刻想到DirectX,没错DirectDraw很强大,但是并不是必须用DirectDraw才行。动画后面的理论和技巧都是一样的,这和末端使用什么API没有太大关系(如果那API不是太慢的话)。就笔者实现的NewImage Lib的测试结果,内部所有像素数据的存储和运算都纯软件实现,最后一步输出到屏幕使用GDI的性能比DirectDraw低不到10%,在Window9X系统上要低20%左右,这对很多软件来说是绝对可以接受的。现在应用程序界面越做越华丽,除了支持SKIN外,很多人都想在程序中加入一些例如sprite动画这种原本用在游戏上的技术,因为这原因引入DirectX API,显然是不值得的(况且DX版本升级频繁,DX8中已经用DirectGraphic取代了DirectDraw)。本文将以笔者使用标准GDI函数实现的商业游戏为例,带你进入高品质2D动画编程领域,并且保证其设备无关性。在我们有了一个适当的时机执行更新操作了,现在就让我们试试动画吧。下面的代码将不再提供Win32的版本。为了叙述方便,我需要一个播放动画的窗口,它必须是一个CWnd的派生类,假设这个类叫做CMyView,我们将在这个窗口中绘制动画。首先我们为这个类添加一个成员函数”void CMyView:RenderView()”,你可以使用上面提到的方法调用这个函数。现在准备工作都做好了,我们的动画该怎么存储呢?别提动画GIF89a格式(如果你觉得只有GIF才有动画的话,那我劝你去做美术好了,别干程序了),如果你只想要个简单的动画播放当然可以,但是如果你想要做复杂点的,交互式动画,我劝你还是别用那东西。假设我们有一个4帧的动画,怎么存储它呢?我首先想到的就是存4个BMP文件,然后读入到一个CBitmap对象数组中,但是尊敬的大师Scott Meyers警告我们不要使用多态数组,因为编译器在某些情况下不能准确计算数组中对象的大小,所以下标运算符会产生可怕的效果。然后我就想到了用CBitmap指针数组,这到是不错,不过管理起来稍嫌麻烦。现在看看我最终的解决方法吧然后用它创建一个CImageList对象,让我们仔细看一下创建的方法,使用BOOL CImageList:Create( int cx, int cy, UINT nFlags, int nInitial, int nGrow );函数,前面两个参数用来指定我们一帧动画的尺寸。这样就创建了一个空的ImageList,这样做的好处是可扩展行比较强。下面我们需要把那个帧序列文件Load到一个CBitmap对象中,你可以存成JPG或者GIF文件来节省容量( 如果你真正实现上面的代码的话,你会发现画面一闪一闪的,十分的不爽。很多人都会怪到GDI头上,他们又会骂MS,说GDI太慢了。其实非也任何直接写屏幕的操作都会产生闪烁,在DOS下直接写显存或者用DirectDraw API直接写Primary Surface都会闪烁,因为你每个更新显示的操作都会被用户马上看到(因为垂直回扫的原因, 或许会有延迟)。 消除闪烁最简单也是最经典的方法就是双缓冲(Double buffer)。所谓的双缓冲其实道理非常简单,就是说我们在其它地方(简单的说就是不针对屏幕,不显示出来的地方)开辟一个存储空间,我们把所有的动画都要渲染到这个地方,而不是直接渲染到屏幕上(针对屏幕的存储区域)。在GDI中,直接针对屏幕就是窗口DC,”不可见的地方”一般可以用Memory DC。在把所有动画渲染到后台缓冲之后,再一下次整体拷贝到屏幕缓冲区!在纯软件2D图形引擎中,双缓冲一般意味着在内存中开辟一个区域用来存储像素数据。而在DirectDraw中可以创建Back Surface,在把所有动画渲染到Back Suface上之后,然后使用Flip操作使其可见,Flip操作因为只是设置可见surface的地址,所以非常快速

    注意事项

    本文(游戏2D技术毕业论文外文文献翻译.doc)为本站会员(仙人指路1688)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开