Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. Qt3D.Renderer.Jobs: unsupported format encountered (obj)
Qt 6.11 is out! See what's new in the release blog

Qt3D.Renderer.Jobs: unsupported format encountered (obj)

Scheduled Pinned Locked Moved Unsolved Chinese
1 Posts 1 Posters 410 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LorenzoGao
    wrote on last edited by
    #1
    import QtQuick.Controls 2.2
    
    ApplicationWindow {
        visible: true
        width: 640
        id:_window
        height: 480
        title: qsTr("3D Viewer")
        
        
        
        MainPage{}
    
    }
    

    MainPage.qml

    import QtQuick 2.12
    import QtQuick.Scene3D 2.0
    import Qt3D.Core 2.12
    import Qt3D.Render 2.12
    import Qt3D.Input 2.12
    import Qt3D.Extras 2.12
    
    
    
    Scene3D {
    
        anchors.fill: parent
    
        aspects: ["input", "logic"]
        cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
    
    
        Entity {
            id: sceneRoot
            Camera {
                id: camera
                projectionType: CameraLens.PerspectiveProjection
                fieldOfView: 45
                aspectRatio: 16/9
                nearPlane : 0.1
                farPlane : 1000.0
                position: Qt.vector3d( 0.0, 0.0, -40.0 )
                upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
                viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
            }
            OrbitCameraController {
                camera: camera
            }
            components: [
                RenderSettings {
                    activeFrameGraph: ForwardRenderer {
                        clearColor: Qt.rgba(0, 0.5, 1, 1)
                        camera: camera
                    }
                },
    
                InputSettings { }
            ]
            Entity {
                    id: topplane
                    PhongMaterial {
                        id: material
                    }
    
                    Mesh
                                    {
                                        id: toyplaneMesh
                                        source: "qrc:/asstes/test.obj"
                                    }
                    components: [toyplaneMesh, material]
            }
        }
    }
    
    

    项目目录
    f89eef60-ab99-45a5-9d54-8da63468c8f6-image.png

    控制台输出:
    3d5194b4-e80e-455a-ae41-843fb9318aa2-image.png

    使用SceneLoader 加载test.obj 是可以显示得

    运行环境:
    Ubuntu 20.04
    Qt 5.12.8

    1 Reply Last reply
    0
    • SGaistS SGaist moved this topic from General and Desktop on

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved