15 |
static void PrintMat4x4 (const char *title, Diderot_Mat4x4_t m) |
static void PrintMat4x4 (const char *title, Diderot_Mat4x4_t m) |
16 |
{ |
{ |
17 |
#define M(i) m[(i)>>2].r[(i)&3] |
#define M(i) m[(i)>>2].r[(i)&3] |
18 |
printf ("%s @ %p:\n", title, m); |
printf ("%s @ %p:\n", title, (void *)m); |
19 |
for (int i = 0; i < 4; i++) { |
for (int i = 0; i < 4; i++) { |
20 |
int j = 4*i; |
int j = 4*i; |
21 |
printf (" [ %6f %6f %6f %6f ]\n", M(j+0), M(j+1), M(j+2), M(j+3)); |
printf (" [ %6f %6f %6f %6f ]\n", M(j+0), M(j+1), M(j+2), M(j+3)); |
320 |
float f1, f2, f3; |
float f1, f2, f3; |
321 |
|
|
322 |
while (true) { |
while (true) { |
323 |
if (hasDflt) |
if (hasDflt) { |
324 |
|
union3f_t u; |
325 |
|
u.v = *v; |
326 |
printf("Enter value for %s (default %f %f %f): ", |
printf("Enter value for %s (default %f %f %f): ", |
327 |
name, ((union3f_t)*v).r[0], ((union3f_t)*v).r[1], ((union3f_t)*v).r[2]); |
name, u.r[0], u.r[1], u.r[2]); |
328 |
|
} |
329 |
else |
else |
330 |
printf("Enter value for %s: ", name); |
printf("Enter value for %s: ", name); |
331 |
fflush (stdout); |
fflush (stdout); |