我在Blender中创建了一个平面,并将其作为QCustom3DItem添加到了Qt chart。
但是在旋转图形时,我发现看不到平面的另一面,为什么?
#include <QtWidgets>
#include <Q3DBars>
#include <QCustom3DItem>
using namespace QtDataVisualization;
MainWidget::MainWidget(QWidget *parent) : QWidget(parent)
{
resize(800,600);
auto vLayout = new QVBoxLayout(this);
auto graph = new Q3DBars;
auto widget = QWidget::createWindowContainer(graph);
vLayout->addWidget(widget);
auto bar = new QCustom3DItem;
bar->setMeshFile(":mesh/planey.obj");
bar->setScaling(QVector3D(.1f,.8f,.1f));
graph->addCustomItem(bar);
}
# Blender v2.81 (sub 16) OBJ File: ''
# www.blender.org
o Plane
v 0.000000 2.000000 1.000000
v -0.000000 0.000000 1.000000
v 0.000000 2.000000 -1.000000
v -0.000000 0.000000 -1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vn 1.0000 -0.0000 0.0000
s off
f 2/1/1 3/2/1 1/3/1
f 2/1/1 4/4/1 3/2/1
因为面部剔除
发生。