My recent Qt3D/QML question collection
-
I am learning OpenGL with http://learnopengl.com/ as well as Qt3D, the documnet of Qt3D is far from complete (especially the QML part), so I feel quite puzzled
- https://github.com/MidoriYakumo/learnopengl-qt3d/blob/master/qml/hellotriangle.qml vs http://learnopengl.com/code_viewer.php?code=getting-started/hellotriangle
Why render by default do face culling with normal array though there is no normal set in my code , without
renderStates: CullFace { mode: CullFace.NoCulling }
a reversed-ordered triangle vertices will not be drawn on screen.
- The same example hellotriangle in https://github.com/MidoriYakumo/learnopengl-qt3d/blob/master/qml/Components/RenderSettings0.qml
activeFrameGraph: ClearBuffers { buffers: ClearBuffers.ColorDepthBuffer // Why not ColorBuffer only??? clearColor: Qt.rgba(0.2, 0.3, 0.3, 1.0) RenderSurfaceSelector { } }
vs
glClearColor(0.2f, 0.3f, 0.3f, 1.0f); glClear(GL_COLOR_BUFFER_BIT);
The triangle do not have z-depth information, however Qt3D will not draw any thing with buffers:ClearBuffers.ColorBuffer, why?
-
Will TextureImage and other resource type support resources from url scheme of http in the future? <= An example of lack of unity of QtQuick and Qt3D
-
https://github.com/MidoriYakumo/learnopengl-qt3d/blob/master/qml/transformations.qml vs http://learnopengl.com/code_viewer.php?code=getting-started/transformations-exercise2
We can call glDrawElements twice for different parameters as two render pass, can I somehow assemble with Transform for first render pass and switch to another in the second pass? -
https://github.com/MidoriYakumo/learnopengl-qt3d/blob/master/qml/coordinate_systems_multiple_objects.qml
Old question, any good way to assmble Entities in scene dynamically?
I have tried:
a. ListElements of Entites
property list<Box0> boxes:[ Box0{ }, Box0{ }, Box0{ } ]
almost read-only, seems data cannot be binded in run-time
b. QtQuick.RepeaterQQ2.Repeater { id: repeater model: root.cubePositions delegate: Box0 { transform: Transform { translation: data } } }
It doesn't work because that an Item is not an Entity [#QTBUG-27444]
c. QtQuick.OnCompleted + createComponent + createQmlObject (for binding)QQ2.Component.onCompleted: { var component = Qt.createComponent("Components/Box0.qml") for (var i in cubePositions) { var box = component.createObject(root) var transform = Qt.createQmlObject("import Qt3D.Core 2.0; Transform { rotation: fromAxisAndAngle(Qt.vector3d(1, .3, 5), root.angle*%1) }".arg(i), box); // Dirty binding and namespace transform.translation = cubePositions[i] box.transform = transform } }
It just works but I feel dirty
6. There is something interesting in above that I have to use createQmlObject, becausebox.transform.rotation = Transform.fromAxisAndAngle(Qt.vector3d(1, .3, 5), root.angle)
will not work, is there any workaround/trick for QtQuick method namespace restriction?
Thanks for your discussion!
- https://github.com/MidoriYakumo/learnopengl-qt3d/blob/master/qml/hellotriangle.qml vs http://learnopengl.com/code_viewer.php?code=getting-started/hellotriangle
-
Hi,
Not a direct answer, Qt3D in it's current version is a tech preview thus the documentation is also a work in progress that will be improved.
For your current questions, you should bring them to the interest mailing list. You'll find there Qt3D's developers/maintainers. This forum is more user oriented.
-
Hi,
Not a direct answer, Qt3D in it's current version is a tech preview thus the documentation is also a work in progress that will be improved.
For your current questions, you should bring them to the interest mailing list. You'll find there Qt3D's developers/maintainers. This forum is more user oriented.
@SGaist thank you dude!