| 5 |
|
.SH SYNOPSIS |
| 6 |
|
.B obj2mesh |
| 7 |
|
[ |
| 8 |
+ |
.B "\-a matinput" |
| 9 |
+ |
][ |
| 10 |
|
.B "\-n objlim" |
| 11 |
|
][ |
| 12 |
|
.B "\-r maxres" |
| 27 |
|
which is sent to |
| 28 |
|
.I output.rtm |
| 29 |
|
(or standard output). |
| 30 |
+ |
Any RADIANCE material descriptions included via one or more |
| 31 |
+ |
.I \-a |
| 32 |
+ |
options will be compiled and stored in the mesh as well. |
| 33 |
|
This mesh may be included in a RADIANCE scene description via the |
| 34 |
|
.I mesh |
| 35 |
|
primitive, thus: |
| 42 |
|
.br |
| 43 |
|
0 |
| 44 |
|
.PP |
| 45 |
< |
The syntax and semantics are nearly identical to the RADIANCE |
| 45 |
> |
The syntax and semantics are identical to the RADIANCE |
| 46 |
|
.I instance |
| 47 |
< |
primitive, except that the mesh modifier may not be "void", since |
| 48 |
< |
materials are not included in a compiled mesh file. |
| 47 |
> |
primitive. |
| 48 |
> |
If |
| 49 |
> |
.I mod |
| 50 |
> |
is "void", then the stored mesh materials will be applied during rendering. |
| 51 |
> |
Otherwise, the given material will be substituted on |
| 52 |
> |
all the mesh surfaces. |
| 53 |
|
.PP |
| 54 |
|
The |
| 55 |
|
.I \-n |
| 60 |
|
Smaller values may produce faster renderings, |
| 61 |
|
since the default number (15) is on the high side to reduce |
| 62 |
|
the compiled mesh octree size. |
| 63 |
< |
Values below 6 are not recommended, since the median |
| 64 |
< |
valence (number of adjacent faces) for a mesh vertex is 6, |
| 65 |
< |
and smaller limits will result in pointless octree subdivision. |
| 63 |
> |
Values below 6 are not recommended, since this is the median |
| 64 |
> |
valence for a mesh vertex (the number of adjacent faces), |
| 65 |
> |
and smaller values will result in pointless octree subdivision. |
| 66 |
|
.PP |
| 67 |
|
The |
| 68 |
|
.I \-r |
| 79 |
|
between machines. |
| 80 |
|
The only limitation is that machines with radically different integer |
| 81 |
|
sizes will not work together. |
| 82 |
+ |
.SH DETAILS |
| 83 |
+ |
The following Wavefront statements are understood and compiled by |
| 84 |
+ |
.I obj2mesh. |
| 85 |
+ |
.TP 10n |
| 86 |
+ |
.BI v " x y z" |
| 87 |
+ |
A vertex location, given by its Cartesian coordinates. |
| 88 |
+ |
The final mesh position may of course be modified by |
| 89 |
+ |
the transform arguments given to the |
| 90 |
+ |
.I mesh |
| 91 |
+ |
primitive in the Radiance scene description. |
| 92 |
+ |
.TP |
| 93 |
+ |
.BI vn " dx dy dz" |
| 94 |
+ |
A vertex normal vector, given by its three |
| 95 |
+ |
direction components, which will be normalized by |
| 96 |
+ |
.I obj2mesh. |
| 97 |
+ |
Normals will be interpolated over the mesh |
| 98 |
+ |
during rendering to produce a smooth surface. |
| 99 |
+ |
If no vertex normals are present, the mess will appear tesselated. |
| 100 |
+ |
A zero length normal (i.e., 0 0 0) will generate a syntax error. |
| 101 |
+ |
.TP |
| 102 |
+ |
.BI vt " u v" |
| 103 |
+ |
A local vertex texture coordinate. |
| 104 |
+ |
These coordinates will be interpolated and passed |
| 105 |
+ |
to the "Lu" and "Lv" variables during rendering. |
| 106 |
+ |
Local coordinates can extend over any desired range of values. |
| 107 |
+ |
.TP |
| 108 |
+ |
.BI usemtl " mname" |
| 109 |
+ |
A material name. |
| 110 |
+ |
The following faces will use the named material, which is |
| 111 |
+ |
taken from the material definitions in the |
| 112 |
+ |
.I \-a |
| 113 |
+ |
input file(s). |
| 114 |
+ |
.TP |
| 115 |
+ |
.BI g " gname" |
| 116 |
+ |
Group association. |
| 117 |
+ |
The following faces are associated with the named group. |
| 118 |
+ |
If no "usemtl" statement has been |
| 119 |
+ |
encountered, the current group is used for the surface material |
| 120 |
+ |
identifier. |
| 121 |
+ |
.TP |
| 122 |
+ |
.BI f " v1/t1/n1 v2/t2/n2 v3/t3/n3" " .." |
| 123 |
+ |
A polygonal face. |
| 124 |
+ |
Polygon vertices are specified as three indices separated |
| 125 |
+ |
by slashes ('/'). |
| 126 |
+ |
The first index is the vertex location, the |
| 127 |
+ |
second index is the local (u,v) texture coordinate, and the |
| 128 |
+ |
third index is the vertex surface normal. |
| 129 |
+ |
Positive indices count from the beginning of the input, |
| 130 |
+ |
where the first vertex position ( |
| 131 |
+ |
.I v |
| 132 |
+ |
statement) is numbered 1, and likewise |
| 133 |
+ |
for the first texture coordinate and the first surface normal. |
| 134 |
+ |
Negative indices count backward from the current position in |
| 135 |
+ |
the input, where -1 is the last vertex encountered, -2 |
| 136 |
+ |
is the one before that, etc. |
| 137 |
+ |
An index of 0 may be used for the vertex texture or normal to |
| 138 |
+ |
indicate none, or these may be left off entirely. |
| 139 |
+ |
All faces will be broken into triangles in the final mesh. |
| 140 |
+ |
.I Obj2mesh |
| 141 |
+ |
currently makes an unsafe assumption that faces are convex, |
| 142 |
+ |
which may result in odd results if they are not. |
| 143 |
+ |
.PP |
| 144 |
+ |
All other statement types will be ignored on the input. |
| 145 |
+ |
Statements understood by |
| 146 |
+ |
.I obj2rad(1) |
| 147 |
+ |
will be ignored silently; other statements will generate |
| 148 |
+ |
a warning message after translation to indicate how much was missed. |
| 149 |
|
.SH DIAGNOSTICS |
| 150 |
|
There are four basic error types reported by obj2mesh: |
| 151 |
|
.IP |
| 164 |
|
.IP "Set overflow in addobject (id)" |
| 165 |
|
This error occurs when too many surfaces are close together in a |
| 166 |
|
scene. |
| 167 |
< |
Sometimes a dense mesh can be accomodated by increasing |
| 167 |
> |
Sometimes a dense mesh can be accommodated by increasing |
| 168 |
|
the maximum resolution (by powers of two) using the |
| 169 |
|
.I \-r |
| 170 |
|
option, but usually this error indicates something is wrong. |
| 183 |
|
.SH AUTHOR |
| 184 |
|
Greg Ward |
| 185 |
|
.SH "SEE ALSO" |
| 186 |
< |
gensurf(1), getinfo(1), make(1), |
| 186 |
> |
gensurf(1), getinfo(1), make(1), obj2rad(1), |
| 187 |
|
oconv(1), rpict(1), rview(1), rtrace(1), xform(1) |