• <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>

            天行健 君子當自強而不息

            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)  編輯 收藏 引用

            公告

            導航

            統計

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關鏈接

            搜索

            最新評論

            久久五月精品中文字幕| 久久人人爽人人澡人人高潮AV| 精品国产乱码久久久久久呢| 精品国产91久久久久久久| 久久精品一区二区三区中文字幕| 久久人人超碰精品CAOPOREN| 久久精品人人槡人妻人人玩AV| 狠狠色伊人久久精品综合网| 国产精品无码久久久久久| 深夜久久AAAAA级毛片免费看| 久久久精品久久久久久 | 久久久噜噜噜久久| 国内精品久久九九国产精品| 精品久久久久久成人AV| 色婷婷久久久SWAG精品| 久久国产精品视频| 亚洲国产精品综合久久网络 | 中文字幕久久精品| 久久久久人妻精品一区 | 欧美日韩精品久久久久| 久久精品这里只有精99品| 欧美激情精品久久久久久久| 久久伊人精品青青草原日本| 色悠久久久久久久综合网| 四虎亚洲国产成人久久精品| 国内精品综合久久久40p| 97久久国产亚洲精品超碰热| 久久精品国产亚洲av麻豆小说| segui久久国产精品| 无码人妻少妇久久中文字幕蜜桃| 国产精品视频久久久| 久久精品免费一区二区| 久久久精品波多野结衣| 久久久久久久精品成人热色戒| 精品久久久久久国产| 狠狠综合久久综合88亚洲| 亚洲午夜无码久久久久小说| 四虎国产精品免费久久久| 国内精品久久久久影院免费| 久久婷婷午色综合夜啪| 囯产精品久久久久久久久蜜桃|