mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-24 21:08:19 -06:00
ui transform works
This commit is contained in:
parent
2f3eab4d1e
commit
fdb7cf80e7
|
@ -5,17 +5,8 @@ out vec2 uv;
|
||||||
uniform mat4 ui_view;
|
uniform mat4 ui_view;
|
||||||
uniform mat3 transform;
|
uniform mat3 transform;
|
||||||
|
|
||||||
//not sure if mat4(i) does the same thing
|
|
||||||
mat4 extend(mat3 i) {
|
|
||||||
mat4 o;
|
|
||||||
o[0] = vec4(i[0].xyz, 0);
|
|
||||||
o[1] = vec4(i[1].xyz, 0);
|
|
||||||
o[2] = vec4(i[2].xyz, 0);
|
|
||||||
o[3] = vec4(0, 0, 0, 1);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uv = position;
|
uv = position;
|
||||||
gl_Position = ui_view * extend(transform) * vec4(position, 0., 1.);
|
vec2 transformed = (transform * vec3(position, 1.)).xy;
|
||||||
|
gl_Position = ui_view * vec4(transformed, 0., 1.);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ pub fn gui_testing(
|
||||||
Transform2d(Mat3::from_scale_angle_translation(
|
Transform2d(Mat3::from_scale_angle_translation(
|
||||||
vec2(0.25, 0.05),
|
vec2(0.25, 0.05),
|
||||||
0.,
|
0.,
|
||||||
vec2(0.5, 0.)
|
vec2(0.5, 0.25)
|
||||||
)),
|
)),
|
||||||
ProgressbarComponent {
|
ProgressbarComponent {
|
||||||
progress: 0.5
|
progress: 0.5
|
||||||
|
|
Loading…
Reference in a new issue