本文整理汇总了C++中ogl::CObject::setM方法的典型用法代码示例。如果您正苦于以下问题:C++ CObject::setM方法的具体用法?C++ CObject::setM怎么用?C++ CObject::setM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogl::CObject
的用法示例。
在下文中一共展示了CObject::setM方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: init_objects
void init_objects()
{
{ // plane
ogl::CPlaneObjectBuilder* pObjectBuilder = new ogl::CPlaneObjectBuilder;
pObjectBuilder->setWidth(10.0f);
pObjectBuilder->setHeight(10.0f);
pObjectBuilder->setSubdivisions(10);
//pObjectBuilder->addOption(ogl::CPlaneObjectBuilder::REPEAT_UV);
pObjectBuilder->addOption(ogl::CPlaneObjectBuilder::TANGENTS);
//pObjectBuilder->addOption(ogl::CObjectBuilder::INVERTED);
pObjectP = pObjectBuilder->build();
ogl::CDdsTextureBuilder* pTextureBuilder = new ogl::CDdsTextureBuilder;
pTextureBuilder->setFile("ground/rocks_d.dds");
pObjectP->getShape(0)->getMaterial()->setTexture(ogl::CTexture::EScope::DIFFUSE, pTextureBuilder->build());
pTextureBuilder->setFile("ground/rocks_h.dds");
pObjectP->getShape(0)->getMaterial()->setTexture(ogl::CTexture::EScope::HEIGHT, pTextureBuilder->build()); // displacement
delete pObjectBuilder;
}
{
ogl::CAssimpObjectBuilder* pObjectBuilder = new ogl::CAssimpObjectBuilder;
pObjectBuilder->setFile("monkey/monkey.obj");
pObjectBuilder->addOption(ogl::CObjectBuilder::NORMALIZED);
pObject0 = pObjectBuilder->build();
pObject0->setM(math::translate(0.0f, 2.0f, 0.0f) * math::rotate(-90.0f, math::X));
delete pObjectBuilder;
}
}
示例3: load_objects
void load_objects()
{
ogl::CBoxObjectBuilder* pObjectBuilder = new ogl::CBoxObjectBuilder;
pObjectBuilder->setWidth(1.0f);
pObjectBuilder->setHeight(1.0f);
pObjectBuilder->setDepth(1.0f);
pObject = pObjectBuilder->build();
pObject->setM(math::rotate(45.0f, math::Z) * math::translate(0.0f, 0.0f, 4.0f));
delete pObjectBuilder;
}
示例4: init_objects
void init_objects()
{
{
ogl::CPlaneObjectBuilder* pObjectBuilder = new ogl::CPlaneObjectBuilder;
pObjectBuilder->setWidth(10.0f);
pObjectBuilder->setHeight(10.0f);
pObjectBuilder->setSubdivisions(1);
// pObjectBuilder->addOption(ogl::CObjectBuilder::INVERTED);
pObjectQ = pObjectBuilder->build();
delete pObjectBuilder;
}
{
// 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;
}
{
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;
}
{
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;
}
}