• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天行健 君子當(dāng)自強(qiáng)而不息

            Working with Maps and Levels(12)

            Using Auto Maps

            Your game world is a huge place, and when players start exploring their surroundings,
            you may want to make things easier on them by providing a miniature version
            of your map for their reference. Not just any map mind you—a map that is smart
            enough to know where the player has been and the places he still needs to explore.

            You need to display only those portions of the map that a player has explored.
            Sections never visited do not need to be shown—that is, not until discovered by
            players. In that way, players can look back to where they’ve been and maybe plot
            out their paths to future destinations. This is the magic of auto mapping.

             

            Auto Maps in Action

            One of my favorite games, Phantasy Star Online, by Sega Corp., uses auto mapping
            in a seamless fashion. Check out Figure 17.5, which shows the auto map at work in
            the upper-right corner of the screen.

            In Phantasy Star Online, the main player and other important characters in the
            game are displayed on the auto map as well as small arrows. As the main player
            walks around, the map scrolls to show the area around the player. As the player
            visits new rooms (sections), the rooms are revealed on the auto map.

            This auto-mapping feature are easy to re-create for your own game project.

             

            Big Map, Small Map

            The challenge here is to change your large game level into a small map suitable
            for display in your game. Following snap shows a screen shot of the Mapping example
            program. Notice the map in the upper-right corner of the screen. It uses alpha blending
            (refer to Chapter 6 for more on this topic) to show the game action underneath.

            The easiest way to make a smaller version of the in-game level is to go into your 3-D
            editor and load up the level of the small map that you want to construct.

             

            Loading and Displaying Auto Maps

            Okay, the small auto map is created and waiting to be used. What you need to do at
            this point is load the .X file and query it for the individual meshes contained
            within. Using the Graphics Core’s cMesh object is perfect for loading the mesh.

            Now, you construct an array of vertex buffers—one for each mesh in the auto map.
            You fill each vertex buffer with the triangle face data from each mesh in the cMesh
            object. The trick at this point is that although you are copying the vertex data from
            the mesh to the vertex buffer, the Y-coordinate is tossed out so that the resulting
            vertex buffer mesh is flat, and thus the 2-D look of the auto map.

            To display the loaded map, you just position a camera, set up a viewport to render
            to on the display, and render each vertex buffer. With auto mapping in place, you
            can skip rendering the vertex buffers that represent sections of the map that have
            not been visited by the character.

            Although the concept sounds simple, get a jump on things by looking at some
            working code.

            posted on 2007-12-10 15:11 lovedday 閱讀(221) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關(guān)鏈接

            搜索

            最新評論

            久久久久亚洲精品天堂| 99久久精品费精品国产| 久久综合偷偷噜噜噜色| 亚洲欧美伊人久久综合一区二区| av无码久久久久不卡免费网站 | 亚洲国产一成久久精品国产成人综合| 亚洲欧洲久久久精品| 久久99精品国产99久久6男男| 亚洲欧美成人久久综合中文网 | 久久一区二区免费播放| 久久综合给合久久狠狠狠97色| 国产精品狼人久久久久影院| 综合人妻久久一区二区精品| 精品久久久无码中文字幕天天| 99精品国产免费久久久久久下载| 成人资源影音先锋久久资源网| 免费无码国产欧美久久18| 久久香蕉一级毛片| 久久精品aⅴ无码中文字字幕不卡| 香蕉久久永久视频| 久久噜噜电影你懂的| 无码国产69精品久久久久网站| 天天影视色香欲综合久久| 91麻豆精品国产91久久久久久| 1000部精品久久久久久久久| 久久精品国产精品亚洲精品| 亚洲国产成人久久综合野外| 久久久WWW成人| 久久精品国产亚洲Aⅴ香蕉| 亚洲乱亚洲乱淫久久| 潮喷大喷水系列无码久久精品| 久久久无码精品亚洲日韩蜜臀浪潮| 久久久久久综合网天天| 中文字幕精品无码久久久久久3D日动漫 | 亚洲国产精品久久| 久久99国产精品99久久| 国产成年无码久久久久毛片| 国产精品毛片久久久久久久| 久久99精品国产| 国产香蕉97碰碰久久人人| 国产一区二区精品久久岳|