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

            的筆記

            隨時隨地編輯

            PagedGeometry筆記

            PagedGeometry版本:1.1

            ONE.靜態(tài)樹
            a).創(chuàng)建PagedGeometry對象,用于管理草體的細節(jié)
            PagedGeometry *trees = new PagedGeometry();
            1    trees->setCamera(camera);    //Set the camera so PagedGeometry knows how to calculate LODs
            2    trees->setPageSize(80);    //Set the size of each page of geometry
            3    trees->setInfinite();        //Use infinite paging mode
            4    trees->addDetailLevel<BatchPage>(15050);        //Use batches up to 150 units away, and fade for 30 more units
            5    trees->addDetailLevel<ImpostorPage>(50050);    //Use impostors up to 400 units, and for for 50 more units


            b).創(chuàng)建草體加載器,用于加載加載草體,鋪草
            TreeLoader3D *treeLoader = new TreeLoader3D(trees, TBounds(0, 0, 1500,1500));

            c).幀循環(huán)中進行更新
            trees->update();

            其內(nèi)部有3個動作:
            1.更新loader
            2.更新內(nèi)部對象:GeometryPageManager
            3. Update misc. subsystems

            StaticBillboardSet::updateAll(_convertToLocal(getCamera()->getDerivedDirection()));


            d).退出時清理內(nèi)存



            TWO.動態(tài)草體

            動態(tài)草和靜態(tài)樹的創(chuàng)建如出一轍,只是將植物加載器換從“TreeLoader3D”換成了“GrassLoader”而已,順利成章的,如果要家長其他不同類的植物,只需使用一個該植物的“XXXLoader”即可。其實整個PagedGeometry中的加載器只有三個,PageLoader派生了3個加載器:
             - Forests::GrassLoader
             - Forests::TreeLoader2D
             - Forests::TreeLoader3D

            GrassLoader創(chuàng)建如下:
            GrassLoader借助一個GrassLayer對象來“植樹”:

            a).源碼中隊GrassLayer的說明

            A data structure giving you full control over grass properties.Grass is added to the scene through GrassLoader::addLayer(). Through this class you can configure your grass layer any way you like - size, density, render technique,animation, etc. Simply call the appropriate "set" member function to set the desired property.Remember that you cannot create or delete layers directly. Layers can only be created with GrassLoader::addLayer(), and may not be deleted manually (they will be deleted when the associated GrassLoader is deleted).
             - GrassLayer只能通過GrassLoader::addLayer()來創(chuàng)建
             - GrassLoader不能直接創(chuàng)建或刪除
             - GrassLoader不能進行手動刪除

                addlayer傳給GrassLayer的參數(shù)是一個字符串,這個字符串是一個material的名字,以便渲染手動創(chuàng)建的草體mesh時使用。


            b).草實體的創(chuàng)建
            草體是在GrassLoader::loadPage中創(chuàng)建的

                                mesh = generateGrass_QUAD(page, layer, position, grassCount);

            而loadPage是在幀循環(huán)調(diào)用“GeometryPageManager::update”時調(diào)用的,通過GeometryPageManager::update的“cacheInterval”技術(shù)實現(xiàn)渲染前調(diào)用一次,好比在幀循環(huán)中設(shè)置一個標志位,如果發(fā)現(xiàn)草實體沒有創(chuàng)建,則創(chuàng)建之。這里的generateGrass_QUAD實現(xiàn)了一個手動創(chuàng)建mesh的方法。

            THREE.靜態(tài)樹和動態(tài)草一起

            創(chuàng)建2個PagedGeometry對象,分別互不干涉的各管各即可。當然需要在幀循環(huán)中分別更新了。


            FOUR.2D樹和3D樹的區(qū)別

            If the inability to supply a vertical coordinate to addTree() is too limiting, or you are unable to implement
            a fast enough height function, please refer to TreeLoader3D. TreeLoader3D allows you to provide full 3D x/y/z
            coordinates, although 40% more memory is required per tree.
            更多說明見<pagedGeometry-1.1.0\include\TreeLoader2D.h>
             - 2D樹非常省內(nèi)存
             - 2D樹對放置的3D坐標有限制
             - 3D樹可以設(shè)置完全的3D坐標
             - 3D樹的每一顆樹都比2D樹多占用40%的內(nèi)存

            posted on 2011-05-23 16:27 的筆記 閱讀(367) 評論(0)  編輯 收藏 引用

            丰满少妇人妻久久久久久4| 国产精品久久久久久久app| 久久精品中文字幕一区| 日韩亚洲欧美久久久www综合网| 一本一道久久精品综合| 欧洲人妻丰满av无码久久不卡| 精品国产乱码久久久久久1区2区| 97久久天天综合色天天综合色hd| 99久久精品无码一区二区毛片| 久久无码一区二区三区少妇 | 97热久久免费频精品99| 亚洲欧美成人久久综合中文网| 激情伊人五月天久久综合| 亚洲精品高清国产一线久久| 久久久91人妻无码精品蜜桃HD| 99久久久国产精品免费无卡顿 | 亚洲精品tv久久久久| 91超碰碰碰碰久久久久久综合| 久久国产精品国产自线拍免费| 高清免费久久午夜精品| 久久青草国产手机看片福利盒子| 国产精品久久久久久久久鸭 | 久久久精品人妻无码专区不卡 | 久久精品视频免费| 久久精品成人欧美大片| 欧美日韩成人精品久久久免费看| 亚洲国产日韩欧美综合久久| 亚洲国产美女精品久久久久∴| 日本WV一本一道久久香蕉| 久久久国产乱子伦精品作者| 中文字幕无码久久久| 亚洲一本综合久久| 久久国产色AV免费看| 国产精品久久婷婷六月丁香| 国产成人精品久久亚洲| 精品少妇人妻av无码久久| 人妻无码αv中文字幕久久琪琪布| 国产精品内射久久久久欢欢| 少妇人妻88久久中文字幕| 久久经典免费视频| 中文国产成人精品久久亚洲精品AⅤ无码精品 |