Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/138.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Qt:显示三维长方体的边_C++_Qt_Qt3d - Fatal编程技术网

C++ Qt:显示三维长方体的边

C++ Qt:显示三维长方体的边,c++,qt,qt3d,C++,Qt,Qt3d,我正在使用绘制相交的长方体。除了没有显示的边之外,所有东西都很好。我在QCuboidMesh和qpongalphamaterial中检查了属性,但我找不到这样的属性 守则: SceneModifier::SceneModifier(Qt3DCore::QEntity *rootEntity) : m_rootEntity(rootEntity) { //Outer Cuboid shape data cuboid = new Qt3DExtras::QCuboidMe

我正在使用绘制相交的长方体。除了没有显示的边之外,所有东西都很好。我在
QCuboidMesh
qpongalphamaterial
中检查了属性,但我找不到这样的属性

守则:

SceneModifier::SceneModifier(Qt3DCore::QEntity *rootEntity)
    : m_rootEntity(rootEntity)
{

    //Outer Cuboid shape data
    cuboid = new Qt3DExtras::QCuboidMesh();
    cuboid->setXExtent(4);
    cuboid->setYExtent(4);
    cuboid->setZExtent(8);
    // CuboidMesh Transform
    Qt3DCore::QTransform *cuboidTransform = new Qt3DCore::QTransform();

    Qt3DExtras::QPhongAlphaMaterial *cuboidMaterial = new Qt3DExtras::QPhongAlphaMaterial();
    cuboidMaterial->setDiffuse(QColor(QRgb(0xff0ff0)));
    cuboidMaterial->setAlpha(0.5);

    //Cuboid
    m_cuboidEntity = new Qt3DCore::QEntity(m_rootEntity);
    m_cuboidEntity->addComponent(cuboid);
    m_cuboidEntity->addComponent(cuboidMaterial);

    // Inner Cuboid shape data
     cuboid2 = new Qt3DExtras::QCuboidMesh();
     cuboid2->setXExtent(2);
     cuboid2->setYExtent(2);
     cuboid2->setZExtent(8);


     Qt3DExtras::QPhongMaterial *cuboidMaterial2 = new Qt3DExtras::QPhongMaterial();
     cuboidMaterial2->setDiffuse(QColor(QRgb(0xffffff)));

     //Cuboid

     m_cuboidEntity2 = new Qt3DCore::QEntity(m_rootEntity);

     m_cuboidEntity2->addComponent(cuboid2);
     m_cuboidEntity2->addComponent(cuboidMaterial2);

     Qt3DCore::QTransform* cuboidTransform3 = new Qt3DCore::QTransform();
     cuboidTransform3->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(0.1f, -0.1f, 0.0f), 45.0f));

     m_rootEntity->addComponent(cuboidTransform3);
}

应该提供很多你要找的细节。输出正是我需要的,但是如何实现还不清楚。创建的<代码> WiReMaMeMaturia<代码>使用2个属性来设置边,这些代码是“代码>线宽和 LICOLOLOR <代码>,这在C++类或其他任何子类。线宽和线色中找不到。属性添加到从QMaterial继承的材质QML类型(请参见WireframeMeterial.QML文件)。是的,我看到了这一点,但不清楚这两个添加的功能是如何使用的。在QML我不知道事情是如何运作的,但是我不认为仅仅添加2个属性就能解决C++中的这个问题。我刚刚意识到在线文档是不完整的。有问题的属性在片段着色器中用作一致性,但缺少该文件。您必须下载才能获得它。应该提供很多你要找的细节。输出正是我需要的,但是如何实现还不清楚。创建的<代码> WiReMaMeMaturia<代码>使用2个属性来设置边,这些代码是“代码>线宽和 LICOLOLOR <代码>,这在C++类或其他任何子类。线宽和线色中找不到。属性添加到从QMaterial继承的材质QML类型(请参见WireframeMeterial.QML文件)。是的,我看到了这一点,但不清楚这两个添加的功能是如何使用的。在QML我不知道事情是如何运作的,但是我不认为仅仅添加2个属性就能解决C++中的这个问题。我刚刚意识到在线文档是不完整的。有问题的属性在片段着色器中用作一致性,但缺少该文件。您必须下载才能获得它。