PDA

View Full Version : Linear math: can't seem to rotate translated coordinates



Ploppz
01-02-2016, 03:18 PM
I'm using linmath.h: https://github.com/datenwolf/linmath.h/blob/master/linmath.h
I need to scale, translate and then rotate (https://github.com/datenwolf/linmath.h/blob/master/linmath.h#L184) a quad. I have also tried this function. (https://github.com/datenwolf/linmath.h/blob/master/linmath.h#L218)

I construct the matrix like this: https://bpaste.net/show/28cb4ac0de52 The commented lines show what I did previously to achieve the same with GLM.

The problem is that the rotation happens before the translation. What I'd expect is that the rotation function should apply on the already translated coordinates and thus also change the translation. How can I achieve this? Thanks.