本文整理汇总了C++中FileObject::setPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ FileObject::setPosition方法的具体用法?C++ FileObject::setPosition怎么用?C++ FileObject::setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileObject
的用法示例。
在下文中一共展示了FileObject::setPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeObjects
void GLWidget::initializeObjects()
{
Material* material = new Material();
material->setSpecular(QVector4D(1.0, 1.0, 1.0, 1.0));
material->setShihiness(70.0f);
Material* material2 = new Material();
material2->setDiffuse(QVector4D(0.3, 0.3, 1.0, 1.0));
Material* material3 = new Material();
material3->setAmbient(QVector4D(0.4, 1.0, 0.3, 1.0));
GLenum errCode;
if ((errCode = glGetError()) != GL_NO_ERROR) {
qDebug() << "initObjects after mat OpenGL Error: " << errCode;
}
GridNStuff* g = new GridNStuff();
g->lineAA(QVector3D(75, 50, -25), QVector3D(-75, -50, 25));
g->lineAA(QVector3D(50, 50, 50), QVector3D(-50, -50, -50));
g->circleMid(QVector2D(0,0), 50);
g->setPosition(QVector3D(3, 0, -15));
g->setScale(3.0f);
g->setMaterial(material2);
g->gridPlane();
this->_append(g);
FileObject* monkey = new FileObject();
monkey->readFile("textured.obj");
monkey->setPosition(QVector3D(-3, 0, -15));
this->_append(monkey);
this->_append(monkey);
FileObject* room = new FileObject();
room->readFile("floor.obj");
room->setPosition(QVector3D(0, -4, -15));
this->_append(room);
if ((errCode = glGetError()) != GL_NO_ERROR) {
qDebug() << "initObjects after append OpenGL Error: " << errCode;
}
Light* light = new Light();
Camera* cam = new Camera();
cam->position = QVector4D(0.0f, 15.0f, -10.0f, 1.0f);
cam->theta = -45.0f;
cam->beta = 0.0f;
cam->calculateDirection();
light->setCamera(cam);
this->_lights.append(light);
QObject::connect(light, SIGNAL(redraw()), this, SLOT(updateGL()));
QObject::connect(this, SIGNAL(animateChild()), light, SLOT(animate()));
if ((errCode = glGetError()) != GL_NO_ERROR) {
qDebug() << "initObjects END OpenGL Error: " << errCode;
}
}