Hello forum,

I had a simple opengl triangle application . Check the screen-shot:

http://imgur.com/ZNO7bcu

When I port the same application to qml following the documentation - "Scene Graph - OpenGL Under QML", I do get the triangle as an underlay, but the placement of the triangle changed as follows:

http://imgur.com/6NVKDnC


The basic OpenGL is exactly same as the original one . Thecode sippet that shapes the triangle is as follows:

Qt Code:
  1. //setup triangle geometry
  2. //setup triangle vertices
  3. vertices[0].color=glm::vec3(1,0,0);
  4. vertices[1].color=glm::vec3(0,1,0);
  5. vertices[2].color=glm::vec3(0,0,1);
  6.  
  7. vertices[0].position=glm::vec3(-1,-1,0);
  8. vertices[1].position=glm::vec3(0,1,0);
  9. vertices[2].position=glm::vec3(1,-1,0);
  10.  
  11. //setup triangle indices
  12. indices[0] = 0;
  13. indices[1] = 1;
  14. indices[2] = 2;
To copy to clipboard, switch view to plain text mode 

I am getting different placement of the triangle with qml where opengl is underlay.

Any thoughts?


Thanks