Closed RogerChern closed 3 years ago
Hi, I got this code by asking a question on the Khronos forum. I suggest taking a look: https://community.khronos.org/t/squeeze-rectangular-texture-onto-segment-of-circle/104627 The thread got a great explanation of how it works. I just added the "1.0 -" part to flip the image.
I see. Thanks for the fast response.
https://github.com/TheCodez/dynamic-occupancy-grid-map/blob/84b9cbf713d8584fc9624de49c64cf373635af69/dogm/demo/simulator/mapping/opengl/shader.cpp#L22-L35
Hi Micheal, many thanks for sharing this wonderful project with the community. When I read the polar to cartesian part of codes, I found the line 32 in the fragment shader quite hard to understand.
vec2 uv = vec2(1.0 - (texCoord0.s / (texCoord0.t + 1e-10)), texCoord0.t);
What is the purpose of the
1 - s / t
part, especially when the texture coords are already handled by https://github.com/TheCodez/dynamic-occupancy-grid-map/blob/84b9cbf713d8584fc9624de49c64cf373635af69/dogm/demo/simulator/mapping/opengl/renderer.cpp#L11-L31Many thanks.