This commit is contained in:
Thomas Forgione 2021-01-21 08:35:09 +01:00
parent d9a198079b
commit b03e8f55db
5 changed files with 1044 additions and 4 deletions

View File

@ -120,6 +120,23 @@ df 1
**Attention :** les indices des faces suivantes ne sont pas changés après la **Attention :** les indices des faces suivantes ne sont pas changés après la
suppression d'une ancienne face. suppression d'une ancienne face.
##### Changer la couleur d'une face
Notre format OBJ permet de changer la couleur d'une face. Pour changer la
couleur d'une face, il suffit de d'utiliser les caractères `fc` suivis de
l'indice de la face dont vous souhaitez changer la couleur, puis des
composantes rouges, vertes et bleues, entre 0 et 1.
```
v 0.0 0.0 0.0
v 1.0 0.0 0.0
v 1.0 1.0 0.0
v 1.0 1.0 1.0
f 1 2 3
fc 1 1.0 0.0 0.0
```
###### Triangle strips et triangle fans ###### Triangle strips et triangle fans
Pour la compression de contenu 3D, on peut utiliser des [Triangle Pour la compression de contenu 3D, on peut utiliser des [Triangle
Strips](https://en.wikipedia.org/wiki/Triangle_strip) et des [Triangle Strips](https://en.wikipedia.org/wiki/Triangle_strip) et des [Triangle

View File

@ -2306,6 +2306,954 @@ ev 450 -0.6418495800224314 -0.6291525432873428 0.09222052902359912
ev 451 0.14466910367553898 -0.9808897695253331 0.7832160133094732 ev 451 0.14466910367553898 -0.9808897695253331 0.7832160133094732
ev 452 -0.17565564284755963 -0.984634122983667 0.7465170981993066 ev 452 -0.17565564284755963 -0.984634122983667 0.7465170981993066
ev 453 -0.007794154483274585 -0.9838976615325683 0.7916270551392464 ev 453 -0.007794154483274585 -0.9838976615325683 0.7916270551392464
fc 1 1.0 0.0 0.0
fc 2 1.0 0.0 0.0
fc 3 1.0 0.0 0.0
fc 4 1.0 0.0 0.0
fc 5 1.0 0.0 0.0
fc 6 1.0 0.0 0.0
fc 7 1.0 0.0 0.0
fc 8 1.0 0.0 0.0
fc 9 1.0 0.0 0.0
fc 10 1.0 0.0 0.0
fc 11 1.0 0.0 0.0
fc 12 1.0 0.0 0.0
fc 13 1.0 0.0 0.0
fc 14 1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.0
fc 135 1.0 0.0 0.0
fc 136 1.0 0.0 0.0
fc 137 1.0 0.0 0.0
fc 138 1.0 0.0 0.0
fc 139 1.0 0.0 0.0
fc 140 1.0 0.0 0.0
fc 141 1.0 0.0 0.0
fc 142 1.0 0.0 0.0
fc 143 1.0 0.0 0.0
fc 144 1.0 0.0 0.0
fc 145 1.0 0.0 0.0
fc 146 1.0 0.0 0.0
fc 147 1.0 0.0 0.0
fc 148 1.0 0.0 0.0
fc 149 1.0 0.0 0.0
fc 150 1.0 0.0 0.0
fc 151 1.0 0.0 0.0
fc 152 1.0 0.0 0.0
fc 153 1.0 0.0 0.0
fc 154 1.0 0.0 0.0
fc 155 1.0 0.0 0.0
fc 156 1.0 0.0 0.0
fc 157 1.0 0.0 0.0
fc 158 1.0 0.0 0.0
fc 159 1.0 0.0 0.0
fc 160 1.0 0.0 0.0
fc 161 1.0 0.0 0.0
fc 162 1.0 0.0 0.0
fc 163 1.0 0.0 0.0
fc 164 1.0 0.0 0.0
fc 165 1.0 0.0 0.0
fc 166 1.0 0.0 0.0
fc 167 1.0 0.0 0.0
fc 168 1.0 0.0 0.0
fc 169 1.0 0.0 0.0
fc 170 1.0 0.0 0.0
fc 171 1.0 0.0 0.0
fc 172 1.0 0.0 0.0
fc 173 1.0 0.0 0.0
fc 174 1.0 0.0 0.0
fc 175 1.0 0.0 0.0
fc 176 1.0 0.0 0.0
fc 177 1.0 0.0 0.0
fc 178 1.0 0.0 0.0
fc 179 1.0 0.0 0.0
fc 180 1.0 0.0 0.0
fc 181 1.0 0.0 0.0
fc 182 1.0 0.0 0.0
fc 183 1.0 0.0 0.0
fc 184 1.0 0.0 0.0
fc 185 1.0 0.0 0.0
fc 186 1.0 0.0 0.0
fc 187 1.0 0.0 0.0
fc 188 1.0 0.0 0.0
fc 189 1.0 0.0 0.0
fc 190 1.0 0.0 0.0
fc 191 1.0 0.0 0.0
fc 192 1.0 0.0 0.0
fc 193 1.0 0.0 0.0
fc 194 1.0 0.0 0.0
fc 195 1.0 0.0 0.0
fc 196 1.0 0.0 0.0
fc 197 1.0 0.0 0.0
fc 198 1.0 0.0 0.0
fc 199 1.0 0.0 0.0
fc 200 1.0 0.0 0.0
fc 201 1.0 0.0 0.0
fc 202 1.0 0.0 0.0
fc 203 1.0 0.0 0.0
fc 204 1.0 0.0 0.0
fc 205 1.0 0.0 0.0
fc 206 1.0 0.0 0.0
fc 207 1.0 0.0 0.0
fc 208 1.0 0.0 0.0
fc 209 1.0 0.0 0.0
fc 210 1.0 0.0 0.0
fc 211 1.0 0.0 0.0
fc 212 1.0 0.0 0.0
fc 213 1.0 0.0 0.0
fc 214 1.0 0.0 0.0
fc 215 1.0 0.0 0.0
fc 216 1.0 0.0 0.0
fc 217 1.0 0.0 0.0
fc 218 1.0 0.0 0.0
fc 219 1.0 0.0 0.0
fc 220 1.0 0.0 0.0
fc 221 1.0 0.0 0.0
fc 222 1.0 0.0 0.0
fc 223 1.0 0.0 0.0
fc 224 1.0 0.0 0.0
fc 225 1.0 0.0 0.0
fc 226 1.0 0.0 0.0
fc 227 1.0 0.0 0.0
fc 228 1.0 0.0 0.0
fc 229 1.0 0.0 0.0
fc 230 1.0 0.0 0.0
fc 231 1.0 0.0 0.0
fc 232 1.0 0.0 0.0
fc 233 1.0 0.0 0.0
fc 234 1.0 0.0 0.0
fc 235 1.0 0.0 0.0
fc 236 1.0 0.0 0.0
fc 237 1.0 0.0 0.0
fc 238 1.0 0.0 0.0
fc 239 1.0 0.0 0.0
fc 240 1.0 0.0 0.0
fc 241 1.0 0.0 0.0
fc 242 1.0 0.0 0.0
fc 243 1.0 0.0 0.0
fc 244 1.0 0.0 0.0
fc 245 1.0 0.0 0.0
fc 246 1.0 0.0 0.0
fc 247 1.0 0.0 0.0
fc 248 1.0 0.0 0.0
fc 249 1.0 0.0 0.0
fc 250 1.0 0.0 0.0
fc 251 1.0 0.0 0.0
fc 252 1.0 0.0 0.0
fc 253 1.0 0.0 0.0
fc 254 1.0 0.0 0.0
fc 255 1.0 0.0 0.0
fc 256 1.0 0.0 0.0
fc 257 1.0 0.0 0.0
fc 258 1.0 0.0 0.0
fc 259 1.0 0.0 0.0
fc 260 1.0 0.0 0.0
fc 261 1.0 0.0 0.0
fc 262 1.0 0.0 0.0
fc 263 1.0 0.0 0.0
fc 264 1.0 0.0 0.0
fc 265 1.0 0.0 0.0
fc 266 1.0 0.0 0.0
fc 267 1.0 0.0 0.0
fc 268 1.0 0.0 0.0
fc 269 1.0 0.0 0.0
fc 270 1.0 0.0 0.0
fc 271 1.0 0.0 0.0
fc 272 1.0 0.0 0.0
fc 273 1.0 0.0 0.0
fc 274 1.0 0.0 0.0
fc 275 1.0 0.0 0.0
fc 276 1.0 0.0 0.0
fc 277 1.0 0.0 0.0
fc 278 1.0 0.0 0.0
fc 279 1.0 0.0 0.0
fc 280 1.0 0.0 0.0
fc 281 1.0 0.0 0.0
fc 282 1.0 0.0 0.0
fc 283 1.0 0.0 0.0
fc 284 1.0 0.0 0.0
fc 285 1.0 0.0 0.0
fc 286 1.0 0.0 0.0
fc 287 1.0 0.0 0.0
fc 288 1.0 0.0 0.0
fc 289 1.0 0.0 0.0
fc 290 1.0 0.0 0.0
fc 291 1.0 0.0 0.0
fc 292 1.0 0.0 0.0
fc 293 1.0 0.0 0.0
fc 294 1.0 0.0 0.0
fc 295 1.0 0.0 0.0
fc 296 1.0 0.0 0.0
fc 297 1.0 0.0 0.0
fc 298 1.0 0.0 0.0
fc 299 1.0 0.0 0.0
fc 300 1.0 0.0 0.0
fc 301 1.0 0.0 0.0
fc 302 1.0 0.0 0.0
fc 303 1.0 0.0 0.0
fc 304 1.0 0.0 0.0
fc 305 1.0 0.0 0.0
fc 306 1.0 0.0 0.0
fc 307 1.0 0.0 0.0
fc 308 1.0 0.0 0.0
fc 309 1.0 0.0 0.0
fc 310 1.0 0.0 0.0
fc 311 1.0 0.0 0.0
fc 312 1.0 0.0 0.0
fc 313 1.0 0.0 0.0
fc 314 1.0 0.0 0.0
fc 315 1.0 0.0 0.0
fc 316 1.0 0.0 0.0
fc 317 1.0 0.0 0.0
fc 318 1.0 0.0 0.0
fc 319 1.0 0.0 0.0
fc 320 1.0 0.0 0.0
fc 321 1.0 0.0 0.0
fc 322 1.0 0.0 0.0
fc 323 1.0 0.0 0.0
fc 324 1.0 0.0 0.0
fc 325 1.0 0.0 0.0
fc 326 1.0 0.0 0.0
fc 327 1.0 0.0 0.0
fc 328 1.0 0.0 0.0
fc 329 1.0 0.0 0.0
fc 330 1.0 0.0 0.0
fc 331 1.0 0.0 0.0
fc 332 1.0 0.0 0.0
fc 333 1.0 0.0 0.0
fc 334 1.0 0.0 0.0
fc 335 1.0 0.0 0.0
fc 336 1.0 0.0 0.0
fc 337 1.0 0.0 0.0
fc 338 1.0 0.0 0.0
fc 339 1.0 0.0 0.0
fc 340 1.0 0.0 0.0
fc 341 1.0 0.0 0.0
fc 342 1.0 0.0 0.0
fc 343 1.0 0.0 0.0
fc 344 1.0 0.0 0.0
fc 345 1.0 0.0 0.0
fc 346 1.0 0.0 0.0
fc 347 1.0 0.0 0.0
fc 348 1.0 0.0 0.0
fc 349 1.0 0.0 0.0
fc 350 1.0 0.0 0.0
fc 351 1.0 0.0 0.0
fc 352 1.0 0.0 0.0
fc 353 1.0 0.0 0.0
fc 354 1.0 0.0 0.0
fc 355 1.0 0.0 0.0
fc 356 1.0 0.0 0.0
fc 357 1.0 0.0 0.0
fc 358 1.0 0.0 0.0
fc 359 1.0 0.0 0.0
fc 360 1.0 0.0 0.0
fc 361 1.0 0.0 0.0
fc 362 1.0 0.0 0.0
fc 363 1.0 0.0 0.0
fc 364 1.0 0.0 0.0
fc 365 1.0 0.0 0.0
fc 366 1.0 0.0 0.0
fc 367 1.0 0.0 0.0
fc 368 1.0 0.0 0.0
fc 369 1.0 0.0 0.0
fc 370 1.0 0.0 0.0
fc 371 1.0 0.0 0.0
fc 372 1.0 0.0 0.0
fc 373 1.0 0.0 0.0
fc 374 1.0 0.0 0.0
fc 375 1.0 0.0 0.0
fc 376 1.0 0.0 0.0
fc 377 1.0 0.0 0.0
fc 378 1.0 0.0 0.0
fc 379 1.0 0.0 0.0
fc 380 1.0 0.0 0.0
fc 381 1.0 0.0 0.0
fc 382 1.0 0.0 0.0
fc 383 1.0 0.0 0.0
fc 384 1.0 0.0 0.0
fc 385 1.0 0.0 0.0
fc 386 1.0 0.0 0.0
fc 387 1.0 0.0 0.0
fc 388 1.0 0.0 0.0
fc 389 1.0 0.0 0.0
fc 390 1.0 0.0 0.0
fc 391 1.0 0.0 0.0
fc 392 1.0 0.0 0.0
fc 393 1.0 0.0 0.0
fc 394 1.0 0.0 0.0
fc 395 1.0 0.0 0.0
fc 396 1.0 0.0 0.0
fc 397 1.0 0.0 0.0
fc 398 1.0 0.0 0.0
fc 399 1.0 0.0 0.0
fc 400 1.0 0.0 0.0
fc 401 1.0 0.0 0.0
fc 402 1.0 0.0 0.0
fc 403 1.0 0.0 0.0
fc 404 1.0 0.0 0.0
fc 405 1.0 0.0 0.0
fc 406 1.0 0.0 0.0
fc 407 1.0 0.0 0.0
fc 408 1.0 0.0 0.0
fc 409 1.0 0.0 0.0
fc 410 1.0 0.0 0.0
fc 411 1.0 0.0 0.0
fc 412 1.0 0.0 0.0
fc 413 1.0 0.0 0.0
fc 414 1.0 0.0 0.0
fc 415 1.0 0.0 0.0
fc 416 1.0 0.0 0.0
fc 417 1.0 0.0 0.0
fc 418 1.0 0.0 0.0
fc 419 1.0 0.0 0.0
fc 420 1.0 0.0 0.0
fc 421 1.0 0.0 0.0
fc 422 1.0 0.0 0.0
fc 423 1.0 0.0 0.0
fc 424 1.0 0.0 0.0
fc 425 1.0 0.0 0.0
fc 426 1.0 0.0 0.0
fc 427 1.0 0.0 0.0
fc 428 1.0 0.0 0.0
fc 429 1.0 0.0 0.0
fc 430 1.0 0.0 0.0
fc 431 1.0 0.0 0.0
fc 432 1.0 0.0 0.0
fc 433 1.0 0.0 0.0
fc 434 1.0 0.0 0.0
fc 435 1.0 0.0 0.0
fc 436 1.0 0.0 0.0
fc 437 1.0 0.0 0.0
fc 438 1.0 0.0 0.0
fc 439 1.0 0.0 0.0
fc 440 1.0 0.0 0.0
fc 441 1.0 0.0 0.0
fc 442 1.0 0.0 0.0
fc 443 1.0 0.0 0.0
fc 444 1.0 0.0 0.0
fc 445 1.0 0.0 0.0
fc 446 1.0 0.0 0.0
fc 447 1.0 0.0 0.0
fc 448 1.0 0.0 0.0
fc 449 1.0 0.0 0.0
fc 450 1.0 0.0 0.0
fc 451 1.0 0.0 0.0
fc 452 1.0 0.0 0.0
fc 453 1.0 0.0 0.0
fc 454 1.0 0.0 0.0
fc 455 1.0 0.0 0.0
fc 456 1.0 0.0 0.0
fc 457 1.0 0.0 0.0
fc 458 1.0 0.0 0.0
fc 459 1.0 0.0 0.0
fc 460 1.0 0.0 0.0
fc 461 1.0 0.0 0.0
fc 462 1.0 0.0 0.0
fc 463 1.0 0.0 0.0
fc 464 1.0 0.0 0.0
fc 465 1.0 0.0 0.0
fc 466 1.0 0.0 0.0
fc 467 1.0 0.0 0.0
fc 468 1.0 0.0 0.0
fc 469 1.0 0.0 0.0
fc 470 1.0 0.0 0.0
fc 471 1.0 0.0 0.0
fc 472 1.0 0.0 0.0
fc 473 1.0 0.0 0.0
fc 474 1.0 0.0 0.0
fc 475 1.0 0.0 0.0
fc 476 1.0 0.0 0.0
fc 477 1.0 0.0 0.0
fc 478 1.0 0.0 0.0
fc 479 1.0 0.0 0.0
fc 480 1.0 0.0 0.0
fc 481 1.0 0.0 0.0
fc 482 1.0 0.0 0.0
fc 483 1.0 0.0 0.0
fc 484 1.0 0.0 0.0
fc 485 1.0 0.0 0.0
fc 486 1.0 0.0 0.0
fc 487 1.0 0.0 0.0
fc 488 1.0 0.0 0.0
fc 489 1.0 0.0 0.0
fc 490 1.0 0.0 0.0
fc 491 1.0 0.0 0.0
fc 492 1.0 0.0 0.0
fc 493 1.0 0.0 0.0
fc 494 1.0 0.0 0.0
fc 495 1.0 0.0 0.0
fc 496 1.0 0.0 0.0
fc 497 1.0 0.0 0.0
fc 498 1.0 0.0 0.0
fc 499 1.0 0.0 0.0
fc 500 1.0 0.0 0.0
fc 501 1.0 0.0 0.0
fc 502 1.0 0.0 0.0
fc 503 1.0 0.0 0.0
fc 504 1.0 0.0 0.0
fc 505 1.0 0.0 0.0
fc 506 1.0 0.0 0.0
fc 507 1.0 0.0 0.0
fc 508 1.0 0.0 0.0
fc 509 1.0 0.0 0.0
fc 510 1.0 0.0 0.0
fc 511 1.0 0.0 0.0
fc 512 1.0 0.0 0.0
fc 513 1.0 0.0 0.0
fc 514 1.0 0.0 0.0
fc 515 1.0 0.0 0.0
fc 516 1.0 0.0 0.0
fc 517 1.0 0.0 0.0
fc 518 1.0 0.0 0.0
fc 519 1.0 0.0 0.0
fc 520 1.0 0.0 0.0
fc 521 1.0 0.0 0.0
fc 522 1.0 0.0 0.0
fc 523 1.0 0.0 0.0
fc 524 1.0 0.0 0.0
fc 525 1.0 0.0 0.0
fc 526 1.0 0.0 0.0
fc 527 1.0 0.0 0.0
fc 528 1.0 0.0 0.0
fc 529 1.0 0.0 0.0
fc 530 1.0 0.0 0.0
fc 531 1.0 0.0 0.0
fc 532 1.0 0.0 0.0
fc 533 1.0 0.0 0.0
fc 534 1.0 0.0 0.0
fc 535 1.0 0.0 0.0
fc 536 1.0 0.0 0.0
fc 537 1.0 0.0 0.0
fc 538 1.0 0.0 0.0
fc 539 1.0 0.0 0.0
fc 540 1.0 0.0 0.0
fc 541 1.0 0.0 0.0
fc 542 1.0 0.0 0.0
fc 543 1.0 0.0 0.0
fc 544 1.0 0.0 0.0
fc 545 1.0 0.0 0.0
fc 546 1.0 0.0 0.0
fc 547 1.0 0.0 0.0
fc 548 1.0 0.0 0.0
fc 549 1.0 0.0 0.0
fc 550 1.0 0.0 0.0
fc 551 1.0 0.0 0.0
fc 552 1.0 0.0 0.0
fc 553 1.0 0.0 0.0
fc 554 1.0 0.0 0.0
fc 555 1.0 0.0 0.0
fc 556 1.0 0.0 0.0
fc 557 1.0 0.0 0.0
fc 558 1.0 0.0 0.0
fc 559 1.0 0.0 0.0
fc 560 1.0 0.0 0.0
fc 561 1.0 0.0 0.0
fc 562 1.0 0.0 0.0
fc 563 1.0 0.0 0.0
fc 564 1.0 0.0 0.0
fc 565 1.0 0.0 0.0
fc 566 1.0 0.0 0.0
fc 567 1.0 0.0 0.0
fc 568 1.0 0.0 0.0
fc 569 1.0 0.0 0.0
fc 570 1.0 0.0 0.0
fc 571 1.0 0.0 0.0
fc 572 1.0 0.0 0.0
fc 573 1.0 0.0 0.0
fc 574 1.0 0.0 0.0
fc 575 1.0 0.0 0.0
fc 576 1.0 0.0 0.0
fc 577 1.0 0.0 0.0
fc 578 1.0 0.0 0.0
fc 579 1.0 0.0 0.0
fc 580 1.0 0.0 0.0
fc 581 1.0 0.0 0.0
fc 582 1.0 0.0 0.0
fc 583 1.0 0.0 0.0
fc 584 1.0 0.0 0.0
fc 585 1.0 0.0 0.0
fc 586 1.0 0.0 0.0
fc 587 1.0 0.0 0.0
fc 588 1.0 0.0 0.0
fc 589 1.0 0.0 0.0
fc 590 1.0 0.0 0.0
fc 591 1.0 0.0 0.0
fc 592 1.0 0.0 0.0
fc 593 1.0 0.0 0.0
fc 594 1.0 0.0 0.0
fc 595 1.0 0.0 0.0
fc 596 1.0 0.0 0.0
fc 597 1.0 0.0 0.0
fc 598 1.0 0.0 0.0
fc 599 1.0 0.0 0.0
fc 600 1.0 0.0 0.0
fc 601 1.0 0.0 0.0
fc 602 1.0 0.0 0.0
fc 603 1.0 0.0 0.0
fc 604 1.0 0.0 0.0
fc 605 1.0 0.0 0.0
fc 606 1.0 0.0 0.0
fc 607 1.0 0.0 0.0
fc 608 1.0 0.0 0.0
fc 609 1.0 0.0 0.0
fc 610 1.0 0.0 0.0
fc 611 1.0 0.0 0.0
fc 612 1.0 0.0 0.0
fc 613 1.0 0.0 0.0
fc 614 1.0 0.0 0.0
fc 615 1.0 0.0 0.0
fc 616 1.0 0.0 0.0
fc 617 1.0 0.0 0.0
fc 618 1.0 0.0 0.0
fc 619 1.0 0.0 0.0
fc 620 1.0 0.0 0.0
fc 621 1.0 0.0 0.0
fc 622 1.0 0.0 0.0
fc 623 1.0 0.0 0.0
fc 624 1.0 0.0 0.0
fc 625 1.0 0.0 0.0
fc 626 1.0 0.0 0.0
fc 627 1.0 0.0 0.0
fc 628 1.0 0.0 0.0
fc 629 1.0 0.0 0.0
fc 630 1.0 0.0 0.0
fc 631 1.0 0.0 0.0
fc 632 1.0 0.0 0.0
fc 633 1.0 0.0 0.0
fc 634 1.0 0.0 0.0
fc 635 1.0 0.0 0.0
fc 636 1.0 0.0 0.0
fc 637 1.0 0.0 0.0
fc 638 1.0 0.0 0.0
fc 639 1.0 0.0 0.0
fc 640 1.0 0.0 0.0
fc 641 1.0 0.0 0.0
fc 642 1.0 0.0 0.0
fc 643 1.0 0.0 0.0
fc 644 1.0 0.0 0.0
fc 645 1.0 0.0 0.0
fc 646 1.0 0.0 0.0
fc 647 1.0 0.0 0.0
fc 648 1.0 0.0 0.0
fc 649 1.0 0.0 0.0
fc 650 1.0 0.0 0.0
fc 651 1.0 0.0 0.0
fc 652 1.0 0.0 0.0
fc 653 1.0 0.0 0.0
fc 654 1.0 0.0 0.0
fc 655 1.0 0.0 0.0
fc 656 1.0 0.0 0.0
fc 657 1.0 0.0 0.0
fc 658 1.0 0.0 0.0
fc 659 1.0 0.0 0.0
fc 660 1.0 0.0 0.0
fc 661 1.0 0.0 0.0
fc 662 1.0 0.0 0.0
fc 663 1.0 0.0 0.0
fc 664 1.0 0.0 0.0
fc 665 1.0 0.0 0.0
fc 666 1.0 0.0 0.0
fc 667 1.0 0.0 0.0
fc 668 1.0 0.0 0.0
fc 669 1.0 0.0 0.0
fc 670 1.0 0.0 0.0
fc 671 1.0 0.0 0.0
fc 672 1.0 0.0 0.0
fc 673 1.0 0.0 0.0
fc 674 1.0 0.0 0.0
fc 675 1.0 0.0 0.0
fc 676 1.0 0.0 0.0
fc 677 1.0 0.0 0.0
fc 678 1.0 0.0 0.0
fc 679 1.0 0.0 0.0
fc 680 1.0 0.0 0.0
fc 681 1.0 0.0 0.0
fc 682 1.0 0.0 0.0
fc 683 1.0 0.0 0.0
fc 684 1.0 0.0 0.0
fc 685 1.0 0.0 0.0
fc 686 1.0 0.0 0.0
fc 687 1.0 0.0 0.0
fc 688 1.0 0.0 0.0
fc 689 1.0 0.0 0.0
fc 690 1.0 0.0 0.0
fc 691 1.0 0.0 0.0
fc 692 1.0 0.0 0.0
fc 693 1.0 0.0 0.0
fc 694 1.0 0.0 0.0
fc 695 1.0 0.0 0.0
fc 696 1.0 0.0 0.0
fc 697 1.0 0.0 0.0
fc 698 1.0 0.0 0.0
fc 699 1.0 0.0 0.0
fc 700 1.0 0.0 0.0
fc 701 1.0 0.0 0.0
fc 702 1.0 0.0 0.0
fc 703 1.0 0.0 0.0
fc 704 1.0 0.0 0.0
fc 705 1.0 0.0 0.0
fc 706 1.0 0.0 0.0
fc 707 1.0 0.0 0.0
fc 708 1.0 0.0 0.0
fc 709 1.0 0.0 0.0
fc 710 1.0 0.0 0.0
fc 711 1.0 0.0 0.0
fc 712 1.0 0.0 0.0
fc 713 1.0 0.0 0.0
fc 714 1.0 0.0 0.0
fc 715 1.0 0.0 0.0
fc 716 1.0 0.0 0.0
fc 717 1.0 0.0 0.0
fc 718 1.0 0.0 0.0
fc 719 1.0 0.0 0.0
fc 720 1.0 0.0 0.0
fc 721 1.0 0.0 0.0
fc 722 1.0 0.0 0.0
fc 723 1.0 0.0 0.0
fc 724 1.0 0.0 0.0
fc 725 1.0 0.0 0.0
fc 726 1.0 0.0 0.0
fc 727 1.0 0.0 0.0
fc 728 1.0 0.0 0.0
fc 729 1.0 0.0 0.0
fc 730 1.0 0.0 0.0
fc 731 1.0 0.0 0.0
fc 732 1.0 0.0 0.0
fc 733 1.0 0.0 0.0
fc 734 1.0 0.0 0.0
fc 735 1.0 0.0 0.0
fc 736 1.0 0.0 0.0
fc 737 1.0 0.0 0.0
fc 738 1.0 0.0 0.0
fc 739 1.0 0.0 0.0
fc 740 1.0 0.0 0.0
fc 741 1.0 0.0 0.0
fc 742 1.0 0.0 0.0
fc 743 1.0 0.0 0.0
fc 744 1.0 0.0 0.0
fc 745 1.0 0.0 0.0
fc 746 1.0 0.0 0.0
fc 747 1.0 0.0 0.0
fc 748 1.0 0.0 0.0
fc 749 1.0 0.0 0.0
fc 750 1.0 0.0 0.0
fc 751 1.0 0.0 0.0
fc 752 1.0 0.0 0.0
fc 753 1.0 0.0 0.0
fc 754 1.0 0.0 0.0
fc 755 1.0 0.0 0.0
fc 756 1.0 0.0 0.0
fc 757 1.0 0.0 0.0
fc 758 1.0 0.0 0.0
fc 759 1.0 0.0 0.0
fc 760 1.0 0.0 0.0
fc 761 1.0 0.0 0.0
fc 762 1.0 0.0 0.0
fc 763 1.0 0.0 0.0
fc 764 1.0 0.0 0.0
fc 765 1.0 0.0 0.0
fc 766 1.0 0.0 0.0
fc 767 1.0 0.0 0.0
fc 768 1.0 0.0 0.0
fc 769 1.0 0.0 0.0
fc 770 1.0 0.0 0.0
fc 771 1.0 0.0 0.0
fc 772 1.0 0.0 0.0
fc 773 1.0 0.0 0.0
fc 774 1.0 0.0 0.0
fc 775 1.0 0.0 0.0
fc 776 1.0 0.0 0.0
fc 777 1.0 0.0 0.0
fc 778 1.0 0.0 0.0
fc 779 1.0 0.0 0.0
fc 780 1.0 0.0 0.0
fc 781 1.0 0.0 0.0
fc 782 1.0 0.0 0.0
fc 783 1.0 0.0 0.0
fc 784 1.0 0.0 0.0
fc 785 1.0 0.0 0.0
fc 786 1.0 0.0 0.0
fc 787 1.0 0.0 0.0
fc 788 1.0 0.0 0.0
fc 789 1.0 0.0 0.0
fc 790 1.0 0.0 0.0
fc 791 1.0 0.0 0.0
fc 792 1.0 0.0 0.0
fc 793 1.0 0.0 0.0
fc 794 1.0 0.0 0.0
fc 795 1.0 0.0 0.0
fc 796 1.0 0.0 0.0
fc 797 1.0 0.0 0.0
fc 798 1.0 0.0 0.0
fc 799 1.0 0.0 0.0
fc 800 1.0 0.0 0.0
fc 801 1.0 0.0 0.0
fc 802 1.0 0.0 0.0
fc 803 1.0 0.0 0.0
fc 804 1.0 0.0 0.0
fc 805 1.0 0.0 0.0
fc 806 1.0 0.0 0.0
fc 807 1.0 0.0 0.0
fc 808 1.0 0.0 0.0
fc 809 1.0 0.0 0.0
fc 810 1.0 0.0 0.0
fc 811 1.0 0.0 0.0
fc 812 1.0 0.0 0.0
fc 813 1.0 0.0 0.0
fc 814 1.0 0.0 0.0
fc 815 1.0 0.0 0.0
fc 816 1.0 0.0 0.0
fc 817 1.0 0.0 0.0
fc 818 1.0 0.0 0.0
fc 819 1.0 0.0 0.0
fc 820 1.0 0.0 0.0
fc 821 1.0 0.0 0.0
fc 822 1.0 0.0 0.0
fc 823 1.0 0.0 0.0
fc 824 1.0 0.0 0.0
fc 825 1.0 0.0 0.0
fc 826 1.0 0.0 0.0
fc 827 1.0 0.0 0.0
fc 828 1.0 0.0 0.0
fc 829 1.0 0.0 0.0
fc 830 1.0 0.0 0.0
fc 831 1.0 0.0 0.0
fc 832 1.0 0.0 0.0
fc 833 1.0 0.0 0.0
fc 834 1.0 0.0 0.0
fc 835 1.0 0.0 0.0
fc 836 1.0 0.0 0.0
fc 837 1.0 0.0 0.0
fc 838 1.0 0.0 0.0
fc 839 1.0 0.0 0.0
fc 840 1.0 0.0 0.0
fc 841 1.0 0.0 0.0
fc 842 1.0 0.0 0.0
fc 843 1.0 0.0 0.0
fc 844 1.0 0.0 0.0
fc 845 1.0 0.0 0.0
fc 846 1.0 0.0 0.0
fc 847 1.0 0.0 0.0
fc 848 1.0 0.0 0.0
fc 849 1.0 0.0 0.0
fc 850 1.0 0.0 0.0
fc 851 1.0 0.0 0.0
fc 852 1.0 0.0 0.0
fc 853 1.0 0.0 0.0
fc 854 1.0 0.0 0.0
fc 855 1.0 0.0 0.0
fc 856 1.0 0.0 0.0
fc 857 1.0 0.0 0.0
fc 858 1.0 0.0 0.0
fc 859 1.0 0.0 0.0
fc 860 1.0 0.0 0.0
fc 861 1.0 0.0 0.0
fc 862 1.0 0.0 0.0
fc 863 1.0 0.0 0.0
fc 864 1.0 0.0 0.0
fc 865 1.0 0.0 0.0
fc 866 1.0 0.0 0.0
fc 867 1.0 0.0 0.0
fc 868 1.0 0.0 0.0
fc 869 1.0 0.0 0.0
fc 870 1.0 0.0 0.0
fc 871 1.0 0.0 0.0
fc 872 1.0 0.0 0.0
fc 873 1.0 0.0 0.0
fc 874 1.0 0.0 0.0
fc 875 1.0 0.0 0.0
fc 876 1.0 0.0 0.0
fc 877 1.0 0.0 0.0
fc 878 1.0 0.0 0.0
fc 879 1.0 0.0 0.0
fc 880 1.0 0.0 0.0
fc 881 1.0 0.0 0.0
fc 882 1.0 0.0 0.0
fc 883 1.0 0.0 0.0
fc 884 1.0 0.0 0.0
fc 885 1.0 0.0 0.0
fc 886 1.0 0.0 0.0
fc 887 1.0 0.0 0.0
fc 888 1.0 0.0 0.0
fc 889 1.0 0.0 0.0
fc 890 1.0 0.0 0.0
fc 891 1.0 0.0 0.0
fc 892 1.0 0.0 0.0
fc 893 1.0 0.0 0.0
fc 894 1.0 0.0 0.0
fc 895 1.0 0.0 0.0
fc 896 1.0 0.0 0.0
fc 897 1.0 0.0 0.0
fc 898 1.0 0.0 0.0
fc 899 1.0 0.0 0.0
fc 900 1.0 0.0 0.0
fc 901 1.0 0.0 0.0
fc 902 1.0 0.0 0.0
fc 903 1.0 0.0 0.0
fc 904 1.0 0.0 0.0
fc 905 1.0 0.0 0.0
fc 906 1.0 0.0 0.0
fc 907 1.0 0.0 0.0
fc 908 1.0 0.0 0.0
fc 909 1.0 0.0 0.0
fc 910 1.0 0.0 0.0
fc 911 1.0 0.0 0.0
fc 912 1.0 0.0 0.0
fc 913 1.0 0.0 0.0
fc 914 1.0 0.0 0.0
fc 915 1.0 0.0 0.0
fc 916 1.0 0.0 0.0
fc 917 1.0 0.0 0.0
fc 918 1.0 0.0 0.0
fc 919 1.0 0.0 0.0
fc 920 1.0 0.0 0.0
fc 921 1.0 0.0 0.0
fc 922 1.0 0.0 0.0
fc 923 1.0 0.0 0.0
fc 924 1.0 0.0 0.0
fc 925 1.0 0.0 0.0
fc 926 1.0 0.0 0.0
fc 927 1.0 0.0 0.0
fc 928 1.0 0.0 0.0
fc 929 1.0 0.0 0.0
fc 930 1.0 0.0 0.0
fc 931 1.0 0.0 0.0
fc 932 1.0 0.0 0.0
fc 933 1.0 0.0 0.0
fc 934 1.0 0.0 0.0
fc 935 1.0 0.0 0.0
fc 936 1.0 0.0 0.0
fc 937 1.0 0.0 0.0
fc 938 1.0 0.0 0.0
fc 939 1.0 0.0 0.0
fc 940 1.0 0.0 0.0
fc 941 1.0 0.0 0.0
fc 942 1.0 0.0 0.0
fc 943 1.0 0.0 0.0
fc 944 1.0 0.0 0.0
fc 945 1.0 0.0 0.0
fc 946 1.0 0.0 0.0
fc 947 1.0 0.0 0.0
fc 948 1.0 0.0 0.0
df 1 df 1
df 2 df 2
df 3 df 3

View File

@ -54,6 +54,16 @@ function parseLine(line, number) {
); );
return element; return element;
case "fc":
element.type = Element.SetFaceColor;
element.id = parseInt(split[1], 10) - 1;
element.value = new THREE.Color(
parseFloat(split[2]),
parseFloat(split[3]),
parseFloat(split[4]),
);
return element;
case "ts": case "ts":
element.type = Element.AddTriangleStrip; element.type = Element.AddTriangleStrip;
element.value = []; element.value = [];
@ -98,6 +108,15 @@ function parseLine(line, number) {
); );
return element; return element;
case "pv":
element.type = Element.PredictVertex;
element.value = new THREE.Face3(
parseInt(split[2], 10) - 1,
parseInt(split[2], 10) - 1,
parseInt(split[2], 10) - 1,
);
return element;
case "efv": case "efv":
element.type = Element.EditFaceVertex; element.type = Element.EditFaceVertex;
element.id = parseInt(split[1], 10) - 1; element.id = parseInt(split[1], 10) - 1;
@ -140,6 +159,8 @@ Element.EditFace = "EditFace";
Element.EditFaceVertex = "EditFaceVertex"; Element.EditFaceVertex = "EditFaceVertex";
Element.TranslateVertex = "TranslateVertex"; Element.TranslateVertex = "TranslateVertex";
Element.DeleteFace = "DeleteFace"; Element.DeleteFace = "DeleteFace";
Element.SetFaceColor = "SetFaceColor";
Element.PredictVertex = "PredictVertex";
class Loader { class Loader {
constructor(path, chunkSize = 1024, timeout = 20) { constructor(path, chunkSize = 1024, timeout = 20) {
@ -204,6 +225,7 @@ class Model extends THREE.Mesh {
new THREE.MeshLambertMaterial( { color: 0xffffff, side: THREE.DoubleSide } ), new THREE.MeshLambertMaterial( { color: 0xffffff, side: THREE.DoubleSide } ),
new THREE.MeshBasicMaterial( { transparent: true, opacity: 0 } ) new THREE.MeshBasicMaterial( { transparent: true, opacity: 0 } )
]; ];
materials[0].vertexColors = true;
super(geometry, materials); super(geometry, materials);
this.frustumCulled = false; this.frustumCulled = false;
this.path = path; this.path = path;
@ -246,6 +268,25 @@ class Model extends THREE.Mesh {
} }
checkVertexPrediction(f) {
let vertices = this.geometry.vertices;
if (vertices[f.a] === undefined) {
this.throwError("Vertex prediction requires vertex " + (f.a + 1) + " but there is no such vertex");
}
if (vertices[f.b] === undefined) {
this.throwError("Vertex prediction requires vertex " + (f.b + 1) + " but there is no such vertex");
}
if (vertices[f.c] === undefined) {
this.throwError("Vertex prediction requires vertex " + (f.c + 1) + " but there is no such vertex");
}
}
manageElement(element) { manageElement(element) {
let vertices = this.geometry.vertices; let vertices = this.geometry.vertices;
@ -341,6 +382,20 @@ class Model extends THREE.Mesh {
this.geometry.elementsNeedUpdate = true; this.geometry.elementsNeedUpdate = true;
break; break;
case Element.SetFaceColor:
this.geometry.faces[element.id].color.r = element.value.r;
this.geometry.faces[element.id].color.g = element.value.g;
this.geometry.faces[element.id].color.b = element.value.b;
this.geometry.colorsNeedUpdate = true;
break;
case Element.PredictVertex:
this.checkVertexPrediction(element.value);
vertices.push(vertices[element.value.a].clone()
.add(vertices[element.value.c])
.sub(vertices[element.value.b]));
this.geometry.verticesNeedUpdate = true;
break;
default: default:
throw new Error("unknown element type: " + element.type); throw new Error("unknown element type: " + element.type);

View File

@ -27,7 +27,7 @@ function fetchData(path, start, end, callback) {
xhr.send(); xhr.send();
} }
function parseLine(line) { function parseLine(line, number) {
let element = {}; let element = {};
let split = line.split(/[ \t]+/); let split = line.split(/[ \t]+/);
@ -54,6 +54,16 @@ function parseLine(line) {
); );
return element; return element;
case "fc":
element.type = Element.SetFaceColor;
element.id = parseInt(split[1], 10) - 1;
element.value = new THREE.Color(
parseFloat(split[2]),
parseFloat(split[3]),
parseFloat(split[4]),
);
return element;
case "ts": case "ts":
element.type = Element.AddTriangleStrip; element.type = Element.AddTriangleStrip;
element.value = []; element.value = [];
@ -134,7 +144,8 @@ function parseLine(line) {
return; return;
default: default:
throw new Error(split[0] + " is not a defined macro"); return;
// throw new Error(split[0] + " is not a defined macro in line " + number);
} }
} }
@ -149,6 +160,7 @@ Element.EditFace = "EditFace";
Element.EditFaceVertex = "EditFaceVertex"; Element.EditFaceVertex = "EditFaceVertex";
Element.TranslateVertex = "TranslateVertex"; Element.TranslateVertex = "TranslateVertex";
Element.DeleteFace = "DeleteFace"; Element.DeleteFace = "DeleteFace";
Element.SetFaceColor = "SetFaceColor";
Element.PredictVertex = "PredictVertex"; Element.PredictVertex = "PredictVertex";
class Loader { class Loader {
@ -197,8 +209,8 @@ class Loader {
split[0] = this.remainder + split[0]; split[0] = this.remainder + split[0];
this.remainder = split.pop(); this.remainder = split.pop();
for (let line of split) { for (let i = 0; i < split.length; i++) {
elements.push(parseLine(line)); elements.push(parseLine(split[i], i));
} }
callback(elements); callback(elements);

View File

@ -5,6 +5,7 @@ class Model extends THREE.Mesh {
new THREE.MeshLambertMaterial( { color: 0xffffff, side: THREE.DoubleSide } ), new THREE.MeshLambertMaterial( { color: 0xffffff, side: THREE.DoubleSide } ),
new THREE.MeshBasicMaterial( { transparent: true, opacity: 0 } ) new THREE.MeshBasicMaterial( { transparent: true, opacity: 0 } )
]; ];
materials[0].vertexColors = true;
super(geometry, materials); super(geometry, materials);
this.frustumCulled = false; this.frustumCulled = false;
this.path = path; this.path = path;
@ -161,6 +162,13 @@ class Model extends THREE.Mesh {
this.geometry.elementsNeedUpdate = true; this.geometry.elementsNeedUpdate = true;
break; break;
case Element.SetFaceColor:
this.geometry.faces[element.id].color.r = element.value.r;
this.geometry.faces[element.id].color.g = element.value.g;
this.geometry.faces[element.id].color.b = element.value.b;
this.geometry.colorsNeedUpdate = true;
break;
case Element.PredictVertex: case Element.PredictVertex:
this.checkVertexPrediction(element.value); this.checkVertexPrediction(element.value);
vertices.push(vertices[element.value.a].clone() vertices.push(vertices[element.value.a].clone()