normal Difference in height mapping in 3.1.1 vs 3.2

26 Jan 2017 17:30 #1

I've been using the normalMap function of CHAI3D on a Gaussian blob (See attached picture). In v3.1.1, it behaves as expected with the lighter part being "raised", from both x-direction and y-direction. But in v3.2, the y-direction gives a "dip" feedback (as though the blob were black, instead of white) while the x-direction gives the expected "bump" feedback. Using the exact same image, same main code, only difference was the CHAI3D version. I checked for both the Novint Falcon and the Geomagic Touch, as well as on different computers, with consistent results.
I located the culprit in CAlgorithmFingerProxy.cpp:
v3.1.1 code:

1245        // assign gradient
1246        gradientTexture.set(fX, fY, fZ);
v3.2 code:
1241        // assign gradient (negate fy!)
1242        gradientTexture.set(fX,-fY, fZ);
Swapping the -fY to fY fixed the issue and allowed the "bump" to behave as expected in all directions. I'm mostly wondering why the fY was negated in v3.2? Does it change any of the other force functionalities, or would I be alright with replacing that line with the v3.1.1 version?


Please Log in or Create an account to join the conversation.

26 Jan 2017 19:01 #2

Thank you for your comment. Could you please send us your normal map file to This email address is being protected from spambots. You need JavaScript enabled to view it. so that we can take a closer look at it.

We did notice some inconsistencies with normal maps downloaded from the web and we did modify CHAI3D 3.2 to support the most common formats we had identified (RGB interpretation). The modification did require swapping one of the directions.

Please Log in or Create an account to join the conversation.