mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-22 11:58:21 -06:00
ui transform works
This commit is contained in:
parent
e75693926a
commit
50ef5c2d1e
|
@ -5,17 +5,8 @@ out vec2 uv;
|
|||
uniform mat4 ui_view;
|
||||
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() {
|
||||
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(
|
||||
vec2(0.25, 0.05),
|
||||
0.,
|
||||
vec2(0.5, 0.)
|
||||
vec2(0.5, 0.25)
|
||||
)),
|
||||
ProgressbarComponent {
|
||||
progress: 0.5
|
||||
|
|
Loading…
Reference in a new issue