### Author Topic: convert Vector flow map to grayscale anisotropy map  (Read 2487 times)

#### tomtnt

Hallo,
What color operations do I have to do to convert vector flow map to standard anisotropy map? Easily saying, I need to do some unknown mathematical operations that converts vector flow map to same result as attached anisotropy map.  Both of formats knows to orient vector from 0-360 degree precisely. I have ability to paint just vector flow map, but I need to convert it in to anisotropy format and use it for orientation of my hairs and fur.
I have attached both of standarts of Vector flow map and anisotropy map.
Thanks for any help!
Tomas

#### Alex Jenyon

You can read the colour of the vector map into a pixel processor.  R and G channels encode a 2D normalized vector - the maths to convert a vector to an angle are reasonably straightforward.

If you divide the result by 360, and output it to all 3 colour channels, you should get the anisotrophy map you are looking for.

#### tomtnt

You can read the colour of the vector map into a pixel processor.  R and G channels encode a 2D normalized vector - the maths to convert a vector to an angle are reasonably straightforward.

If you divide the result by 360, and output it to all 3 colour channels, you should get the anisotrophy map you are looking for.

I understand the process that you suggest, but at this way, I think I am not able to make right function to do it in pixel processor. I thought I can do it by simply image operations like (multiply, over, ....etc)
Right expression would helped me very well because I will need to use it also in other software.

#### Alex Jenyon

You have trigonometry functions available to you in a pixel processor.

Angle from a vector2:  atan2(y, x)

You'll need to do a bit of logic to check which quadrant the vector is in (is x / y positive or negative) so you know how to turn the result into your desired 0-360 range.
Last Edit: March 30, 2017, 06:45:47 pm

#### nicvcer

Hmmm... the first thing I thought of was blending a flat red color into a flat green color using the black and white image you have as opacity. I'll have to try that.
Edit: Nevermind, I gave it a shot and wasn't able to get similar results.
Last Edit: March 31, 2017, 02:06:05 am