mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 08:00:06 +00:00
Geo line requires two projection matrices
This commit is contained in:
parent
4aad9fd3d4
commit
5ae098daff
2 changed files with 15 additions and 4 deletions
|
|
@ -12,6 +12,7 @@ layout (location = 2) in vec2 aTexCoord;
|
|||
layout (location = 3) in vec4 aModulate;
|
||||
|
||||
uniform mat4 uMVPMatrix;
|
||||
uniform mat4 uMapMatrix;
|
||||
uniform vec2 uMapScreenCoord;
|
||||
|
||||
flat out vec2 texCoord;
|
||||
|
|
@ -32,8 +33,9 @@ void main()
|
|||
texCoord = aTexCoord;
|
||||
modulate = aModulate;
|
||||
|
||||
vec2 p = latLngToScreenCoordinate(aLatLong) + aXYOffset - uMapScreenCoord;
|
||||
vec2 p = latLngToScreenCoordinate(aLatLong) - uMapScreenCoord;
|
||||
|
||||
// Transform the position to screen coordinates
|
||||
gl_Position = uMVPMatrix * vec4(p, 0.0f, 1.0f);
|
||||
gl_Position = uMapMatrix * vec4(p, 0.0f, 1.0f) -
|
||||
uMVPMatrix * vec4(aXYOffset, 0.0f, 0.0f);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue