当前位置: 首页>>代码示例>>C++>>正文


C++ State::getModelViewMatrix方法代码示例

本文整理汇总了C++中osg::State::getModelViewMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ State::getModelViewMatrix方法的具体用法?C++ State::getModelViewMatrix怎么用?C++ State::getModelViewMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::State的用法示例。


在下文中一共展示了State::getModelViewMatrix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawImplementation

	virtual void drawImplementation(osg::State& state,const osg::Drawable* drawable) const 
	{
		static osg::TexMat *tm= new osg::TexMat();
		osg::Matrix mvm(state.getModelViewMatrix());
		osg::Quat q;
		q.set(mvm);
//		state.getorcre
		tm->setMatrix(osg::Matrix::rotate( q.inverse() ));
		state.applyTextureAttribute(1,tm);
//		drawable->getOrCreateStateSet()->
		drawable->drawImplementation(state);
	}
开发者ID:BackupTheBerlios,项目名称:eu07-svn,代码行数:12,代码来源:terrainMaterial.cpp

示例2: apply

        virtual void apply(osg::State& state) const
        {
            osg::Matrix modelViewMatrix = state.getModelViewMatrix();

            state.applyModelViewMatrix(state.getInitialViewMatrix());

            for (unsigned int i=0; i<mLights.size(); ++i)
            {
                mLights[i]->setLightNum(i+mIndex);
                mLights[i]->apply(state);
            }

            state.applyModelViewMatrix(modelViewMatrix);
        }
开发者ID:Pjstaab,项目名称:openmw,代码行数:14,代码来源:lightmanager.cpp

示例3:

void Text3D::renderPerGlyph(osg::State & state) const
{
    osg::Matrix original_modelview = state.getModelViewMatrix();

    // ** for each line, do ...
    TextRenderInfo::const_iterator itLine, endLine = _textRenderInfo.end();
    for (itLine = _textRenderInfo.begin(); itLine!=endLine; ++itLine)
    {
        // ** for each glyph in the line, do ...
        LineRenderInfo::const_iterator it, end = itLine->end();
        for (it = itLine->begin(); it!=end; ++it)
        {

            osg::ref_ptr<osg::RefMatrix> matrix = new osg::RefMatrix(original_modelview);
            matrix->preMultTranslate(osg::Vec3d(it->_position.x(), it->_position.y(), it->_position.z()));
            state.applyModelViewMatrix(matrix.get());

            // ** apply the vertex array
            state.setVertexPointer(it->_glyph->getVertexArray());

            // ** render the front face of the glyph
            state.Normal(0.0f,0.0f,1.0f);

            osg::Geometry::PrimitiveSetList & pslFront = it->_glyph->getFrontPrimitiveSetList();
            for(osg::Geometry::PrimitiveSetList::const_iterator itr=pslFront.begin(), end = pslFront.end(); itr!=end; ++itr)
            {
                (*itr)->draw(state, false);
            }

            // ** render the wall face of the glyph
            state.setNormalPointer(it->_glyph->getNormalArray());
            osg::Geometry::PrimitiveSetList & pslWall = it->_glyph->getWallPrimitiveSetList();
            for(osg::Geometry::PrimitiveSetList::const_iterator itr=pslWall.begin(), end=pslWall.end(); itr!=end; ++itr)
            {
                (*itr)->draw(state, false);
            }
            state.disableNormalPointer();

            // ** render the back face of the glyph
            state.Normal(0.0f,0.0f,-1.0f);

            osg::Geometry::PrimitiveSetList & pslBack = it->_glyph->getBackPrimitiveSetList();
            for(osg::Geometry::PrimitiveSetList::const_iterator itr=pslBack.begin(), end=pslBack.end(); itr!=end; ++itr)
            {
                (*itr)->draw(state, false);
            }
        }
    }
}
开发者ID:seafengl,项目名称:osg-by-google,代码行数:49,代码来源:Text3D.cpp


注:本文中的osg::State::getModelViewMatrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。