qt3d

Trigger ray cast tests consecutively

本秂侑毒 提交于 2019-12-10 19:07:13
问题 Following this answer, I'm doing consecutive ray casts: m_rayCaster = new Qt3DRender::QRayCaster(m_scene->rootEntity()); m_rayCaster->setRunMode(Qt3DRender::QAbstractRayCaster::SingleShot); m_scene->rootEntity()->addComponent(m_rayCaster); I have these slots to handle whether and when next consecutive ray cast test should be done: QObject::connect(m_rayCaster, &Qt3DRender::QRayCaster::hitsChanged, this, &RayCastHandler::handleRayCasterHits); QObject::connect(m_rayCaster, &Qt3DCore::QNode:

Qt3d Input in c++

放肆的年华 提交于 2019-12-10 17:35:34
问题 Is it possible to do handle mouse input in qt3d in c++? I am able to do so using qml using a sample in the qt3d repo https://github.com/qtproject/qt3d/tree/5.6/examples/qt3d/mouseinput-qml There isnt a c++ equivalent for this however. I am not able to do capture mouse events in c++ at all despite numerous attempts (even trying to capture input using event filters attached to various widgets) . Is the c++ mouse input api for qt3d complete for this version of qt (5.6) or should i wait for

GLSL spotlight projection volume

筅森魡賤 提交于 2019-12-10 17:09:35
问题 In my open source project I have setup a deferred rendering pipeline using Qt3D. So far so good, but now I'd like to move forward by adding spotlights projection volume. (e.g. as if there is smoke in the scene) Like this: The fragment shader I'm using is at the end of the question. I've read that for each fragment I should do ray marching from the light position and find the intersections with a cone, but I have no idea how to translate this into GLSL. I can easily add a uniform with the

Qt3D dynamic texture

为君一笑 提交于 2019-12-10 10:43:58
问题 I'm working on software that contains a Qt3D view. This 3D view allow us to visualize elements. All the rendering part of the object is done in QML with custom materials/shaders. I am able to create a material that passes a texture to a shader for texturing. The QML object holding the texture is Texture2D (its c++ implementation is QTexture2D ) My problem is that I don't find a way to dynamically change the texture content. In the software, the user can load any image from disc. I can

Is Qt3D a part of Qt5?

别来无恙 提交于 2019-12-09 14:50:02
问题 I have installed Qt5 libraries in windows but there is no document about Qt3D in Qt assistant. Is Qt3D a part of Qt5 or it has been removed from release version 5? 回答1: The other answer & comments were correct at the time, but the situation has now changed. As of Qt5.5, Qt3D is now included as a "technology preview" (I interpret this phrase as an indication that it's not deployment-ready, so there could be some bugs and the API could change). It's very important to note that the Qt3D that was

QML/Qt3D Basic example of GeometryRenderer use

佐手、 提交于 2019-12-07 07:53:25
问题 I'm looking for a basic example of how to set up an Entity with a GeometryRenderer in QML. The code I'm using right now is shown below. If I replace geometryRenderer by a CuboidMesh then a blank cube is shown. The goal is to display a simple triangle. Is my GeometryRenderer declaration correct ? Entity{ Material{ id: simpleMaterial effect: SimpleEffect{} } GeometryRenderer{ id: geometryRenderer instanceCount: 1 primitiveType: GeometryRenderer.Triangles geometry: Geometry{ Attribute{

Qt3D dynamic texture

不想你离开。 提交于 2019-12-06 14:27:09
I'm working on software that contains a Qt3D view. This 3D view allow us to visualize elements. All the rendering part of the object is done in QML with custom materials/shaders. I am able to create a material that passes a texture to a shader for texturing. The QML object holding the texture is Texture2D (its c++ implementation is QTexture2D ) My problem is that I don't find a way to dynamically change the texture content. In the software, the user can load any image from disc. I can properly create a QImage instance from this image. So the question is: I have a QImage instance in c++ and I

QScreenRayCaster not finding entity. What am I doiong wrong?

风格不统一 提交于 2019-12-06 06:24:50
问题 The description of the new QScreenRayCaster in Qt3D looks like its exactly what I want to use, but I cannot get it to work for me. I guess that there is something I need to do in the initialization but I cannot find any examples online to point me in the right direction. I've written a very simple program to test the function. It draws a unit sphere in the center of a window and then triggers a QScreenRayCaster at the center point which as far as I can see should then return a list of hits,

Billboarding using Qt3D 2.0

蹲街弑〆低调 提交于 2019-12-06 05:12:11
问题 I am looking for the best way to create a billboard in Qt3D. I would like a plane which faces the camera wherever it is and does not change sized when the camera dollies forward or back. I have read how to do this using GLSL vertex and geometry shaders, but I am looking for the Qt3D way, unless customer shaders is the most efficient and best way of billboarding. I have looked, and it appears I can set the Matrix on a QTransform via properties, but it isn't clear to me how I would manipulate

QML/Qt3D Basic example of GeometryRenderer use

人盡茶涼 提交于 2019-12-05 09:23:21
I'm looking for a basic example of how to set up an Entity with a GeometryRenderer in QML. The code I'm using right now is shown below. If I replace geometryRenderer by a CuboidMesh then a blank cube is shown. The goal is to display a simple triangle. Is my GeometryRenderer declaration correct ? Entity{ Material{ id: simpleMaterial effect: SimpleEffect{} } GeometryRenderer{ id: geometryRenderer instanceCount: 1 primitiveType: GeometryRenderer.Triangles geometry: Geometry{ Attribute{ attributeType: Attribute.VertexAttribute vertexBaseType: Attribute.Float vertexSize: 3 byteOffset: 0 byteStride: