summaryrefslogtreecommitdiff
path: root/doc/OBJ.spec
blob: 13f49a52c192d571b3a58dc1077d71289b62b81f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
B1. Object Files (.obj)

Object files define the geometry and other properties for objects in
Wavefront's Advanced Visualizer. Object files can also be used to
transfer geometric data back and forth between the Advanced Visualizer
and other applications.

Object files can be in ASCII format (.obj) or binary format (.mod).
This appendix describes the ASCII format for object files. These files
must have the extension .obj.

In this release, the .obj file format supports both polygonal objects
and free-form objects. Polygonal geometry uses points, lines, and faces
to define objects while free-form geometry uses curves and surfaces.

About this section

The .obj appendix is for those who want to use the .obj format to
translate geometric data from other software applications to Wavefront
products. It also provides information for Advanced Visualizer users
who want detailed information on the Wavefront .obj file format.

If you are a 2.11 user and want to understand the significance of the
3.0 release and how it affects your existing files, you may be
especially interested in the section called "Superseded statements" at
the end of the appendix. The section, "Patches and free-form surfaces,"
gives examples of how 2.11 patches look in 3.0.

How this section is organized

Most of this appendix describes the different parts of an .obj file and
how those parts are arranged in the file. The three sections at the end
of the appendix provide background information on the 3.0 release of
the .obj format.

The .obj appendix includes the following sections:

o       File structure

o       General statement

o       Vertex data

o       Specifying free-form curves/surfaces

o       Free-form curve/surface attributes

o       Elements

o       Free-form curve/surface body statements

o       Connectivity between free-form surfaces

o       Grouping

o       Display/render attributes

o       Comments

o       Mathematics for free-form curves/surfaces

o       Superseded statements

o       Patches and free-form surfaces

---------------

    The curve and surface extensions to the .obj file format were
    developed in conjunction with mental images GmbH&Co.KG, Berlin,
    Germany, as part of a joint development project to incorporate
    free-form surfaces into Wavefront's Advanced Visualizer.

File structure

The following types of data may be included in an .obj file. In this
list, the keyword (in parentheses) follows the data type.

Vertex data

o       geometric vertices (v)

o       texture vertices (vt)

o       vertex normals (vn)

o       parameter space vertices (vp)
	Free-form curve/surface attributes

o       rational or non-rational forms of curve or surface type:
	basis matrix, Bezier, B-spline, Cardinal, Taylor (cstype)

o       degree (deg)

o       basis matrix (bmat)

o       step size (step)

Elements

o       point (p)

o       line (l)

o       face (f)

o       curve (curv)

o       2D curve (curv2)

o       surface (surf)

Free-form curve/surface body statements

o       parameter values (parm)

o       outer trimming loop (trim)

o       inner trimming loop (hole)

o       special curve (scrv)

o       special point (sp)

o       end statement (end)

Connectivity between free-form surfaces


o       connect (con)

Grouping

o       group name (g)

o       smoothing group (s)

o       merging group (mg)

o       object name (o)

Display/render attributes

o       bevel interpolation (bevel)

o       color interpolation (c_interp)

o       dissolve interpolation (d_interp)

o       level of detail (lod)

o       material name (usemtl)

o       material library (mtllib)

o       shadow casting (shadow_obj)

o       ray tracing (trace_obj)

o       curve approximation technique (ctech)

o       surface approximation technique (stech)


The following diagram shows how these parts fit together in a typical
.obj file.

Figure  B1-1.   Typical .obj file structure

General statement

call  filename.ext arg1 arg2 . . .

    Reads the contents of the specified .obj or .mod file at this
    location.  The call statement can be inserted into .obj files using
    a text editor.

    filename.ext is the name of the .obj or .mod file to be read. You
    must include the extension with the filename.

    arg1  arg2 . . .  specifies a series of optional integer arguments
    that are passed to the called file. There is no limit to the number
    of nested calls that can be made.

    Arguments passed to the called file are substituted in the same way
    as in UNIX scripts; for example, $1 in the called file is replaced
    by arg1,  $2 in the called file is replaced by arg2, and so on.

    If the frame number is needed in the called file for variable
    substitution, "$1" must be used as the first argument in the call
    statement. For example:

	call filename.obj $1

    Then the statement in the called file,

	scmp filename.pv $1

    will work as expected. For more information on the scmp statement,
    see appendix C, Variable Substitution for more information.

    Another method to do the same thing is:

	scmp filename.pv $1

	call filename.obj

    Using this method, the scmp statement provides the .pv file for all
    subsequently called .obj or .mod files.

csh command

csh -command

    Executes the requested UNIX command. If the UNIX command returns an
    error, the parser flags an error during parsing.

    If a dash (-) precedes the UNIX command, the error is ignored.

    command is the UNIX command.

Vertex data

Vertex data provides coordinates for:

o        geometric vertices

o        texture vertices

o        vertex normals

For free-form objects, the vertex data also provides:

o        parameter space vertices

The vertex data is represented by four vertex lists; one for each type
of vertex coordinate. A right-hand coordinate system is used to specify
the coordinate locations.

The following sample is a portion of an .obj file that contains the
four types of vertex information.

    v      -5.000000       5.000000       0.000000
    v      -5.000000      -5.000000       0.000000
    v       5.000000      -5.000000       0.000000
    v       5.000000       5.000000       0.000000
    vt     -5.000000       5.000000       0.000000
    vt     -5.000000      -5.000000       0.000000
    vt      5.000000      -5.000000       0.000000
    vt      5.000000       5.000000       0.000000
    vn      0.000000       0.000000       1.000000
    vn      0.000000       0.000000       1.000000
    vn      0.000000       0.000000       1.000000
    vn      0.000000       0.000000       1.000000
    vp      0.210000       3.590000
    vp      0.000000       0.000000
    vp      1.000000       0.000000
    vp      0.500000       0.500000



When vertices are loaded into the Advanced Visualizer, they are
sequentially numbered, starting with 1. These reference numbers are
used in element statements.

Syntax

The following syntax statements are listed in order of complexity.

v x y z w

    Polygonal and free-form geometry statement.

    Specifies a geometric vertex and its x y z coordinates. Rational
    curves and surfaces require a fourth homogeneous coordinate, also
    called the weight.

    x y z are the x, y, and z coordinates for the vertex. These are
    floating point numbers that define the position of the vertex in
    three dimensions.

    w is the weight required for rational curves and surfaces. It is
    not required for non-rational curves and surfaces. If you do not
    specify a value for w, the default is 1.0.

    NOTE: A positive weight value is recommended. Using zero or
    negative values may result in an undefined point in a curve or
    surface.

vp u v w

    Free-form geometry statement.

    Specifies a point in the parameter space of a curve or surface.

    The usage determines how many coordinates are required. Special
    points for curves require a 1D control point (u only) in the
    parameter space of the curve. Special points for surfaces require a
    2D point (u and v) in the parameter space of the surface. Control
    points for non-rational trimming curves require u and v
    coordinates. Control points for rational trimming curves require u,
    v, and w (weight) coordinates.

    u is the point in the parameter space of a curve or the first
    coordinate in the parameter space of a surface.

    v is the second coordinate in the parameter space of a surface.

    w is the weight required for rational trimming curves. If you do
    not specify a value for w, it defaults to 1.0.

    NOTE: For additional information on parameter vertices, see the
    curv2 and sp statements

vn i j k

    Polygonal and free-form geometry statement.

    Specifies a normal vector with components i, j, and k.

    Vertex normals affect the smooth-shading and rendering of geometry.
    For polygons, vertex normals are used in place of the actual facet
    normals.  For surfaces, vertex normals are interpolated over the
    entire surface and replace the actual analytic surface normal.

    When vertex normals are present, they supersede smoothing groups.

    i j k are the i, j, and k coordinates for the vertex normal. They
    are floating point numbers.

vt u v w

    Vertex statement for both polygonal and free-form geometry.

    Specifies a texture vertex and its coordinates. A 1D texture
    requires only u texture coordinates, a 2D texture requires both u
    and v texture coordinates, and a 3D texture requires all three
    coordinates.

    u is the value for the horizontal direction of the texture.

    v is an optional argument.

    v is the value for the vertical direction of the texture. The
    default is 0.

    w is an optional argument.

    w is a value for the depth of the texture. The default is 0.

Specifying free-form curves/surfaces

There are three steps involved in specifying a free-form curve or
surface element.

o       Specify the type of curve or surface (basis matrix, Bezier,
	B-spline, Cardinal, or Taylor) using free-form curve/surface
	attributes.

o       Describe the curve or surface with element statements.

o       Supply additional information, using free-form curve/surface
	body statements

The next three sections of this appendix provide detailed information
on each of these steps.

Data requirements for curves and surfaces

All curves and surfaces require a certain set of data. This consists of
the following:

Free-form curve/surface attributes

o       All curves and surfaces require type data, which is given with
	the cstype statement.

o       All curves and surfaces require degree data, which is given
	with the deg statement.

o       Basis matrix curves or surfaces require a bmat statement.

o       Basis matrix curves or surfaces also require a step size, which
	is given with the step statement.

Elements

o       All curves and surfaces require control points, which are
	referenced in the curv, curv2, or surf statements.

o       3D curves and surfaces require a parameter range, which is
	given in the curv and surf statements, respectively.

Free-form curve/surface body statements

o       All curves and surfaces require a set of global parameters or a
	knot vector, both of which are given with the parm statement.

o       All curves and surfaces body statements require an explicit end
	statement.

Error checks

The above set of data starts out empty with no default values when
reading of an .obj file begins. While the file is being read,
statements are encountered, information is accumulated, and some errors
may be reported.

When the end statement is encountered, the following error checks,
which involve consistency between various statements, are performed:

o       All required information is present.

o       The number of control points, number of parameter values
	(knots), and degree are consistent with the curve or surface
	type. If the type is bmatrix, the step size is also consistent.
	(For more information, refer to the parameter vector equations
	in the section, "Mathematics of free-form curves/ surfaces" at
	the end of appendix B1.)

o       If the type is bmatrix and the degree is n, the size of the
	basis matrix is (n + 1) x (n + 1).

Note that any information given by the state-setting statements remains
in effect from one curve or surface to the next. Information given
within a curve or surface body is only effective for the curve or
surface it is given with.



Free-form curve/surface attributes

Five types of free-form geometry are available in the .obj file
format:

o       Bezier

o       basis matrix

o       B-spline

o       Cardinal

o       Taylor

You can apply these types only to curves and surfaces. Each of these
five types can be rational or non-rational.

In addition to specifying the type, you must define the degree for the
curve or surface. For basis matrix curve and surface elements, you must
also specify the basis matrix and step size.

All free-form curve and surface attribute statements are state-setting.
This means that once an attribute statement is set, it applies to all
elements that follow until it is reset to a different value.

Syntax

The following syntax statements are listed in order of use.

cstype rat type

    Free-form geometry statement.

    Specifies the type of curve or surface and indicates a rational or
    non-rational form.

    rat is an optional argument.

    rat specifies a rational form for the curve or surface type. If rat
    is not included, the curve or surface is non-rational

    type specifies the curve or surface type. Allowed types are:

	bmatrix		basis matrix

	bezier		Bezier

	bspline		B-spline

	cardinal        Cardinal

	taylor		Taylor

    There is no default. A value must be supplied.

deg degu degv

    Free-form geometry statement.

    Sets the polynomial degree for curves and surfaces.

    degu is the degree in the u direction. It is required for both
    curves and surfaces.

    degv is the degree in the v direction. It is required only for
    surfaces. For Bezier, B-spline, Taylor, and basis matrix, there is
    no default; a value must be supplied. For Cardinal, the degree is
    always 3. If some other value is given for Cardinal, it will be
    ignored.

bmat u matrix

bmat v matrix

    Free-form geometry statement.

    Sets the basis matrices used for basis matrix curves and surfaces.
    The u and v values must be specified in separate bmat statements.

    NOTE: The deg statement must be given before the bmat statements
    and the size of the matrix must be appropriate for the degree.

    u specifies that the basis matrix is applied in the u direction.

    v specifies that the basis matrix is applied in the v direction.

    matrix lists the contents of the basis matrix with column subscript
    j varying the fastest. If n is the degree in the given u or v
    direction, the matrix (i,j) should be of size (n + 1) x (n + 1).

    There is no default. A value must be supplied.

    NOTE: The arrangement of the matrix is different from that commonly
    found in other references. For more information, see the examples
    at the end of this section and also the section, "Mathematics for
    free-form curves and surfaces."

step stepu stepv

    Free-form geometry statement.

    Sets the step size for curves and surfaces that use a basis
    matrix.

    stepu is the step size in the u direction. It is required for both
    curves and surfaces that use a basis matrix.

    stepv is the step size in the v direction. It is required only for
    surfaces that use a basis matrix. There is no default. A value must
    be supplied.

    When a curve or surface is being evaluated and a transition from
    one segment or patch to the next occurs, the set of control points
    used is incremented by the step size. The appropriate step size
    depends on the representation type, which is expressed through the
    basis matrix, and on the degree.

    That is, suppose we are given a curve with k control points:
			{v , ... v }
			  1       k

    If the curve is of degree n, then n + 1 control points are needed
    for each polynomial segment. If the step size is given as s, then
    the ith polynomial segment, where i = 0 is the first segment, will
    use the control points:
			{v    ,...,v      }
			  is+1      is+n+1

    For example, for Bezier curves, s = n .

    For surfaces, the above description applies independently to each
    parametric direction.

    When you create a file which uses the basis matrix type, be sure to
    specify a step size appropriate for the current curve or surface
    representation.

Examples

1.      Cubic Bezier surface made with a basis matrix

    To create a cubic Bezier surface:

	cstype bmatrix
	deg 3 3
	step 3 3
	bmat u  1       -3      3       -1      \
		0       3       -6      3       \
		0       0       3       -3      \
		0       0       0       1
	bmat v  1       -3      3       -1      \
		0       3       -6      3       \
		0       0       3       -3      \
		0       0       0       1

2.      Hermite curve made with a basis matrix

    To create a Hermite curve:

	cstype bmatrix
	deg 3
	step 2
	bmat u  1     0     -3      2      0       0       3      -2 \
		0     1     -2      1      0       0      -1       1

3.      Bezier in u direction with B-spline in v direction;
	made with a basis matrix

    To create a surface with a cubic Bezier in the u direction and
    cubic uniform B-spline in the v direction:

	cstype bmatrix
	deg 3 3
	step 3 1
	bmat u  1      -3       3      -1 \
		0       3      -6       3 \
		0       0       3      -3 \
		0       0       0       1
	bmat v  0.16666 -0.50000  0.50000 -0.16666 \
		0.66666  0.00000 -1.00000  0.50000 \
		0.16666  0.50000  0.50000 -0.50000 \
		0.00000  0.00000  0.00000  0.16666



Elements

For polygonal geometry, the element types available in the .obj file
are:

o       points

o       lines

o       faces

For free-form geometry, the element types available in the .obj file
are:

o       curve

o       2D curve on a surface

o       surface

All elements can be freely intermixed in the file.

Referencing vertex data

For all elements, reference numbers are used to identify geometric
vertices, texture vertices, vertex normals, and parameter space
vertices.

Each of these types of vertices is numbered separately, starting with
1. This means that the first geometric vertex in the file is 1, the
second is 2, and so on. The first texture vertex in the file is 1, the
second is 2, and so on. The numbering continues sequentially throughout
the entire file. Frequently, files have multiple lists of vertex data.
This numbering sequence continues even when vertex data is separated by
other data.

In addition to counting vertices down from the top of the first list in
the file, you can also count vertices back up the list from an
element's position in the file. When you count up the list from an
element, the reference numbers are negative. A reference number of -1
indicates the vertex immediately above the element. A reference number
of -2 indicates two references above and so on.

Referencing groups of vertices

Some elements, such as faces and surfaces, may have a triplet of
numbers that reference vertex data.These numbers are the reference
numbers for a geometric vertex, a texture vertex, and a vertex normal.

Each triplet of numbers specifies a geometric vertex, texture vertex,
and vertex normal. The reference numbers must be in order and must
separated by slashes (/).

o       The first reference number is the geometric vertex.

o       The second reference number is the texture vertex. It follows
	the first slash.

o       The third reference number is the vertex normal. It follows the
	second slash.

There is no space between numbers and the slashes. There may be more
than one series of geometric vertex/texture vertex/vertex normal
numbers on a line.

The following is a portion of a sample file for a four-sided face
element:

    f 1/1/1 2/2/2 3/3/3 4/4/4

Using v, vt, and vn to represent geometric vertices, texture vertices,
and vertex normals, the statement would read:

    f v/vt/vn v/vt/vn v/vt/vn v/vt/vn

If there are only vertices and vertex normals for a face element (no
texture vertices), you would enter two slashes (//). For example, to
specify only the vertex and vertex normal reference numbers, you would
enter:

    f 1//1 2//2 3//3 4//4

When you are using a series of triplets, you must be consistent in the
way you reference the vertex data. For example, it is illegal to give
vertex normals for some vertices, but not all.

The following is an example of an illegal statement.

    f 1/1/1 2/2/2 3//3 4//4

Syntax

The following syntax statements are listed in order of complexity of
geometry.

p  v1 v2 v3 . . .

    Polygonal geometry statement.

    Specifies a point element and its vertex. You can specify multiple
    points with this statement. Although points cannot be shaded or
    rendered, they are used by other Advanced Visualizer programs.

    v is the vertex reference number for a point element. Each point
    element requires one vertex. Positive values indicate absolute
    vertex numbers. Negative values indicate relative vertex numbers.

l  v1/vt1   v2/vt2   v3/vt3 . . .

    Polygonal geometry statement.

    Specifies a line and its vertex reference numbers. You can
    optionally include the texture vertex reference numbers. Although
    lines cannot be shaded or rendered, they are used by other Advanced
    Visualizer programs.

    The reference numbers for the vertices and texture vertices must be
    separated by a slash (/). There is no space between the number and
    the slash.

    v is a reference number for a vertex on the line. A minimum of two
    vertex numbers are required. There is no limit on the maximum.
    Positive values indicate absolute vertex numbers. Negative values
    indicate relative vertex numbers.

    vt is an optional argument.

    vt is the reference number for a texture vertex in the line
    element. It must always follow the first slash.

f  v1/vt1/vn1   v2/vt2/vn2   v3/vt3/vn3 . . .

    Polygonal geometry statement.

    Specifies a face element and its vertex reference number. You can
    optionally include the texture vertex and vertex normal reference
    numbers.

    The reference numbers for the vertices, texture vertices, and
    vertex normals must be separated by slashes (/). There is no space
    between the number and the slash.

    v is the reference number for a vertex in the face element. A
    minimum of three vertices are required.

    vt is an optional argument.

    vt is the reference number for a texture vertex in the face
    element. It always follows the first slash.

    vn is an optional argument.

    vn is the reference number for a vertex normal in the face element.
    It must always follow the second slash.

    Face elements use surface normals to indicate their orientation. If
    vertices are ordered counterclockwise around the face, both the
    face and the normal will point toward the viewer. If the vertex
    ordering is clockwise, both will point away from the viewer. If
    vertex normals are assigned, they should point in the general
    direction of the surface normal, otherwise unpredictable results
    may occur.

    If a face has a texture map assigned to it and no texture vertices
    are assigned in the f statement, the texture map is ignored when
    the element is rendered.

    NOTE: Any references to fo (face outline) are no longer valid as of
    version 2.11. You can use f (face) to get the same results.
    References to fo in existing .obj files will still be read,
    however, they will be written out as f when the file is saved.

curv u0 u1 v1 v2 . . .

    Element statement for free-form geometry.

    Specifies a curve, its parameter range, and its control vertices.
    Although curves cannot be shaded or rendered, they are used by
    other Advanced Visualizer programs.

    u0 is the starting parameter value for the curve. This is a
    floating point number.

    u1 is the ending parameter value for the curve. This is a floating
    point number.

    v is the vertex reference number for a control point. You can
    specify multiple control points. A minimum of two control points
    are required for a curve.

    For a non-rational curve, the control points must be 3D. For a
    rational curve, the control points are 3D or 4D. The fourth
    coordinate (weight) defaults to 1.0 if omitted.

curv2  vp1  vp2   vp3. . .

    Free-form geometry statement.

    Specifies a 2D curve on a surface and its control points. A 2D
    curve is used as an outer or inner trimming curve, as a special
    curve, or for connectivity.

    vp is the parameter vertex reference number for the control point.
    You can specify multiple control points. A minimum of two control
    points is required for a 2D curve.

    The control points are parameter vertices because the curve must
    lie in the parameter space of some surface. For a non-rational
    curve, the control vertices can be 2D. For a rational curve, the
    control vertices can be 2D or 3D. The third coordinate (weight)
    defaults to 1.0 if omitted.

surf  s0  s1  t0  t1  v1/vt1/vn1   v2/vt2/vn2 . . .

    Element statement for free-form geometry.

    Specifies a surface, its parameter range, and its control vertices.
    The surface is evaluated within the global parameter range from s0
    to s1 in the u direction and t0 to t1 in the v direction.

    s0 is the starting parameter value for the surface in the u
    direction.

    s1 is the ending parameter value for the surface in the u
    direction.

    t0 is the starting parameter value for the surface in the v
    direction.

    t1 is the ending parameter value for the surface in the v
    direction.

    v is the reference number for a control vertex in the surface.

    vt is an optional argument.

    vt is the reference number for a texture vertex in the surface.  It
    must always follow the first slash.

    vn is an optional argument.

    vn is the reference number for a vertex normal in the surface.  It
    must always follow the second slash.

    For a non-rational surface, the control vertices are 3D.  For a
    rational surface the control vertices can be 3D or 4D.  The fourth
    coordinate (weight) defaults to 1.0 if ommitted.

    NOTE: For more information on the ordering of control points for
    survaces, refer to the section on surfaces and control points in
    "mathematics of free-form curves/surfaces" at the end of this
    appendix.




Examples

These are examples for polygonal geometry.

For examples using free-form geometry, see the examples at the end of
the next section, "Free-form curve/surface body statements."

1.	Square

This example shows a square that measures two units on each side and
faces in the positive direction (toward the camera).  Note that the
ordering of the vertices is counterclockwise. This ordering determines
that the square is facing forward.

    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    f 1 2 3 4

2.      Cube

This is a cube that measures two units on each side. Each vertex is
shared by three different faces.

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    f 1 2 3 4
    f 8 7 6 5
    f 4 3 7 8
    f 5 1 4 8
    f 5 6 2 1
    f 2 6 7 3

3.      Cube with negative reference numbers

This is a cube with negative vertex reference numbers. Each element
references the vertices stored immediately above it in the file. Note
that vertices are not shared.

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    f -4 -3 -2 -1

    v 2.000000 2.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 0.000000 2.000000 0.000000
    f -4 -3 -2 -1

    v 2.000000 2.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    f -4 -3 -2 -1

    v 0.000000 2.000000 0.000000
    v 0.000000 2.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 2.000000 2.000000 0.000000
    f -4 -3 -2 -1

    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 0.000000 0.000000 2.000000
    v 0.000000 2.000000 2.000000
    f -4 -3 -2 -1

    v 0.000000 0.000000 2.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 0.000000 2.000000
    f -4 -3 -2 -1



Free-form curve/surface body statements

You can specify additional information for free-form curve and surface
elements using a series of statements called body statements. The
series is concluded by an end statement.

Body statements are valid only when they appear between the free-form
element statement (curv, curv2, surf) and the end statement. If they
are anywhere else in the .obj file, they do not have any effect.

You can use body statements to specify the following values:

o       parameter

o       knot vector

o       trimming loop

o       hole

o       special curve

o       special point

You cannot use any other statements between the free-form curve or
surface statement and the end statement. Using any other of type of
statement may cause unpredictable results.

This portion of a sample file shows the knot vector values for a
rational B-spline surface with a trimming loop. Notice the end
statement to conclude the body statements.

    cstype rat bspline
    deg 2 2
    surf -1.0 2.5 -2.0 2.0 -9 -8 -7 -6 -5 -4 -3 -2 -1
    parm u -1.00 -1.00 -1.00 2.50 2.50 2.50
    parm v -2.00 -2.00 -2.00 -2.00 -2.00 -2.00
    trim 0.0 2.0 1
    end

Parameter values and knot vectors

All curve and surface elements require a set of parameter values.

For polynomial curves and surfaces, this specifies global parameter
values. For B-spline curves and surfaces, this specifies the knot
vectors.

For surfaces, the parameter values must be specified for both the u and
v directions. For curves, the parameter values must be specified for
only the u direction.

If multiple parameter value statements for the same parametric
direction are used inside a single curve or surface body, the last
statement is used.

Trimming loops and holes

The trimming loop statement builds a single outer trimming loop as a
sequence of curves which lie on a given surface.

The hole statement builds a single inner trimming loop as a sequence of
curves which lie on a given surface. The inner loop creates a hole.

The curves are referenced by number in the same way vertices are
referenced by face elements.

The individual curves must lie end-to-end to form a closed loop which
does not intersect itself and which lies within the parameter range
specified for the surface. The loop as a whole may be oriented in
either direction (clockwise or counterclockwise).

To cut one or more holes in a region, use a trim statement followed by
one or more hole statements. To introduce another trimmed region in the
same surface, use another trim statement followed by one or more hole
statements. The ordering that associates holes and the regions they cut
is important and must be maintained.

If the first trim statement in the sequence is omitted, the enclosing
outer trimming loop is taken to be the parameter range of the surface.
If no trim or hole statements are specified, then the surface is
trimmed at its parameter range.

This portion of a sample file shows a non-rational Bezier surface with
two regions, each with a single hole:

    cstype bezier
    deg 1 1
    surf 0.0 2.0 0.0 2.0 1 2 3 4
    parm u 0.00 2.00
    parm v 0.00 2.00
    trim 0.0 4.0 1
    hole 0.0 4.0 2
    trim 0.0 4.0 3
    hole 0.0 4.0 4
    end

Special curve

A special curve statement builds a single special curve as a sequence
of curves which lie on a given surface.

The curves are referenced by number in the same way vertices are
referenced by face elements.

A special curve is guaranteed to be included in any triangulation of
the surface. This means that the line formed by approximating the
special curve with a sequence of straight line segments will actually
appear as a sequence of triangle edges in the final triangulation.

Special point

A special point statement specifies that special geometric points are
to be associated with a curve or surface. For space curves and trimming
curves, the parameter vertices must be 1D. For surfaces, the parameter
vertices must be 2D.

These special points will be included in any linear approximation of
the curve or surface.

For space curves, this means that the point corresponding to the given
curve parameter is included as one of the vertices in an approximation
consisting of a sequence of line segments.

For surfaces, this means that the point corresponding to the given
surface parameters is included as a triangle vertex in the
triangulation.

For trimming curves, the treatment is slightly different: a special
point on a trimming curve is essentially the same as a special point on
the surface it trims.

The following portion of a sample files shows special points for a
rational Bezier 2D curve on a surface.

    vp -0.675  1.850  3.000
    vp  0.915  1.930
    vp  2.485  0.470  2.000
    vp  2.485 -1.030
    vp  1.605 -1.890 10.700
    vp -0.745 -0.654  0.500
    cstype rat bezier
    curv2 -6 -5 -4 -3 -2 -1 -6
    parm u 0.00 1.00 2.00
    sp 2 3
    end

Syntax

The following syntax statement are listed in order of normal use.

parm u p1 p2 p3. . .

parm v p1 p2 p3 . . .

    Body statement for free-form geometry.

    Specifies global parameter values. For B-spline curves and
    surfaces, this specifies the knot vectors.

    u is the u direction for the parameter values.

    v is the v direction for the parameter values.

    To set u and v values, use separate command lines.

    p is the global parameter or knot value. You can specify multiple
    values. A minimum of two parameter values are required. Parameter
    values must increase monotonically. The type of surface and the
    degree dictate the number of values required.

trim  u0  u1  curv2d  u0  u1  curv2d . . .

    Body statement for free-form geometry.

    Specifies a sequence of curves to build a single outer trimming
    loop.

    u0 is the starting parameter value for the trimming curve curv2d.

    u1 is the ending parameter value for the trimming curve curv2d.

    curv2d is the index of the trimming curve lying in the parameter
    space of the surface. This curve must have been previously defined
    with the curv2 statement.

hole  u0  u1  curv2d  u0  u1  curv2d . . .

    Body statement for free-form geometry.

    Specifies a sequence of curves to build a single inner trimming
    loop (hole).

    u0 is the starting parameter value for the trimming curve curv2d.

    u1 is the ending parameter value for the trimming curve curv2d.

    curv2d is the index of the trimming curve lying in the parameter
    space of the surface. This curve must have been previously defined
    with the curv2 statement.

scrv u0 u1 curv2d u0 u1 curv2d . . .

    Body statement for free-form geometry.

    Specifies a sequence of curves which lie on the given surface to
    build a single special curve.

    u0 is the starting parameter value for the special curve curv2d.

    u1 is the ending parameter value for the special curve curv2d.

    curv2d is the index of the special curve lying in the parameter
    space of the surface. This curve must have been previously defined
    with the curv2 statement.

sp vp1  vp. . .

    Body statement for free-form geometry.

    Specifies special geometric points to be associated with a curve or
    surface. For space curves and trimming curves, the parameter
    vertices must be 1D. For surfaces, the parameter vertices must be
    2D.

    vp is the reference number for the parameter vertex of a special
    point to be associated with the parameter space point of the curve
    or surface.

end

    Body statement for free-form geometry.

    Specifies the end of a curve or surface body begun by a curv,
    curv2, or surf statement.

Examples

1.      Taylor curve

    For creating a single-segment Taylor polynomial curve of the form:

                                   2         3         4
	x =  3.00 +  2.30t +  7.98t  +  8.30t  +  6.34t 

                                   2         3         4
	y =  1.00 - 10.10t +  5.40t  -  4.70t  +  2.03t 

                                   2         3         4
	z = -2.50 +  0.50t -  7.00t  + 18.10t  +  0.08t 


and evaluated between the global parameters 0.5 and 1.6:

	v       3.000    1.000   -2.500
	v       2.300  -10.100    0.500
	v       7.980    5.400   -7.000
	v       8.300   -4.700   18.100
	v       6.340    2.030    0.080
	cstype taylor
	deg 4
	curv 0.500 1.600 1 2 3 4 5
	parm u 0.000 2.000
	end

2.      Bezier curve

This example shows a non-rational Bezier curve with 13 control points.

    v -2.300000 1.950000 0.000000
    v -2.200000 0.790000 0.000000
    v -2.340000 -1.510000 0.000000
    v -1.530000 -1.490000 0.000000
    v -0.720000 -1.470000 0.000000
    v -0.780000 0.230000 0.000000
    v 0.070000 0.250000 0.000000
    v 0.920000 0.270000 0.000000
    v 0.800000 -1.610000 0.000000
    v 1.620000 -1.590000 0.000000
    v 2.440000 -1.570000 0.000000
    v 2.690000 0.670000 0.000000
    v 2.900000 1.980000 0.000000
    # 13 vertices

    cstype bezier
    ctech cparm 1.000000
    deg 3
    curv 0.000000 4.000000 1 2 3 4 5 6 7 8 9 10 \
    11 12 13
    parm u 0.000000 1.000000 2.000000 3.000000  \
    4.000000
    end
    # 1 element



3.      B-spline surface

This is an example of a cubic B-spline surface.

    g bspatch
    v -5.000000 -5.000000 -7.808327
    v -5.000000 -1.666667 -7.808327
    v -5.000000 1.666667 -7.808327
    v -5.000000 5.000000 -7.808327
    v -1.666667 -5.000000 -7.808327
    v -1.666667 -1.666667 11.977780
    v -1.666667 1.666667 11.977780
    v -1.666667 5.000000 -7.808327
    v 1.666667 -5.000000 -7.808327
    v 1.666667 -1.666667 11.977780
    v 1.666667 1.666667 11.977780
    v 1.666667 5.000000 -7.808327
    v 5.000000 -5.000000 -7.808327
    v 5.000000 -1.666667 -7.808327
    v 5.000000 1.666667 -7.808327
    v 5.000000 5.000000 -7.808327
    # 16 vertices

    cstype bspline
    stech curv 0.5 10.000000
    deg 3 3
    8surf 0.000000 1.000000 0.000000 1.000000 13 14 \ 15 16 9 10 11 12 5 6
    7 8 1 2 3 4
    parm u -3.000000 -2.000000 -1.000000 0.000000  \
    1.000000 2.000000 3.000000 4.000000
    parm v -3.000000 -2.000000 -1.000000 0.000000  \
    1.000000 2.000000 3.000000 4.000000
    end
    # 1 element


4.      Cardinal surface

This example shows a Cardinal surface.

    v -5.000000 -5.000000 0.000000
    v -5.000000 -1.666667 0.000000
    v -5.000000 1.666667 0.000000
    v -5.000000 5.000000 0.000000
    v -1.666667 -5.000000 0.000000
    v -1.666667 -1.666667 0.000000
    v -1.666667 1.666667 0.000000
    v -1.666667 5.000000 0.000000
    v 1.666667 -5.000000 0.000000
    v 1.666667 -1.666667 0.000000
    v 1.666667 1.666667 0.000000
    v 1.666667 5.000000 0.000000
    v 5.000000 -5.000000 0.000000
    v 5.000000 -1.666667 0.000000
    v 5.000000 1.666667 0.000000
    v 5.000000 5.000000 0.000000
    # 16 vertices

    cstype cardinal
    stech cparma 1.000000 1.000000
    deg 3 3
    surf 0.000000 1.000000 0.000000 1.000000 13 14 \
    15 16 9 10 11 12 5 6 7 8 1 2 3 4
    parm u 0.000000 1.000000
    parm v 0.000000 1.000000
    end
    # 1 element


5.      Rational B-spline surface

This example creates a second-degree, rational B-spline surface using
open, uniform knot vectors. A texture map is applied to the surface.

    v -1.3 -1.0  0.0
    v  0.1 -1.0  0.4  7.6
    v  1.4 -1.0  0.0  2.3
    v -1.4  0.0  0.2
    v  0.1  0.0  0.9  0.5
    v  1.3  0.0  0.4  1.5
    v -1.4  1.0  0.0  2.3
    v  0.1  1.0  0.3  6.1
    v  1.1  1.0  0.0  3.3
    vt 0.0  0.0
    vt 0.5  0.0
    vt 1.0  0.0
    vt 0.0  0.5
    vt 0.5  0.5
    vt 1.0  0.5
    vt 0.0  1.0
    vt 0.5  1.0
    vt 1.0  1.0
    cstype rat bspline
    deg 2 2
    surf 0.0 1.0 0.0 1.0 1/1 2/2 3/3 4/4 5/5 6/6 \
    7/7 8/8 9/9
    parm u 0.0 0.0 0.0 1.0 1.0 1.0
    parm v 0.0 0.0 0.0 1.0 1.0 1.0
    end


6.      Trimmed NURB surface

This is a complete example of a file containing a trimmed NURB surface
with negative reference numbers for vertices.

    # trimming curve
    vp -0.675  1.850  3.000
    vp  0.915  1.930
    vp  2.485  0.470  2.000
    vp  2.485 -1.030
    vp  1.605 -1.890 10.700
    vp -0.745 -0.654  0.500
    cstype rat bezier
    deg 3
    curv2 -6 -5 -4 -3 -2 -1 -6
    parm u 0.00 1.00 2.00
    end
    # surface
    v -1.350 -1.030 0.000
    v  0.130 -1.030 0.432 7.600
    v  1.480 -1.030 0.000 2.300
    v -1.460  0.060 0.201
    v  0.120  0.060 0.915 0.500
    v  1.380  0.060 0.454 1.500
    v -1.480  1.030 0.000 2.300
    v  0.120  1.030 0.394 6.100
    v  1.170  1.030 0.000 3.300
    cstype rat bspline
    deg 2 2
    surf -1.0 2.5 -2.0 2.0 -9 -8 -7 -6 -5 -4 -3 -2 -1
    parm u -1.00 -1.00 -1.00 2.50 2.50 2.50
    parm v -2.00 -2.00 -2.00 -2.00 -2.00 -2.00
    trim 0.0 2.0 1
    end


7.      Two trimming regions with a hole

This example shows a Bezier surface with two trimming regions, each
with a hole in them.

    # outer loop of first region
    deg 1
    cstype bezier
    vp 0.100 0.100
    vp 0.900 0.100
    vp 0.900 0.900
    vp 0.100 0.900
    curv2 1 2 3 4 1
    parm u 0.00 1.00 2.00 3.00 4.00
    end
    # hole in first region
    vp 0.300 0.300
    vp 0.700 0.300
    vp 0.700 0.700
    vp 0.300 0.700
    curv2 5 6 7 8 5
    parm u 0.00 1.00 2.00 3.00 4.00
    end
    # outer loop of second region
    vp 1.100 1.100
    vp 1.900 1.100
    vp 1.900 1.900
    vp 1.100 1.900
    curv2 9 10 11 12 9
    parm u 0.00 1.00 2.00 3.00 4.00
    end
    # hole in second region
    vp 1.300 1.300
    vp 1.700 1.300
    vp 1.700 1.700
    vp 1.300 1.700
    curv2 13 14 15 16 13
    parm u 0.00 1.00 2.00 3.00 4.00
    end
    # surface
    v 0.000 0.000 0.000
    v 1.000 0.000 0.000
    v 0.000 1.000 0.000
    v 1.000 1.000 0.000
    deg 1 1
    cstype bezier
    surf 0.0 2.0 0.0 2.0 1 2 3 4
    parm u 0.00 2.00
    parm v 0.00 2.00
    trim 0.0 4.0 1
    hole 0.0 4.0 2
    trim 0.0 4.0 3
    hole 0.0 4.0 4
    end


8.      Trimming with a special curve
This example is similar to the trimmed NURB surface example (6), except
there is a special curve on the surface. This example uses negative
vertex numbers.

    # trimming curve
    vp -0.675  1.850  3.000
    vp  0.915  1.930
    vp  2.485  0.470  2.000
    vp  2.485 -1.030
    vp  1.605 -1.890 10.700
    vp -0.745 -0.654  0.500
    cstype rat bezier
    deg 3
    curv2 -6 -5 -4 -3 -2 -1 -6
    parm u 0.00 1.00 2.00
    end
    # special curve
    vp -0.185  0.322
    vp  0.214  0.818
    vp  1.652  0.207
    vp  1.652 -0.455
    curv2 -4 -3 -2 -1
    parm u 2.00 10.00
    end
    # surface
    v -1.350 -1.030 0.000
    v  0.130 -1.030 0.432 7.600
    v  1.480 -1.030 0.000 2.300
    v -1.460  0.060 0.201
    v  0.120  0.060 0.915 0.500
    v  1.380  0.060 0.454 1.500
    v -1.480  1.030 0.000 2.300
    v  0.120  1.030 0.394 6.100
    v  1.170  1.030 0.000 3.300
    cstype rat bspline
    deg 2 2
    surf -1.0 2.5 -2.0 2.0 -9 -8 -7 -6 -5 -4 -3 -2 -1
    parm u -1.00 -1.00 -1.00 2.50 2.50 2.50
    parm v -2.00 -2.00 -2.00 2.00 2.00 2.00
    trim 0.0 2.0 1
    scrv 4.2 9.7 2
    end


9.      Trimming with special points

This example extends the trimmed NURB surface example (6) to include
special points on both the trimming curve and surface. A space curve
with a special point is also included. This example uses negative
vertex numbers.

    # special point and space curve data
    vp 0.500
    vp 0.700
    vp 1.100
    vp 0.200 0.950
    v  0.300 1.500 0.100
    v  0.000  0.000  0.000
    v  1.000  1.000  0.000
    v  2.000  1.000  0.000
    v  3.000  0.000  0.000
    cstype bezier
    deg 3
    curv 0.2 0.9 -4 -3 -2 -1
    sp 1
    parm u 0.00 1.00
    end
    # trimming curve
    vp -0.675  1.850  3.000
    vp  0.915  1.930
    vp  2.485  0.470  2.000
    vp  2.485 -1.030
    vp  1.605 -1.890 10.700
    vp -0.745 -0.654  0.500
    cstype rat bezier
    curv2 -6 -5 -4 -3 -2 -1 -6
    parm u 0.00 1.00 2.00
    sp 2 3
    end
    # surface
    v -1.350 -1.030 0.000
    v  0.130 -1.030 0.432 7.600
    v  1.480 -1.030 0.000 2.300
    v -1.460  0.060 0.201
    v  0.120  0.060 0.915 0.500
    v  1.380  0.060 0.454 1.500
    v -1.480  1.030 0.000 2.300
    v  0.120  1.030 0.394 6.100
    v  1.170  1.030 0.000 3.300
    cstype rat bspline
    deg 2 2
    surf -1.0 2.5 -2.0 2.0 -9 -8 -7 -6 -5 -4 -3 -2 -1
    parm u -1.00 -1.00 -1.00 2.50 2.50 2.50
    parm v -2.00 -2.00 -2.00 2.00 2.00 2.00
    trim 0.0 2.0 1
    sp 4
    end

Connectivity between free-form surfaces

Connectivity connects two surfaces along their trimming curves.

The con statement specifies the first surface with its trimming curve
and the second surface with its trimming curve. This information is
useful for edge merging. Without this surface and curve data,
connectivity must be determined numerically at greater expense and with
reduced accuracy using the mg statement.

Connectivity between surfaces in different merging groups is ignored.
Also, although connectivity which crosses points of C1discontinuity in
trimming curves is legal, it is not recommended. Instead, use two
connectivity statements which meet at the point of discontinuity.

The two curves and their starting and ending parameters should all map
to the same curve and starting and ending points in object space.

Syntax

con  surf_1  q0_1  q1_1   curv2d_1   surf_2  q0_2  q1_2  curv2d_2

    Free-form geometry statement.

    Specifies connectivity between two surfaces.

    surf_1 is the index of the first surface.

    q0_1 is the starting parameter for the curve referenced by
    curv2d_1.

    q1_1 is the ending parameter for the curve referenced by curv2d_1.

    curv2d_1 is the index of a curve on the first surface. This curve
    must have been previously defined with the curv2 statement.

    surf_2 is the index of the second surface.

    q0_2 is the starting parameter for the curve referenced by
    curv2d_2.

    q1_2 is the ending parameter for the curve referenced by curv2d_2.

    curv2d_2 is the index of a curve on the second surface. This curve
    must have been previously defined with the curv2 statement.

Example

1.      Connectivity between two surfaces

This example shows the connectivity between two surfaces with trimming
curves.

    cstype bezier
    deg 1 1

    v 0 0 0
    v 1 0 0
    v 0 1 0
    v 1 1 0

    vp 0 0
    vp 1 0
    vp 1 1
    vp 0 1

    curv2 1 2 3 4 1
    parm u 0.0 1.0 2.0 3.0 4.0
    end

    surf 0.0 1.0 0.0 1.0 1 2 3 4
    parm u 0.0 1.0
    parm v 0.0 1.0
    trim 0.0 4.0 1
    end

    v 1 0 0
    v 2 0 0
    v 1 1 0
    v 2 1 0

    surf 0.0 1.0 0.0 1.0 5 6 7 8
    parm u 0.0 1.0
    parm v 0.0 1.0
    trim 0.0 4.0 1
    end

    con 1 2.0 2.0 1 2 4.0 3.0 1


Grouping

There are four statements in the .obj file to help you manipulate groups
of elements:

o	Gropu name statements are used to organize collections of
	elements and simplify data manipulation for operations in
	Model.

o	Smoothing group statements let you identify elements over which
	normals are to be interpolated to give those elements a smooth,
	non-faceted appearance.  This is a quick way to specify vertex
	normals.

o	Merging group statements are used to ideneify free-form elements
	that should be inspected for adjacency detection.  You can also
	use merging groups to exclude surfaces which are close enough to
	be considered adjacent but should not be merged.

o	Object name statements let you assign a name to an entire object
	in a single file.

All grouping statements are state-setting.  This means that once a
group statement is set, it alpplies to all elements that follow
until the next group statement.

This portion of a sample file shows a single element which belongs to
three groups.  The smoothing group is turned off.

    g square thing all
    s off
    f 1 2 3 4

This example shows two surfaces in merging group 1 with a merge
resolution of 0.5.

    mg 1 .5
    surf 0.0 1.0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
    surf 0.0 1.0 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Syntax

g group_name1 group_name2 . . .

    Polygonal and free-form geometry statement.

    Specifies the group name for the elements that follow it. You can
    have multiple group names. If there are multiple groups on one
    line, the data that follows belong to all groups. Group information
    is optional.

    group_name is the name for the group. Letters, numbers, and
    combinations of letters and numbers are accepted for group names.
    The default group name is default.

s group_number

    Polygonal and free-form geometry statement.

    Sets the smoothing group for the elements that follow it. If you do
    not want to use a smoothing group, specify off or a value of 0.

    To display with smooth shading in Model and PreView, you must
    create vertex normals after you have assigned the smoothing groups.
    You can create vertex normals with the vn statement or with the
    Model program.

    To smooth polygonal geometry for rendering with Image, it is
    sufficient to put elements in some smoothing group. However, vertex
    normals override smoothing information for Image.

    group_number is the smoothing group number. To turn off smoothing
    groups, use a value of 0 or off. Polygonal elements use group
    numbers to put elements in different smoothing groups. For
    free-form surfaces, smoothing groups are either turned on or off;
    there is no difference between values greater than 0.

mg group_number res

    Free-form geometry statement.

    Sets the merging group and merge resolution for the free-form
    surfaces that follow it. If you do not want to use a merging group,
    specify off or a value of 0.

    Adjacency detection is performed only within groups, never between
    groups. Connectivity between surfaces in different merging groups
    is not allowed. Surfaces in the same merging group are merged
    together along edges that are within the distance res apart.

    NOTE: Adjacency detection is an expensive numerical comparison
    process.  It is best to restrict this process to as small a domain
    as possible by using small merging groups.

    group_number is the merging group number. To turn off adjacency
    detection, use a value of 0 or off.

    res is the maximum distance between two surfaces that will be
    merged together. The resolution must be a value greater than 0.
    This is a required argument only when using merging groups.

o object_name

    Polygonal and free-form geometry statement.

    Optional statement; it is not processed by any Wavefront programs.
    It specifies a user-defined object name for the elements defined
    after this statement.

    object_name is the user-defined object name. There is no default.

Examples

1.      Cube with group names

The following example is a cube with each of its faces placed in a
separate group. In addition, all elements belong to the group cube.

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    # 8 vertices

    g front cube
    f 1 2 3 4
    g back cube
    f 8 7 6 5
    g right cube
    f 4 3 7 8
    g top cube
    f 5 1 4 8
    g left cube
    f 5 6 2 1
    g bottom cube
    f 2 6 7 3
    # 6 elements


2.      Two adjoining squares with a smoothing group

This example shows two adjoining squares that share a common edge. The
squares are placed in a smoothing group to ensure that their common
edge will be smoothed when rendered with Image.

    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    v 4.000000 0.000000 -1.255298
    v 4.000000 2.000000 -1.255298
    # 6 vertices

    g all
    s 1
    f 1 2 3 4
    f 4 3 5 6
    # 2 elements


3.      Two adjoining squares with vertex normals

This example also shows two squares that share a common edge. Vertex
normals have been added to the corners of each square to ensure that
their common edge will be smoothed during display in Model and PreView
and when rendered with Image.

    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    v 4.000000 0.000000 -1.255298
    v 4.000000 2.000000 -1.255298
    vn 0.000000 0.000000 1.000000
    vn 0.000000 0.000000 1.000000
    vn 0.276597 0.000000 0.960986
    vn 0.276597 0.000000 0.960986
    vn 0.531611 0.000000 0.846988
    vn 0.531611 0.000000 0.846988
    # 6 vertices

    # 6 normals

    g all
    s 1
    f 1//1 2//2 3//3 4//4
    f 4//4 3//3 5//5 6//6
    # 2 elements


4.      Merging group

This example shows two Bezier surfaces that meet at a common edge. They
have both been placed in the same merging group to ensure continuity at
the edge where they meet. This prevents "cracks" from appearing along
the seam between the two surfaces during rendering. Merging groups will
be ignored during flat-shading, smooth-shading, and material shading of
the surface.

    v -4.949854 -5.000000 0.000000
    v -4.949854 -1.666667 0.000000
    v -4.949854 1.666667 0.000000
    v -4.949854 5.000000 0.000000
    v -1.616521 -5.000000 0.000000
    v -1.616521 -1.666667 0.000000
    v -1.616521 1.666667 0.000000
    v -1.616521 5.000000 0.000000
    v 1.716813 -5.000000 0.000000
    v 1.716813 -1.666667 0.000000
    v 1.716813 1.666667 0.000000
    v 1.716813 5.000000 0.000000
    v 5.050146 -5.000000 0.000000
    v 5.050146 -1.666667 0.000000
    v 5.050146 1.666667 0.000000
    v 5.050146 5.000000 0.000000
    v -15.015566 -4.974991 0.000000
    v -15.015566 -1.641658 0.000000
    v -15.015566 1.691675 0.000000
    v -15.015566 5.025009 0.000000
    v -11.682233 -4.974991 0.000000
    v -11.682233 -1.641658 0.000000
    v -11.682233 1.691675 0.000000
    v -11.682233 5.025009 0.000000
    v -8.348900 -4.974991 0.000000
    v -8.348900 -1.641658 0.000000
    v -8.348900 1.691675 0.000000
    v -8.348900 5.025009 0.000000
    v -5.015566 -4.974991 0.000000
    v -5.015566 -1.641658 0.000000
    v -5.015566 1.691675 0.000000
    v -5.015566 5.025009 0.000000

    mg 1 0.500000

    cstype bezier
    deg 3 3
    surf 0.000000 1.000000 0.000000 1.000000 13 14 \
    15 16 9 10 11 12 5 6 7 8 1 2 3 4
    parm u 0.000000 1.000000
    parm v 0.000000 1.000000
    end
    surf 0.000000 1.000000 0.000000 1.000000 29 30 31 32 25 26 27 28 21 22 \
    23 24 17 18 19 20
    parm u 0.000000 1.000000
    parm v 0.000000 1.000000
    end


Display/render attributes

Display and render attributes describe how an object looks when
displayed in Model and PreView or when rendered with Image.

Some attributes apply to both free-form and polygonal geometry, such as
material name and library, ray tracing, and shadow casting.
Interpolation attributes apply only to polygonal geometry. Curve and
surface resolutions are used for only free-form geometry.

The following chart shows the display and render statements available
for polygonal and free-form geometry.

Table B1-1.     Display and render attributes

polygonal only		polygonal or free-form	free-form only
--------------		----------------------	--------------
bevel			lod			ctech
c_interp		usemtl			stech
d_interp		mtllib
			shadow_obj
			trace_obj

All display and render attribute statements are state-setting. This
means that once an attribute statement is set, it applies to all
elements that follow until it is reset to a different value.

The following sample shows rendering and display statements for a face
element.:

    s 1
    usemtl blue
    usemap marble
    f 1 2 3 4

Syntax

The following syntax statements are listed by the type of geometry.
First are statements for polygonal geometry. Second are statements for
both free-form and polygonal geometry. Third are statements for
free-form geometry only.

bevel on/off

    Polygonal geometry statement.

    Sets bevel interpolation on or off. It works only with beveled
    objects, that is, objects with sides separated by beveled faces.

    Bevel interpolation uses normal vector interpolation to give an
    illusion of roundness to a flat bevel. It does not affect the
    smoothing of non-bevelled faces.

    Bevel interpolation does not alter the geometry of the original
    object.

    on turns on bevel interpolation.

    off turns off bevel interpolation. The default is off.

    NOTE: Image cannot render bevel-interpolated elements that have
    vertex normals.

c_interp on/off

    Polygonal geometry statement.

    Sets color interpolation on or off.

    Color interpolation creates a blend across the surface of a polygon
    between the materials assigned to its vertices. This creates a
    blending of colors across a face element.

    To support color interpolation, materials must be assigned per
    vertex, not per element. The illumination models for all materials
    of vertices attached to the polygon must be the same. Color
    interpolation applies to the values for ambient (Ka), diffuse (Kd),
    specular (Ks), and specular highlight (Ns) material properties.

    on turns on color interpolation.

    off turns off color interpolation. The default is off.

d_interp on/off

    Polygonal geometry statement.

    Sets dissolve interpolation on or off.

    Dissolve interpolation creates an interpolation or blend across a
    polygon between the dissolve (d) values of the materials assigned
    to its vertices. This feature is used to create effects exhibiting
    varying degrees of apparent transparency, as in glass or clouds.

    To support dissolve interpolation, materials must be assigned per
    vertex, not per element. All the materials assigned to the vertices
    involved in the dissolve interpolation must contain a dissolve
    factor command to specify a dissolve.

    on turns on dissolve interpolation.

    off turns off dissolve interpolation. The default is off.

lod level

    Polygonal and free-form geometry statement.

    Sets the level of detail to be displayed in a PreView animation.
    The level of detail feature lets you control which elements of an
    object are displayed while working in PreView.

    level is the level of detail to be displayed. When you set the
    level of detail to 0 or omit the lod statement, all elements are
    displayed.  Specifying an integer between 1 and 100 sets the level
    of detail to be displayed when reading the .obj file.

maplib filename1 filename2 . . .

    This is a rendering identifier that specifies the map library file
    for the texture map definitions set with the usemap identifier. You
    can specify multiple filenames with maplib. If multiple filenames
    are specified, the first file listed is searched first for the map
    definition, the second file is searched next, and so on.

    When you assign a map library using the Model program, Model allows
    only one map library per .obj file. You can assign multiple
    libraries using a text editor.

    filename is the name of the library file where the texture maps are
    defined. There is no default.

usemap map_name/off

    This is a rendering identifier that specifies the texture map name
    for the element following it. To turn off texture mapping, specify
    off instead of the map name.

    If you specify texture mapping for a face without texture vertices,
    the texture map will be ignored.

    map_name is the name of the texture map.

    off turns off texture mapping. The default is off.

usemtl material_name

    Polygonal and free-form geometry statement.

    Specifies the material name for the element following it. Once a
    material is assigned, it cannot be turned off; it can only be
    changed.

    material_name is the name of the material. If a material name is
    not specified, a white material is used.

mtllib filename1 filename2 . . .

    Polygonal and free-form geometry statement.

    Specifies the material library file for the material definitions
    set with the usemtl statement. You can specify multiple filenames
    with mtllib. If multiple filenames are specified, the first file
    listed is searched first for the material definition, the second
    file is searched next, and so on.

    When you assign a material library using the Model program, only
    one map library per .obj file is allowed. You can assign multiple
    libraries using a text editor.

    filename is the name of the library file that defines the
    materials.  There is no default.

shadow_obj filename

    Polygonal and free-form geometry statement.

    Specifies the shadow object filename. This object is used to cast
    shadows for the current object. Shadows are only visible in a
    rendered image; they cannot be seen using hardware shading. The
    shadow object is invisible except for its shadow.

    An object will cast shadows only if it has a shadow object. You can
    use an object as its own shadow object. However, a simplified
    version of the original object is usually preferable for shadow
    objects, since shadow casting can greatly increase rendering time.

    filename is the filename for the shadow object. You can enter any
    valid object filename for the shadow object. The object file can be
    an .obj or .mod file. If a filename is given without an extension,
    an extension of .obj is assumed.

    Only one shadow object can be stored in a file. If more than one
    shadow object is specified, the last one specified will be used.

trace_obj filename

    Polygonal and free-form geometry statement.

    Specifies the ray tracing object filename. This object will be used
    in generating reflections of the current object on reflective
    surfaces.  Reflections are only visible in a rendered image; they
    cannot be seen using hardware shading.

    An object will appear in reflections only if it has a trace object.
    You can use an object as its own trace object. However, a
    simplified version of the original object is usually preferable for
    trace objects, since ray tracing can greatly increase rendering
    time.

    filename is the filename for the ray tracing object. You can enter
    any valid object filename for the trace object. You can enter any
    valid object filename for the shadow object. The object file can be
    an .obj or .mod file. If a filename is given without an extension,
    an extension of .obj is assumed.

    Only one trace object can be stored in a file. If more than one is
    specified, the last one is used.

ctech  technique  resolution

    Free-form geometry statement.

    Specifies a curve approximation technique. The arguments specify
    the technique and resolution for the curve.

    You must select from one of the following three techniques.

    ctech cparm res

	Specifies a curve with constant parametric subdivision using
	one resolution parameter. Each polynomial segment of the curve
	is subdivided n times in parameter space, where n is the
	resolution parameter multiplied by the degree of the curve.

	res is the resolution parameter. The larger the value, the
	finer the resolution. If res has a value of 0, each polynomial
	curve segment is represented by a single line segment.

    ctech cspace maxlength

	Specifies a curve with constant spatial subdivision. The curve
	is approximated by a series of line segments whose lengths in
	real space are less than or equal to the maxlength.

	maxlength is the maximum length of the line segments. The
	smaller the value, the finer the resolution.

    ctech curv maxdist maxangle

	Specifies curvature-dependent subdivision using separate
	resolution parameters for the maximum distance and the maximum
	angle.

	The curve is approximated by a series of line segments in which
	1) the distance in object space between a line segment and the
	actual curve must be less than the maxdist parameter and 2) the
	angle in degrees between tangent vectors at the ends of a line
	segment must be less than the maxangle parameter.

	maxdist is the distance in real space between a line segment
	and the actual curve.

	maxangle is the angle (in degrees) between tangent vectors at
	the ends of a line segment.

	The smaller the values for maxdist and maxangle, the finer the
	resolution.

    NOTE: Approximation information for trimming, hole, and special
    curves is stored in the corresponding surface. The ctech statement
    for the surface is used, not the ctech statement applied to the
    curv2 statement. Although untrimmed surfaces have no explicit
    trimming loop, a loop is constructed which bounds the legal
    parameter range. This implicit loop follows the same rules as any
    other loop and is approximated according to the ctech information
    for the surface.

stech  technique  resolution

    Free-form geometry statement.

    Specifies a surface approximation technique. The arguments specify
    the technique and resolution for the surface.

    You must select from one of the following techniques:

    stech cparma ures vres

	Specifies a surface with constant parametric subdivision using
	separate resolution parameters for the u and v directions. Each
	patch of the surface is subdivided n times in parameter space,
	where n is the resolution parameter multiplied by the degree of
	the surface.

	ures is the resolution parameter for the u direction.

	vres is the resolution parameter for the v direction.

	The larger the values for ures and vres, the finer the
	resolution.  If you enter a value of 0 for both ures and vres,
	each patch is approximated by two triangles.

    stech cparmb uvres

	Specifies a surface with constant parametric subdivision, with
	refinement using one resolution parameter for both the u and v
	directions.

	An initial triangulation is performed using only the points on
	the trimming curves. This triangulation is then refined until
	all edges are of an appropriate length. The resulting triangles
	are not oriented along isoparametric lines as they are in the
	cparma technique.

	uvres is the resolution parameter for both the u and v
	directions.  The larger the value, the finer the resolution.

    stech cspace maxlength

	Specifies a surface with constant spatial subdivision.

	The surface is subdivided in rectangular regions until the
	length in real space of any rectangle edge is less than the
	maxlength.  These rectangular regions are then triangulated.

	maxlength is the length in real space of any rectangle edge.
	The smaller the value, the finer the resolution.

    stech curv maxdist maxangle

	Specifies a surface with curvature-dependent subdivision using
	separate resolution parameters for the maximum distance and the
	maximum angle.

	The surface is subdivided in rectangular regions until 1) the
	distance in real space between the approximating rectangle and
	the actual surface is less than the maxdist (approximately) and
	2) the angle in degrees between surface normals at the corners
	of the rectangle is less than the maxangle. Following
	subdivision, the regions are triangulated.

	maxdist is the distance in real space between the approximating
	rectangle and the actual surface.

	maxangle is the angle in degrees between surface normals at the
	corners of the rectangle.

	The smaller the values for maxdist and maxangle, the finer the
	resolution.

Examples

1.      Cube with materials

This cube has a different material applied to each of its faces.

    mtllib master.mtl

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    # 8 vertices

    g front
    usemtl red
    f 1 2 3 4
    g back
    usemtl blue
    f 8 7 6 5
    g right
    usemtl green
    f 4 3 7 8
    g top
    usemtl gold
    f 5 1 4 8
    g left
    usemtl orange
    f 5 6 2 1
    g bottom
    usemtl purple
    f 2 6 7 3
    # 6 elements


2.      Cube casting a shadow

In this example, the cube casts a shadow on the other objects when it
is rendered with Image. The cube, which is stored in the file cube.obj,
references itself as the shadow object.

    mtllib master.mtl
    shadow_obj cube.obj

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    # 8 vertices

    g front
    usemtl red
    f 1 2 3 4
    g back
    usemtl blue
    f 8 7 6 5
    g right
    usemtl green
    f 4 3 7 8
    g top
    usemtl gold
    f 5 1 4 8
    g left
    usemtl orange
    f 5 6 2 1
    g bottom
    usemtl purple
    f 2 6 7 3
    # 6 elements


3.      Cube casting a reflection

This cube casts its reflection on any reflective objects when it is
rendered with Image. The cube, which is stored in the file cube.obj,
references itself as the trace object.

    mtllib master.mtl
    trace_obj cube.obj

    v 0.000000 2.000000 2.000000
    v 0.000000 0.000000 2.000000
    v 2.000000 0.000000 2.000000
    v 2.000000 2.000000 2.000000
    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    # 8 vertices

    g front
    usemtl red
    f 1 2 3 4
    g back
    usemtl blue
    f 8 7 6 5
    g right
    usemtl green
    f 4 3 7 8
    g top
    usemtl gold
    f 5 1 4 8
    g left
    usemtl orange
    f 5 6 2 1
    g bottom
    usemtl purple
    f 2 6 7 3
    # 6 elements



4.      Texture-mapped square

This example describes a 2 x 2 square. It is mapped with a 1 x 1 square
texture. The texture is stretched to fit the square exactly.

    mtllib master.mtl

    v 0.000000 2.000000 0.000000
    v 0.000000 0.000000 0.000000
    v 2.000000 0.000000 0.000000
    v 2.000000 2.000000 0.000000
    vt 0.000000 1.000000 0.000000
    vt 0.000000 0.000000 0.000000
    vt 1.000000 0.000000 0.000000
    vt 1.000000 1.000000 0.000000
    # 4 vertices

    usemtl wood
    f 1/1 2/2 3/3 4/4
    # 1 element

5.      Approximation technique for a surface

This example shows a B-spline surface which will be approximated using
curvature-dependent subdivision specified by the stech command.

    g bspatch
    v -5.000000 -5.000000 -7.808327
    v -5.000000 -1.666667 -7.808327
    v -5.000000 1.666667 -7.808327
    v -5.000000 5.000000 -7.808327
    v -1.666667 -5.000000 -7.808327
    v -1.666667 -1.666667 11.977780
    v -1.666667 1.666667 11.977780
    v -1.666667 5.000000 -7.808327
    v 1.666667 -5.000000 -7.808327
    v 1.666667 -1.666667 11.977780
    v 1.666667 1.666667 11.977780
    v 1.666667 5.000000 -7.808327
    v 5.000000 -5.000000 -7.808327
    v 5.000000 -1.666667 -7.808327
    v 5.000000 1.666667 -7.808327
    v 5.000000 5.000000 -7.808327
    # 16 vertices

    g bspatch
    cstype bspline
    stech curv 0.5 10.000000
    deg 3 3
    surf 0.000000 1.000000 0.000000 1.000000 13 14 \ 15 16 9 10 11 12 5 6 7
    8 1 2 3 4
    parm u -3.000000 -2.000000 -1.000000 0.000000  \
    1.000000 2.000000 3.000000 4.000000
    parm v -3.000000 -2.000000 -1.000000 0.000000  \
    1.000000 2.000000 3.000000 4.000000
    end
    # 1 element



6.      Approximation technique for a curve

This example shows a Bezier curve which will be approximated using
constant parametric subdivision specified by the ctech command.

    v -2.300000 1.950000 0.000000
    v -2.200000 0.790000 0.000000
    v -2.340000 -1.510000 0.000000
    v -1.530000 -1.490000 0.000000
    v -0.720000 -1.470000 0.000000
    v -0.780000 0.230000 0.000000
    v 0.070000 0.250000 0.000000
    v 0.920000 0.270000 0.000000
    v 0.800000 -1.610000 0.000000
    v 1.620000 -1.590000 0.000000
    v 2.440000 -1.570000 0.000000
    v 2.690000 0.670000 0.000000
    v 2.900000 1.980000 0.000000
    # 13 vertices

    g default
    cstype bezier
    ctech cparm 1.000000
    deg 3
    curv 0.000000 4.000000 1 2 3 4 5 6 7 8 9 10 \
    11 12 13
    parm u 0.000000 1.000000 2.000000 3.000000  \
    4.000000
    end
    # 1 element



Comments

Comments can appear anywhere in an .obj file. They are used to annotate
the file; they are not processed.

Here is an example:

    # this is a comment

The Model program automatically inserts comments when it creates .obj
files. For example, it reports the number of geometric vertices,
texture vertices, and vertex normals in a file.

    # 4 vertices
    # 4 texture vertices
    # 4 normals

Mathematics for free-form curves/surfaces

[I apologize but this section will make absolutely no sense whatsoever
 without the equations and diagrams and there was just no easy way to
 include them in a pure ASCII document.  You should probably just skip
 ahead to the section "Superseded statements."  -Jim]

General forms

Rational and non-rational curves and surfaces

In general, any non-rational curve segment may be written as:

where

K + 1    is the number of control points

di       are the control points

n        is the degree of the curve

Ni,n(t)          are the degree n basis functions

Extending this to the bivariate case, any non-rational surface patch
may be written as:

where:

K1 + 1   is the number of control points in the u direction

K2 + 1   is the number of control points in the v direction

di,j     are the control points

m        is the degree of the surface in the u direction

n        is the degree of the surface in the v direction

Ni,m(u)          are the degree m basis functions in the u direction

Nj,n(v)          are the degree n basis functions in the v direction

NOTE: The front of the surface is defined as the side where the u
parameter increases to the right and the v parameter increases upward.

We may extend this curve to the rational case as:



where wi are the weights associated with the control points di.
Similarly, a rational surface may be expressed as:

where wi,j  are the weights associated with the control points di,j.

NOTE: If a curve or surface in an .obj file is rational, it must use
the rat option with the cstype statement and it requires some weight
values for each control point.



The weights for the rational form are given as a third control point
coordinate (for trimming curves) or fourth coordinate (for space curves
and surfaces). These weights are optional and default to 1.0 if not
given.



This default weight is only reasonable for curves and surfaces whose
basis functions sum to 1.0, such as Bezier, Cardinal, and NURB. It does
not make sense for Taylor and may or may not make sense for a
representation given in basis-matrix form.

For all forms other than B-spline, the final curve or surface is
constructed by piecing together the individual curve segments or
surface patches. A global parameter space is then defined over the
entire composite curve or surface using the parameter vector given with
the parm statement.

The parameter vector for a curve is a list of p global parameter values
{t1, . . . , tp}. If t1  t < ti+1 is a point in global parameter space,
then:

is the corresponding point in local parameter space for the ith
polynomial segment. It is this t which is used when evaluating a given
segment of the piecewise curve. For surfaces, this mapping from global
to local parameter space is applied independently in both the u and v
parametric directions.

B-splines require a knot vector rather than a parameter vector,
although this is also given with the parm statement. Refer to the
description of B-splines below.

The following discussion of each type is expressed in terms of the
above definitions.

NOTE: The maximum degree for all curve and surface types is currently
set at 20, which is high enough for most purposes.



Free-form curve and surface types

B-spline

Type bspline specifies arbitrary degree non-uniform B-splines which are
commonly referred to as NURBs in their rational form. The basis
functions are defined by the Cox-deBoor recursion formulas as:

and:

where, by convention, 0/0 = 0.

The xi  {x0, . . . ,xq} form a set known as the knot vector which is
given by the parm statement. It is required that

1.      xi  xi + 1,

2.      x0 < xn + 1,

3.      xq -n -1 < xq,

4.      xi < xi + n for 0 < i < q - n - 1,

5.      xn  t min < tmax  xK+ 1, where [tmin, tmax] is the parameter
over which the B-spline is to be evaluated, and

6.      K = q - n - 1.

A knot is said to be of multiplicity r if its value is repeated r times
in the knot vector. The second through fourth conditions above restrict
knots to be of at most multiplicity n + 1 at the ends of the vector and
at most n everywhere else.

The last condition requires that the number of control points is equal
to one less than the number of knots minus the degree. For surfaces,
all of the above conditions apply independently for the u and v
parametric directions.

Bezier

Type bezier specifies arbitrary degree Bezier curves and surfaces. This
basis function is defined as:

where:

When using type bezier, the number of global parameter values given
with the parm statement must be K/n + 1, where K is the number of
control points. For surfaces, this requirement applies independently
for the u and v parametric directions.

Cardinal

Type cardinal specifies a cubic, first derivative, continuous curve or
surface. For curves, this interpolates all but the first and last
control points. For surfaces, all but the first and last row and column
of control points are interpolated.

Cardinal splines, also known as Catmull-Rom splines, are best
understood by considering the conversion from Cardinal to Bezier
control points for a single curve segment:

Here, the ci variables are the Cardinal control points and the bi
variables are the Bezier control points. We see that the second and
third Cardinal points are the beginning and ending points for the
segment, respectively. Also, the beginning tangent lies along the
vector from the first to the third point, and the ending tangent along
the vector from the second to the last point.

If we let Bi(t) be the cubic Bezier basis functions (i.e. what was
given above for Bezier as Ni,n(t) with n = 3), then we may write the
Cardinal basis functions as:

Note that Cardinal splines are only defined for the cubic case.

When using type cardinal, the number of global parameter values given
with the parm statement must be K - n + 2, where K is the number of
control points. For surfaces, this requirement applies independently
for the u and v parametric directions.

Taylor

Type taylor specifies arbitrary degree Taylor polynomial curves and
surfaces. The basis function is simply:

NOTE: The control points in this case are the polynomial coefficients
and have no obvious geometric significance.

When using type taylor, the number of global parameter values given
with the parm statement must be (K + 1)/(n + 1) + 1, where K is the
number of control points. For surfaces, this requirement applies
independently for the u and v parametric directions.

Basis matrix

Type bmatrix specifies general, arbitrary-degree curves defined through
the use of a basis matrix rather than an explicit type such as Bezier.
The basis functions are defined as:

where the basis matrix is the bi,j. In order to make the matrix nature
of this more obvious, we may also write:

When constructing basis matrices, you should keep this definition in
mind, as different authors write this in different ways. A more common
matrix representation is:

To use such matrices in the .obj file, simply transpose the matrix and
reverse the column ordering.

When using type basis, the number of global parameter values given with
the parm statement must be (K - n)/s + 2, where K is the number of
control points and s is the step size given with the step statement.
For surfaces, this requirement applies independently for the u and v
parametric directions.

Surface vertex data

Control points

The control points for a surface consisting of a single patch are
listed in the order i = 0 to K1 for j = 0, followed by i = 0 to K1 for
j = 1, and so on until j = K2.

For surfaces made up of many patches, which is the usual case, the
control points are ordered as if the surface were a single large patch.
For example, the control points for a bicubic Bezier surface consisting
of four patches would be arranged as follows:

where (m, n) is the global parameter space of the surface and the
numbers indicate the ordering of the vertex indices in the surf
statement.

Texture vertices and texture mapping

When texture vertices are not supplied, the original surface
parameterization is used for texture mapping. However, if texture
vertices are supplied, they are interpreted as additional information
to be interpolated or approximated separately from, but using the same
interpolation functions as the control vertices.

That is, whereas the surface itself, in the non-rational case, was
given in the section "Rational and non-rational curves and surfaces"
as:



the texture vertices are interpolated or approximated by:

where ti,j are the texture vertices and the basis functions are the
same as for S(u,v). It is T(u,v), rather than the surface
parameterization (u,v), which is used when a texture map is applied.

Vertex normals and normal mapping

Vertex normals are treated exactly like texture vertices. When vertex
normals are not supplied, the true surface normals are used. If vertex
normals are supplied, they are calculated as:

where qi,j are the vertex normals and the basis functions are the same
as for S(u,v) and T(u,v).

NOTE: Vertex normals do not affect the shape of the surface; they are
simply associated with the triangle vertices in the final
triangulation. As with faces, supplying vertex normals only affects
lighting calculations for the surface.

The treatment of both texture vertices and vertex normals in the case
of rational surfaces is identical. It is important to notice that even
when the surface S(u,v) is rational, the texture and normal surfaces,
T(u,v) and Q(u,v), are not rational. This is because the control points
(the texture vertices and vertex normals) are never rational.

Curve and surface operations

Special points

The following equations give a more precise description of special
points for space curves and discuss the extension to trimming curves
and surfaces.

Let C(t) be a space curve with the global parameter t. We can
approximate this curve by a set of k-1 line segments which connect the
points:

for some set of k global parameter values {t1,...,tk}

Given a special point ts in the parameter space of the curve
(referenced by vp), we guarantee that ts  {t1, . . . ,tk}. More
specifically, we approximate the curve by:

where, at the point i where ts is inserted, we have ti  ts < ti+1.

Special curves

The following equations give a more precise description of a special
curve.

Let T(t) be a special curve with the global parameter t. We have:

where (m,n) is a point in the global parameter space of a surface. We
can approximate this curve by a set of k-1 line segments which connect
the points:

for some set of k global parameter values.

Let S(m,n) be a surface with the global parameters m and n. We can
approximate this surface by a triangulation of a set of p points.

which lie on the surface. We further define E as the set of all edges
such that ei,j  E implies that S(mi,ni) and S(mj,nj) are connected in
the triangulation. Finally, we guarantee that there exists some subset
of E:

such that the points:

are connected in the triangulation.

Connectivity

Recall that the syntax of the con statement is:

con surf_1 q0_1 q1_1 curv2d_1 surf_2 q0_2 q1_2 curv2d_2

If we let:

T1(t1)  be the curve referenced by curv2d_1

S1(m1, n1)      be the surface referenced by surf1 on which T1(t1) lies

T2(t2)  be the curve referenced by curv2d_2

S2(m2, n2)      be the surface referenced by surf2 on which T2(t2) lies

then S1(T1(t1)), S2(T2(t2)) must be identical up to reparameterization.
Moreover, it must be the case that:

S1(T1(q0_1)) = S2(T2(q0_2))

and:

S1(T1(q1_1)) = S2(T2(q1_2))

It is along the curve S1(T1(t1)) between t1 = q0_1 and t1 = q1_1, and
the curve S2(T2(t2)) between t2 = q0_2 and t2 = q1_2 that the surface
S1(m1, n1) is connected to the surface S2(m2, n2).



Superseded statements

The new .obj file format has eliminated the need for several patch and
curve statements. These statements have been replaced by free-form
geometry statements.

In the 3.0 release, the following keywords have been superseded:

o       bsp

o       bzp

o       cdc

o       cdp

o       res

You can still read these statements in this version 3.0, however, the
system will no longer write files in this format.

This release is the last release that will read these statements. If
you want to save any data from this format, read in the file and write
it out. The system will convert the data to the new .obj format.

For more information on the new syntax statements, see "Specifying
free-form curves and surfaces."

Syntax

The following syntax statements are for the superseded keywords.

bsp v1 v2 . . . v16

    Specifies a B-spline patch. B-spline patches have sixteen control
    points, defined as vertices. Only four of the control points are
    distributed over the surface of the patch; the remainder are
    distributed around the perimeter of the patch.

    Patches must be tessellated in Model before they can be correctly
    shaded or rendered.

    v is the vertex number for a control point. Sixteen vertex numbers
    are required. Positive values indicate absolute vertex numbers.
    Negative values indicate relative vertex numbers.

bzp v1 v2 . . . v16

    Specifies a Bezier patch. Bezier patches have sixteen control
    points, defined as vertices. The control points are distributed
    uniformly over its surface.

    Patches must be tessellated in Model before they can be correctly
    shaded or rendered.

    v is the vertex number for a control point. Sixteen vertex numbers
    are required. Positive values indicate absolute vertex numbers.
    Negative values indicate relative vertex numbers.

cdc v1 v2 v3 v4 v5 . . .

    Specifies a Cardinal curve. Cardinal curves have a minimum of four
    control points, defined as vertices.

    Cardinal curves cannot be correctly shaded or rendered. They can be
    tessellated and then extruded in Model to create 3D shapes.

    v is the vertex number for a control point. A minimum of four
    vertex numbers are required. There is no limit on the maximum.
    Positive values indicate absolute vertex numbers. Negative values
    indicate relative vertex numbers.

cdp v1 v2 v3 . . . v16

    Specifies a Cardinal patch. Cardinal patches have sixteen control
    points, defined as vertices. Four of the control points are
    attached to the corners of the patch.

    Patches must be tessellated in Model before they can be correctly
    shaded or rendered.

    v is the vertex number for a control point. Sixteen vertex numbers
    are required. Positive values indicate absolute vertex numbers.
    Negative values indicate relative vertex numbers.

res useg vseg

    Reference and display statement.

    Sets the number of segments for Bezier, B-spline and Cardinal
    patches that follow it.

    useg is the number of segments in the u direction (horizontal or x
    direction). The minimum setting is 3 and the maximum setting is
    120.  The default is 4.

    vseg is the number of segments in the v direction (vertical or y
    direction). The minimum setting is 3 and the maximum setting is
    120.  The default is 4.

Comparison of 2.11 and 3.0 syntax

Cardinal curve

The following example shows the 2.11 syntax and the 3.0 syntax for the
same Cardinal curve.

2.11 Cardinal curve

    # 2.11 Cardinal Curve

    v 2.570000 1.280000 0.000000
    v 0.940000 1.340000 0.000000
    v -0.670000 0.820000 0.000000
    v -0.770000 -0.940000 0.000000
    v 1.030000 -1.350000 0.000000
    v 3.070000 -1.310000 0.000000
    # 6 vertices

    cdc 1 2 3 4 5 6


3.0 Cardinal curve

    # 3.0 Cardinal curve

    v 2.570000 1.280000 0.000000
    v 0.940000 1.340000 0.000000
    v -0.670000 0.820000 0.000000
    v -0.770000 -0.940000 0.000000
    v 1.030000 -1.350000 0.000000
    v 3.070000 -1.310000 0.000000
    # 6 vertices

    cstype cardinal
    deg 3
    curv 0.000000 3.000000 1 2 3 4 5 6
    parm u 0.000000 1.000000 2.000000 3.000000
    end
    # 1 element

Bezier patch

 The following example shows the 2.11 syntax and the 3.0 syntax for the
 same Bezier patch.

2.11 Bezier patch

    # 2.11 Bezier Patch
    v -5.000000 -5.000000 0.000000
    v -5.000000 -1.666667 0.000000
    v -5.000000 1.666667 0.000000
    v -5.000000 5.000000 0.000000
    v -1.666667 -5.000000 0.000000
    v -1.666667 -1.666667 0.000000
    v -1.666667 1.666667 0.000000
    v -1.666667 5.000000 0.000000
    v 1.666667 -5.000000 0.000000
    v 1.666667 -1.666667 0.000000
    v 1.666667 1.666667 0.000000
    v 1.666667 5.000000 0.000000
    v 5.000000 -5.000000 0.000000
    v 5.000000 -1.666667 0.000000
    v 5.000000 1.666667 0.000000
    v 5.000000 5.000000 0.000000
    # 16 vertices

    bzp 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
    # 1 element

3.0 Bezier patch

    #   3.0 Bezier patch

    v -5.000000 -5.000000 0.000000
    v -5.000000 -1.666667 0.000000
    v -5.000000 1.666667 0.000000
    v -5.000000 5.000000 0.000000
    v -1.666667 -5.000000 0.000000
    v -1.666667 -1.666667 0.000000
    v -1.666667 1.666667 0.000000
    v -1.666667 5.000000 0.000000
    v 1.666667 -5.000000 0.000000
    v 1.666667 -1.666667 0.000000
    v 1.666667 1.666667 0.000000
    v 1.666667 5.000000 0.000000
    v 5.000000 -5.000000 0.000000
    v 5.000000 -1.666667 0.000000
    v 5.000000 1.666667 0.000000
    v 5.000000 5.000000 0.000000
    # 16 vertices

    cstype bezier
    deg 3 3
    surf 0.000000 1.000000 0.000000 1.000000 13 14 \
    15 16 9 10 11 12 5 6 7 8 1 2 3 4
    parm u 0.000000 1.000000
    parm v 0.000000 1.000000
    end
    # 1 element