Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identity matrix is treated as 2d, decomposing only xy scale #250

Open
ChristophHaag opened this issue Apr 27, 2022 · 0 comments
Open

Identity matrix is treated as 2d, decomposing only xy scale #250

ChristophHaag opened this issue Apr 27, 2022 · 0 comments

Comments

@ChristophHaag
Copy link

#include <stdio.h>
#include <graphene.h>
int main() {
  graphene_matrix_t transform;
  graphene_matrix_init_identity (&transform);

  printf("is 2d: %d\n", graphene_matrix_is_2d(&transform));

  graphene_vec3_t transl;
  graphene_vec3_t scale;
  graphene_quaternion_t rot;
  graphene_vec3_t shear;
  graphene_vec4_t persp;
  bool ret = graphene_matrix_decompose (&transform,
                                        &transl,
                                        &scale,
                                        &rot,
                                        &shear,
                                        &persp);

  printf ("scale %f %f %f\n",
    graphene_vec3_get_x (&scale),
    graphene_vec3_get_y (&scale),
    graphene_vec3_get_z (&scale));
}

compiled with gcc $(pkg-config --libs --cflags graphene-1.0) graphene_matrix.c

Experienced behavior

is 2d: 1
scale 1.000000 1.000000 0.000000

Expected behavior

scale 1.000000 1.000000 1.000000

Operating system in use

Archlinux, graphene 1.10.8

SIMD implementation in use

Defaults on x86_64, Ryzen 3950X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant