Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.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
如何正确处理QML中的Scene3D?_Qml_Qt5_Qt3d - Fatal编程技术网

如何正确处理QML中的Scene3D?

如何正确处理QML中的Scene3D?,qml,qt5,qt3d,Qml,Qt5,Qt3d,对于我的项目,我需要将QtQuick.Scene3D放在QtQuick.Component中 场景已成功创建,但当我尝试处置组件时,出现了错误 0 Qt3D::QCamera::position() const 0xb7226e6b 1 Qt3D::QCamera::translate(QVector3D const&, Qt3D::QCamera::CameraTranslationOption) 0xb7226fa4 对象似乎是按错误的顺序删除的。因此,有一个问题

对于我的项目,我需要将QtQuick.Scene3D放在QtQuick.Component中 场景已成功创建,但当我尝试处置组件时,出现了错误

0   Qt3D::QCamera::position() const 0xb7226e6b  
1   Qt3D::QCamera::translate(QVector3D const&, Qt3D::QCamera::CameraTranslationOption)  0xb7226fa4  
对象似乎是按错误的顺序删除的。因此,有一个问题:我应该在C++中实现整个对象图,或者有一个正确的方法来使ScEn3d可重写?< /P> 这是我的组件qml文件:

import Qt3D 2.0
import Qt3D.Renderer 2.0
import QtQuick.Scene3D 2.0
import QtQuick 2.0 as QQ2
import CeGui 1.0;
import VectorPlot 1.0;

QQ2.Component {
    QQ2.Item {
        Scene3D {
            anchors.fill: parent
            id: rootscene
            aspects: "input"

            Entity {
                id: sceneRoot

                Camera {
                    id: camera
                    projectionType: CameraLens.PerspectiveProjection
                    fieldOfView: 45
                    aspectRatio: 16/9
                    nearPlane : 0.1
                    farPlane : 1000.0
                    position: Qt.vector3d( 25.0, -25.0, 25.0 )
                    upVector: Qt.vector3d( 0.0, 0.0, 1.0 )
                    viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
                }

                Configuration  {
                    id: cfg
                    controlledCamera: camera
                }

                Viewport {
                    id: viewport
                    rect: Qt.rect(0.0, 0.0, 1.0, 1.0) // From Top Left
                    clearColor: Qt.rgba(0, 0.5, 1, 1)

                    CameraSelector {
                        id : cameraSelector
                        camera: camera
                        ClearBuffer {
                            buffers : ClearBuffer.ColorDepthBuffer
                        }
                    }
                }

                components: [
                    FrameGraph {
                        id: framgraph
                        activeFrameGraph: viewport
                    }
                ]

                BarChartScene {
                    id: bcs
                    model: GlobalViewModel.harmonicsEditModel
                }
            }
        }
    }
}
我在Linux中对32位gcc使用Qt5.5,这似乎是在即将发布的版本中