kiryha 38 Posted October 15 The rotation of each point occurs around the origin: matrix3 matrx = ident(); vector axis = {1, 0, 0}; float angle = 256; rotate ( matrx, angle, axis); @P *= matrx; How to define coordinates for rotation different from the origin? Share this post Link to post Share on other sites
kiryha 38 Posted October 15 I found the answer: matrix3 matrx = ident(); vector axis = {1, 0, 0}; float angle = 256; rotate ( matrx, angle, axis); vector pivot = {0, 0.8, 0}; @P = (@P - pivot) * matrx + pivot; But I can`t understand how it`s working, why this line `(@P - pivot) * matrx + pivot` puts pivot of rotation to a required point? Share this post Link to post Share on other sites
fsimerey 19 Posted October 15 It's like you translate the points at origin with pivot as center (@P - pivot), then rotate (* matrix) and replace at the pivot position (+ pivot) 1 Share this post Link to post Share on other sites
ThomasPara 71 Posted October 18 its a bit more readable like this. @P -= pivot; @P *= matrix; @P += pivot; 1 Share this post Link to post Share on other sites