Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Rotate by pre-existing transformation matrix

$
0
0

@andrea-allen wrote:

I am trying to draw cylinders with their axis along a specific line in 3space, call it vector = <x,y,z>. I have come up with an ofMatrix3x3 that is the suitable transformation matrix, call it matrix R, that would be able to transform the “world” matrix so that the vertical axis is now my given vector.

I can’t seem to find a way using ofRotate or ofTranslate to feed it my matrix I created, R, and tell the world to apply that transformation matrix to the current state.

There are two solutions I can see to this problem, input is welcome on either!

  1. Is there a way to tell the world matrix to rotate/translate to a specific vector, i.e. send <0,0,1> to <x,y,z>?

  2. If not, I have come up with the appropriate transformation matrix, ofMatrix3x3 (call it R), how can I say something like ofRotate(by matrix R), rotating the unit vector <0,0,1> by applying R?

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles