Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.32 KB

Transformations.md

File metadata and controls

31 lines (21 loc) · 1.32 KB

Transformations

In Qt we have types for math calculation such as vector3d, matrix4x4, to generate transformations we can do calculation based on them, for details please see Qt's documentaion about basic QML types.

var m = Qt.matrix4x4()
m.translate(Qt.vector3d(1, -1, 0).times(.5))
m = m.times(rotateAround(joint, angle, Qt.vector3d(0,0,1)))

Tips:

  1. Give a mat4 uniform a binding of our time value:

The original program makes 2 glDraw call with the same shader, in Qt3D we should change the uniform in another render pass where only transform is changed. By the way, parameters can be set in several rendering classes, this time we put them into RenderPass: