[Interest] Qt3D: QGLBuilder unable to retain more than one piece of geometry

Jonathan Poncelet jonathan.poncelet at talk21.com
Mon Mar 24 19:37:00 CET 2014


Hi,

I've been advised to ask this here because you guys are more familiar with Qt3D, so here goes:

I'm having trouble rendering multiple pieces of geometry with QGLBuilder. I have a RenderBox test class which has an origin, min and max vector, and a toGeomData() function which returns its current state (vertices, normals, colours) as a QGeometryData object. My rendering loop in a given test is as follows:
	* Create the QGLBuilder.

	* Export the QGeometryData (geom below) from the RenderBox, which is centred at 0,0,0.

	* Change the RenderBox to be centred at 2,2,2.

	* Export the QGeometryData again, to a different object (geom2 below).

	* Reset the RenderBox to be back at 0,0,0.

	* Add both QGeometryData objects to the QGLBuilder: geom followed by geom2.

	* Get the finalised scene node and draw it.
The problem I'm having is that only the box centred at 0,0,0 is drawn. If I add only the box at 2,2,2 then it's rendered where it should be, but otherwise it appears to be completely ignored.

I've tried the following methods, all of which have the same problem:
builder<<geom;
builder<<geom2;

builder.newNode();

builder.addTriangles(geom);

builder.newNode();

builder.addTriangles(geom2);

builder.newNode();

builder.addTriangles(geom);

builder.pushNode();

builder.addTriangles(geom2);
Could anyone explain what might be going wrong?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140324/1056b266/attachment.html>


More information about the Interest mailing list