comparison TaskManager/Test/test_render/polygon.cpp @ 228:c254a2bd1b34

remove SceneGraph::data, add SceneGraph::coord_xyz, coord_tex, normal
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Thu, 12 Feb 2009 16:31:38 +0900
parents fc314f28b66e
children e1d24c951408
comparison
equal deleted inserted replaced
227:d54cbfafcb82 228:c254a2bd1b34
179 179
180 void Polygon::pickup_coordinate(char *cont) 180 void Polygon::pickup_coordinate(char *cont)
181 { 181 {
182 for(int n=0; n<size*3; n+=3) 182 for(int n=0; n<size*3; n+=3)
183 { 183 {
184 cont = pickup_float(cont, data+n); 184 cont = pickup_float(cont, coord_xyz+n);
185 cont = pickup_float(cont, data+n+1); 185 cont = pickup_float(cont, coord_xyz+n+1);
186 cont = pickup_float(cont, data+n+2); 186 cont = pickup_float(cont, coord_xyz+n+2);
187 187
188 if (cont == NULL) 188 if (cont == NULL)
189 { 189 {
190 cout << "Analyzing obj data failed coordinate\n"; 190 cout << "Analyzing obj data failed coordinate\n";
191 } 191 }
192 } 192 }
193 } 193 }
194 194
195 void Polygon::pickup_normal(char *cont) 195 void Polygon::pickup_normal(char *cont)
196 { 196 {
197 for(int n=size*3;n<size*6;n+=3) 197 for (int n = 0; n<size*3; n += 3)
198 { 198 {
199 cont = pickup_float(cont,data+n); 199 cont = pickup_float(cont, normal+n);
200 cont = pickup_float(cont,data+n+1); 200 cont = pickup_float(cont, normal+n+1);
201 cont = pickup_float(cont,data+n+2); 201 cont = pickup_float(cont, normal+n+2);
202 202
203 if (cont == NULL) 203 if (cont == NULL)
204 { 204 {
205 cout << "Analyzing obj data failed normal\n"; 205 cout << "Analyzing obj data failed normal\n";
206 } 206 }
219 } 219 }
220 } 220 }
221 221
222 void Polygon::pickup_texture(char *cont) 222 void Polygon::pickup_texture(char *cont)
223 { 223 {
224 for(int n=size*6; n<size*9; n+=3) 224 for (int n = 0; n < size*3; n += 3)
225 { 225 {
226 cont = pickup_float(cont,data+n); 226 cont = pickup_float(cont, coord_tex+n);
227 cont = pickup_float(cont,data+n+1); 227 cont = pickup_float(cont, coord_tex+n+1);
228 data[n+2] = 1.0; 228 coord_tex[n+2] = 1.0;
229 229
230 if (cont == NULL) 230 if (cont == NULL)
231 { 231 {
232 cout << "Analyzing obj data failed texture\n"; 232 cout << "Analyzing obj data failed texture\n";
233 } 233 }