Thanks Kalle for reply. :)
unfortunately this approach works only for some vectors. in the attached patch for example there’s a not working one. :(
but this error makes sense: what we are looking for is a value that strictly depend from the RELATIONSHIP between the vector “b” and his parent “a”. so it can’t be a value that we find naturally in “b” (like his pitch or yaw…). we have to “see” vector “b” from the eyes of vector “a”, then we’ll find the key for the relationship (the angle). …but i don’t know how to! ahahahaha
(disclaimer: haven’t seen the patch, not on windows right now)
i guess, purely from the discussion, that you want to know about the angle between two vectors? in that case, maybe dot(vector,vector), the dot-product http://en.wikipedia.org/wiki/Dot_product#Scalar_projection can help you. :-)
the more problematic part will be the matrix inversion, but have a look at the implementation in the VMath.cs at line 1232, it looks very long, but its incredible fast.
but on the other hand, if you have such a problem, its often possible to solve it at another place in the code, where the information that you need is still persent. what do you do with that rotation?
this: http://www.vimeo.com/18788889
:)
the two vectors a and b were the binormal and tangent of the surface were each object is placed. now they look always in the same direction.
still looking for optimization… i’ll look into your link. tnx
wow this is amazing perfect for a current project ia m working currently.
i hope you will share your awesome knowledge again or like you wrote “we should learn to do it by ourself” so maybe you can give us some hlsl-hints.
thank you so much_alex.
hey natan, just found something whcih will improve the performance of your shader a lot: the inverse of a pure rotation matrix is its transpose!
so you can get rid of the inverse operation… shame on me i forgot that: