| 1 |
/************************************************************************ |
| 2 |
* |
| 3 |
* SbRotation & SbRotation::operator*=(SbRotation &) |
| 4 |
* |
| 5 |
************************************************************************/ |
| 6 |
|
| 7 |
#include <stdio.h> |
| 8 |
#include <Inventor/SoDB.h> |
| 9 |
#include <Inventor/SbLinear.h> |
| 10 |
|
| 11 |
|
| 12 |
int |
| 13 |
main(int argc, char ** argv) |
| 14 |
{ |
| 15 |
SoDB::init(); |
| 16 |
|
| 17 |
// FIXME: istty(stdin). 20010114 mortene. |
| 18 |
|
| 19 |
int valsread; |
| 20 |
SbRotation r = SbRotation::identity(); |
| 21 |
do { |
| 22 |
float v[4]; |
| 23 |
valsread = fscanf(stdin, "%f %f %f %f\n", &v[0], &v[1], &v[2], &v[3]); |
| 24 |
|
| 25 |
if (valsread == 4) { |
| 26 |
SbRotation n(v); |
| 27 |
r *= n; |
| 28 |
r = r * n; // test this variant aswell |
| 29 |
const float * a = r.getValue(); |
| 30 |
(void)fprintf(stdout, "%.3f %.3f %.3f %3f\n", a[0], a[1], a[2], a[3]); |
| 31 |
} |
| 32 |
} while (valsread == 4); |
| 33 |
|
| 34 |
if (valsread != EOF) { |
| 35 |
(void)fflush(stdout); |
| 36 |
(void)fprintf(stderr, "Input data format error!\n"); |
| 37 |
} |
| 38 |
|
| 39 |
return 0; |
| 40 |
} |