• <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>
            AstaTus
            -- 夏天不熱。。
            posts - 22,comments - 12,trackbacks - 0
               這個是攝像機繞食人魔頭的一個demo,
            其中的關鍵就在于攝像機的自動繞行 和 攝像機一直朝向食人魔頭,

            ogre這引擎似乎什么都幫你想到了,很多的函數都已封裝好,就怕你找不到

            以下的是這個demo關鍵代碼,都是在createscene里的,我給了下具體的解釋:
            // Make sure the camera track this node
                    mCamera->setAutoTracking(true, headNode);    //這里讓攝像機總是朝著魔頭

                    // Create the camera node & attach camera
                    SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
                    camNode
            ->attachObject(mCamera);

                    
            // set up spline animation of node
                    Animation* anim = mSceneMgr->createAnimation("CameraTrack"10);    //這里的10指代這個攝像機繞一圈要花10秒鐘,至于這10秒鐘怎么分,在下面關鍵幀設置中會分配

                    
            // Spline it for nice curves
                    anim->setInterpolationMode(Animation::IM_LINEAR); //設置兩點間移動時的插值類型,有線型和弧線型兩種,什么效果大家自個試吧
                    
            // Create a track to animate the camera's node
            //以下就要設置相機繞行的軌跡了
                    NodeAnimationTrack* track = anim->createNodeTrack(0, camNode);
                    
            // Setup keyframes
            //關鍵幀就10幀,這與動畫的總時間10剛好對應
                    TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
                    key = track->createNodeKeyFrame(2.5);
                    key
            ->setTranslate(Vector3(500,500,-1000));
                    key 
            = track->createNodeKeyFrame(5);
                    key
            ->setTranslate(Vector3(-1500,1000,-600));
                    key 
            = track->createNodeKeyFrame(7.5);
                    key
            ->setTranslate(Vector3(0,-100,0));
                    key 
            = track->createNodeKeyFrame(10);
                    key
            ->setTranslate(Vector3(0,0,0));
                    
            // Create a new animation state to track this
                    mAnimState = mSceneMgr->createAnimationState("CameraTrack");
                    mAnimState
            ->setEnabled(true);
            關鍵幀設置的那8行代碼其實就是說從0~2.5秒 攝像機從起始點移動到(500, 500, -1000),后面幾行同理


            該demo中的createplane函數還是有點不明白
             MeshPtr createPlane(
                        const String& name, const String& groupName, const Plane& plane,
                        Real width, Real height,
                        int xsegments = 1, int ysegments = 1,
                        bool normals = true, int numTexCoordSets = 1,
                        Real uTile = 1.0f, Real vTile = 1.0f,   //這個tile啥意思啦??????????????????
             const Vector3& upVector = Vector3::UNIT_Y,
               HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
               HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
               bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
            posted on 2008-09-07 20:45 AstaTus 閱讀(1102) 評論(0)  編輯 收藏 引用 所屬分類: Ogre
            国产色综合久久无码有码| 99久久精品免费看国产免费| 久久久91人妻无码精品蜜桃HD | 99精品久久久久久久婷婷| 久久久久黑人强伦姧人妻| 性做久久久久久久久老女人| 婷婷久久五月天| 精品久久久久久综合日本| 欧美午夜精品久久久久久浪潮| 精品国产乱码久久久久软件 | 久久午夜福利电影| 精品人妻伦九区久久AAA片69| 久久综合狠狠综合久久激情 | 麻豆精品久久久久久久99蜜桃| 99久久精品免费国产大片| 久久偷看各类wc女厕嘘嘘| 99久久国产综合精品成人影院| 人妻少妇久久中文字幕| 模特私拍国产精品久久| 久久精品国产精品亜洲毛片| 久久91精品国产91久久麻豆| 伊人久久精品无码二区麻豆| 色婷婷狠狠久久综合五月| 国产成人久久777777| 91久久精品无码一区二区毛片| 久久中文骚妇内射| 午夜精品久久久久久久| 久久亚洲AV成人无码软件| 久久伊人色| 久久综合久久鬼色| 久久精品亚洲精品国产欧美| 国产午夜福利精品久久| 日本久久久久久中文字幕| 国产日产久久高清欧美一区| 精品久久久久久国产潘金莲| 久久精品亚洲日本波多野结衣| 69SEX久久精品国产麻豆| 精品久久8x国产免费观看| 久久99国产亚洲高清观看首页 | 国内精品久久久久影院日本| 亚洲AV无码成人网站久久精品大|