ebassi / graphene

A thin layer of graphic data types

Home Page:http://ebassi.github.io/graphene

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ChristophHaag opened this issue · comments

#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