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


C++ CObject::setMode方法代码示例

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


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

示例1: init_objects

    void init_objects()
    {
      { // plane
        ogl::CPlaneObjectBuilder* pObjectBuilder = new ogl::CPlaneObjectBuilder;
        pObjectBuilder->setWidth(20.0f);
        pObjectBuilder->setHeight(20.0f);
        pObjectBuilder->setSubdivisions(1);
        // pObjectBuilder->addOption(ogl::CObjectBuilder::INVERTED);
        pObjectP = pObjectBuilder->build();
        delete pObjectBuilder;
      }
      { // box from box-builder
//        ogl::CBoxObjectBuilder* pObjectBuilder = new ogl::CBoxObjectBuilder;
//        pObjectBuilder->setWidth(1.0f);
//        pObjectBuilder->setHeight(1.0f);
//        pObjectBuilder->setDepth(1.0f);
//        pObject = pObjectBuilder->build();
//        pObject->setM(math::translate(0.0f, -1.0f, 5.0f) * math::scale(10.0f));
//        delete pObjectBuilder;
      }
      { // random mesh
        ogl::CAssimpObjectBuilder* pObjectBuilder = new ogl::CAssimpObjectBuilder;
        pObjectBuilder->setFile("box/box.obj");
        pObjectBuilder->addOption(ogl::CObjectBuilder::NORMALIZED);
        pObject1 = pObjectBuilder->build();
        pObject1->setM(math::translate(0.0f, 0.0f, 2.0f));
        delete pObjectBuilder;
      }
      { // skybox
        ogl::CAssimpObjectBuilder* pObjectBuilder = new ogl::CAssimpObjectBuilder;
        pObjectBuilder->setFile("skybox/skydome.obj");
        pObjectBuilder->addOption(ogl::CObjectBuilder::NORMALIZED);
        pObjectS = pObjectBuilder->build();
        pObjectS->setM(math::scale(20.0f));
        delete pObjectBuilder;
      }
      { // billboarding
        ogl::CPlaneObjectBuilder* pObjectBuilder = new ogl::CPlaneObjectBuilder;
        pObjectBuilder->setWidth(18.0f);
        pObjectBuilder->setHeight(18.0f);
        pObjectBuilder->setSubdivisions(6);
        // pObjectBuilder->addOption(ogl::CObjectBuilder::INVERTED);
        pObjectB = pObjectBuilder->build();
        delete pObjectBuilder;
        
        ogl::CPngTextureBuilder* pTextureBuilder = new ogl::CPngTextureBuilder;
        pTextureBuilder->setFile("monster.png");
        ogl::CTexture* pTexture = pTextureBuilder->build();
        pTexture->setWrapping(ogl::CTexture::EWrapping::CLAMP_TO_BORDER);
        delete pTextureBuilder;
        
        ogl::CMaterial* pMaterial = new ogl::CMaterial;
        pMaterial->setTexture(ogl::CTexture::EScope::DIFFUSE, pTexture);
        
        pObjectB->setMode(GL_POINTS);
        pObjectB->getShape(0)->setMaterial(pMaterial);
      }
    }
开发者ID:raduionita,项目名称:project-morpheus,代码行数:58,代码来源:COGLDev07BillboardingApp.hpp


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