Mercurial > hg > Members > kono > tree_dandy2
comparison SgoexCerium.cc @ 34:b65f6fc9c84f
position is correct now.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 21 May 2011 20:44:24 +0900 |
parents | 9a5300cedb14 |
children | 3b92a4b17049 |
comparison
equal
deleted
inserted
replaced
33:9a5300cedb14 | 34:b65f6fc9c84f |
---|---|
74 SceneGraphPtr object = droot->createSceneGraph(name); | 74 SceneGraphPtr object = droot->createSceneGraph(name); |
75 //object->c_xyz[0] = m->mx; | 75 //object->c_xyz[0] = m->mx; |
76 //object->c_xyz[1] = m->my; | 76 //object->c_xyz[1] = m->my; |
77 root->addChild(object); | 77 root->addChild(object); |
78 | 78 |
79 object->xyz[0] = x - object->c_xyz[0]*my_scale; | 79 object->xyz[0] -= object->c_xyz[0]*my_scale; |
80 object->xyz[1] = y - object->c_xyz[1]*my_scale; | 80 object->xyz[1] -= object->c_xyz[1]*my_scale; |
81 object->xyz[2] = zorder * 0.01; | 81 object->xyz[2] -= object->c_xyz[2]; |
82 | |
83 object->xyz[0] += x+m->mx; | |
84 object->xyz[1] += y+m->my; | |
85 object->xyz[2] += zorder * 0.01; | |
86 | |
87 float scale[] = {my_scale,my_scale,1}; | |
88 //float c_xyz[] = {0,0,0}; | |
89 //scale_matrix(object->matrix, scale, c_xyz); | |
82 | 90 |
83 /*親の回転、座標から、子の回転、座標を算出*/ | 91 /*親の回転、座標から、子の回転、座標を算出*/ |
84 get_matrix(object->matrix, object->angle, object->xyz, root->matrix); | 92 get_matrix_scale(object->matrix, object->angle, object->xyz, scale, root->matrix); |
85 | 93 |
86 float scale[] = {my_scale,my_scale,1}; | |
87 float c_xyz[] = {0,0,0}; | |
88 scale_matrix(object->matrix, scale, c_xyz); | |
89 /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ | 94 /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ |
90 get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix); | 95 // get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix); |
91 } | 96 } |
92 | 97 |
93 void | 98 void |
94 PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle) | 99 PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle) |
95 { | 100 { |
96 if (0) { | 101 if (1) { |
97 PutSprite(1, x, y, number); | 102 PutSprite(1, x, y, number); |
98 return; | 103 return; |
99 } | 104 } |
100 | 105 |
101 SpriteTable *m = &sptable[number]; | 106 SpriteTable *m = &sptable[number]; |
118 object->angle[3] = angle * (3.1415926*2/4096); | 123 object->angle[3] = angle * (3.1415926*2/4096); |
119 get_matrix(object->matrix, object->angle, object->xyz, root->matrix); | 124 get_matrix(object->matrix, object->angle, object->xyz, root->matrix); |
120 float c_xyz[] = {0,0,0}; | 125 float c_xyz[] = {0,0,0}; |
121 scale_matrix(object->matrix, scale, c_xyz); | 126 scale_matrix(object->matrix, scale, c_xyz); |
122 /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ | 127 /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ |
123 get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix); | 128 // get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix); |
124 } | 129 } |
125 | 130 |
126 | 131 |
127 struct SGO_PAD pad[2]; | 132 struct SGO_PAD pad[2]; |
128 | 133 |