Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Qt3DRenderer::QCamera Alternative
QtWS25 Last Chance

Qt3DRenderer::QCamera Alternative

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
7 Posts 5 Posters 854 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.
  • V Offline
    V Offline
    VenomousByte
    wrote on last edited by
    #1

    Hi,
    absolute newbe to this forum so please forgive (and tell) me if I'm doing somthing terribly wrong.

    I'm looking to port a Qt-application to WebAssembly but am stuck. The application allows the user to "fly" through 3D space using a first person type camera. The issue here is, that the Qt3DRenderer::QCamera is used to facilitate this movement, but does not seem to be supported by WebAssembly.

    The question I now have is: am I just out of luck and it can't be done, or is there some alternative for a first person camera with free 3D movement that is supported by WebAssembly?

    This is how I create the *.pro file (and add some include directories):

    @echo off
    
    set QT_DIR=C:\...
    
    START /WAIT %QT_DIR%\wasm_32\bin\qmake -project
    
    ECHO # Additional Include Paths >> .\app.pro
    ECHO INCLUDEPATH += .\..\.. >> .\app.pro
    ECHO INCLUDEPATH += %QT_DIR%\wasm_32\include\QtWidgets >> .\app.pro
    ECHO INCLUDEPATH += %QT_DIR%\wasm_32\include\QtMultimedia >> .\app.pro
    ECHO # Define Cpp Version >> .\app.pro
    ECHO CONFIG += c++1z >> .\app.pro
    ECHO # Suppress Warnings >> .\app.pro
    ECHO CONFIG += warn_off >> .\app.pro
    

    This is how I try to compile the whole thing into WebAssembly:

    set QT_DIR=C:\...
    set VS_COMPILER_TOOLS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\..."
    
    set PATH=%VS_COMPILER_TOOLS_PATH%\cl.exe;%PATH%
    
    call E:\pcr\emsdk\emsdk.bat activate
    START /WAIT %QT_DIR%\msvc2017_64\bin\uic app.ui -o ui_app.h
    START /WAIT %QT_DIR%\wasm_32\bin\qmake
    make
    

    And these are the error messages ...
    ... without adding %QT_DIR%\msvc2017_64\include as include location to the project file:

    ..\..\tools/app/apprenderwidget.h:19:10: fatal error: 'Qt3DRender/QCamera' file not found
    

    ... after adding %QT_DIR%\msvc2017_64\include as include location to the project file:
    (basically a bunch of undefined symbol errors, which include but are not limited to the QCamera functions)

    ...
    warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
    ...
    error: undefined symbol: _ZN10Qt3DRender7QCamera11setPositionERK9QVector3D
    error: undefined symbol: _ZN10Qt3DRender7QCamera11setUpVectorERK9QVector3D
    error: undefined symbol: _ZN10Qt3DRender7QCamera13setViewCenterERK9QVector3D
    error: undefined symbol: _ZN10Qt3DRender7QCamera3panEfRK9QVector3D
    error: undefined symbol: _ZN10Qt3DRender7QCamera4tiltEf
    error: undefined symbol: _ZN10Qt3DRender7QCamera9translateERK9QVector3DNS0_23CameraTranslationOptionE
    error: undefined symbol: _ZN10Qt3DRender7QCameraC1EPN8Qt3DCore5QNodeE
    error: undefined symbol: _ZN10Qt3DRender7QCameraD1Ev
    ...
    
    jsulmJ 1 Reply Last reply
    0
    • F Offline
      F Offline
      FrogCastOrg
      wrote on last edited by
      #2

      For the undefined symbols, make sure includes like
      #include <QObject>
      is replaced with an explicit path
      #include <QtCore/QObject>

      jsulmJ 1 Reply Last reply
      0
      • V VenomousByte

        Hi,
        absolute newbe to this forum so please forgive (and tell) me if I'm doing somthing terribly wrong.

        I'm looking to port a Qt-application to WebAssembly but am stuck. The application allows the user to "fly" through 3D space using a first person type camera. The issue here is, that the Qt3DRenderer::QCamera is used to facilitate this movement, but does not seem to be supported by WebAssembly.

        The question I now have is: am I just out of luck and it can't be done, or is there some alternative for a first person camera with free 3D movement that is supported by WebAssembly?

        This is how I create the *.pro file (and add some include directories):

        @echo off
        
        set QT_DIR=C:\...
        
        START /WAIT %QT_DIR%\wasm_32\bin\qmake -project
        
        ECHO # Additional Include Paths >> .\app.pro
        ECHO INCLUDEPATH += .\..\.. >> .\app.pro
        ECHO INCLUDEPATH += %QT_DIR%\wasm_32\include\QtWidgets >> .\app.pro
        ECHO INCLUDEPATH += %QT_DIR%\wasm_32\include\QtMultimedia >> .\app.pro
        ECHO # Define Cpp Version >> .\app.pro
        ECHO CONFIG += c++1z >> .\app.pro
        ECHO # Suppress Warnings >> .\app.pro
        ECHO CONFIG += warn_off >> .\app.pro
        

        This is how I try to compile the whole thing into WebAssembly:

        set QT_DIR=C:\...
        set VS_COMPILER_TOOLS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\..."
        
        set PATH=%VS_COMPILER_TOOLS_PATH%\cl.exe;%PATH%
        
        call E:\pcr\emsdk\emsdk.bat activate
        START /WAIT %QT_DIR%\msvc2017_64\bin\uic app.ui -o ui_app.h
        START /WAIT %QT_DIR%\wasm_32\bin\qmake
        make
        

        And these are the error messages ...
        ... without adding %QT_DIR%\msvc2017_64\include as include location to the project file:

        ..\..\tools/app/apprenderwidget.h:19:10: fatal error: 'Qt3DRender/QCamera' file not found
        

        ... after adding %QT_DIR%\msvc2017_64\include as include location to the project file:
        (basically a bunch of undefined symbol errors, which include but are not limited to the QCamera functions)

        ...
        warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
        ...
        error: undefined symbol: _ZN10Qt3DRender7QCamera11setPositionERK9QVector3D
        error: undefined symbol: _ZN10Qt3DRender7QCamera11setUpVectorERK9QVector3D
        error: undefined symbol: _ZN10Qt3DRender7QCamera13setViewCenterERK9QVector3D
        error: undefined symbol: _ZN10Qt3DRender7QCamera3panEfRK9QVector3D
        error: undefined symbol: _ZN10Qt3DRender7QCamera4tiltEf
        error: undefined symbol: _ZN10Qt3DRender7QCamera9translateERK9QVector3DNS0_23CameraTranslationOptionE
        error: undefined symbol: _ZN10Qt3DRender7QCameraC1EPN8Qt3DCore5QNodeE
        error: undefined symbol: _ZN10Qt3DRender7QCameraD1Ev
        ...
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @VenomousByte You need

        QT += 3drender
        

        in your pro file.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • F FrogCastOrg

          For the undefined symbols, make sure includes like
          #include <QObject>
          is replaced with an explicit path
          #include <QtCore/QObject>

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @FrogCastOrg No, Qt headers should not be included with explicit path.
          And undefined symbol errors are related to not linked libraries, not includes.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • E Offline
            E Offline
            elbnacht
            wrote on last edited by
            #5

            I have the same error messages during make ... "error: undefined symbol:".

            Have you solved this issue?

            jsulmJ 1 Reply Last reply
            0
            • E elbnacht

              I have the same error messages during make ... "error: undefined symbol:".

              Have you solved this issue?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @elbnacht Please provide more information...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • lorn.potterL Offline
                lorn.potterL Offline
                lorn.potter
                wrote on last edited by lorn.potter
                #7

                Qt3D is not supported in Qt WebAssembly, so no work has been done to make it work. Qt3D requires OpenGL (desktop) and WebAssembly only supports OpenGL ES2/3, so I doubt it would even build correctly.

                Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                1 Reply Last reply
                1

                • Login

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