… | |
… | |
92 | match_space (); |
92 | match_space (); |
93 | match_number (y); |
93 | match_number (y); |
94 | match_space (); |
94 | match_space (); |
95 | match_number (z); |
95 | match_number (z); |
96 | match_nl (); |
96 | match_nl (); |
97 | verts. |
97 | verts.push_back (vertex_t2f_n3f_v3f (point (l0 + x, l1 + y, l2 + z), vec3 (0, 0, 1))); |
98 | push_back (vertex_t2f_n3f_v3f |
|
|
99 | (point (l0 + x, l1 + y, l2 + z), vec3 (0, 0, 1))); |
|
|
100 | // FIXME: propably vertex coloUrs ? |
98 | // FIXME: propably vertex colours ? |
101 | } |
99 | } |
|
|
100 | |
102 | match_section ('N', tmpn); |
101 | match_section ('N', tmpn); |
|
|
102 | |
103 | if (tmpn > verts.size ()) |
103 | if (tmpn > verts.size ()) |
104 | { |
104 | { |
105 | throw txtprt_i_exception ("Too many vertex normals!!"); |
105 | throw txtprt_i_exception ("Too many vertex normals!!"); |
106 | } |
106 | } |
|
|
107 | |
107 | for (i = 0; i < tmpn; i++) |
108 | for (i = 0; i < tmpn; i++) |
108 | { |
109 | { |
109 | double x, y, z; |
110 | double x, y, z; |
110 | match_number (x); |
111 | match_number (x); |
111 | match_space (); |
112 | match_space (); |
… | |
… | |
116 | verts[i].n = vec3 (x, y, z); |
117 | verts[i].n = vec3 (x, y, z); |
117 | } |
118 | } |
118 | |
119 | |
119 | match_section ('A', tmpn); |
120 | match_section ('A', tmpn); |
120 | |
121 | |
121 | vector < vertex_t2f_n3f_v3f > vd; |
122 | vector<vertex_t2f_n3f_v3f> vd; |
|
|
123 | |
122 | for (i = 0; i < tmpn; i++) |
124 | for (i = 0; i < tmpn; i++) |
123 | { |
125 | { |
124 | double a, b, c; |
126 | double a, b, c; |
125 | match_number (a); |
127 | match_number (a); |
|
|
128 | |
126 | if (verts.size () < a) |
129 | if (verts.size () < a) |
127 | throw txtprt_i_exception ("Vertex a out of range!"); |
130 | throw txtprt_i_exception ("Vertex a out of range!"); |
|
|
131 | |
128 | match_space (); |
132 | match_space (); |
129 | match_number (b); |
133 | match_number (b); |
|
|
134 | |
130 | if (verts.size () < b) |
135 | if (verts.size () < b) |
131 | throw txtprt_i_exception ("Vertex b out of range!"); |
136 | throw txtprt_i_exception ("Vertex b out of range!"); |
|
|
137 | |
132 | match_space (); |
138 | match_space (); |
133 | match_number (c); |
139 | match_number (c); |
|
|
140 | |
134 | if (verts.size () < c) |
141 | if (verts.size () < c) |
135 | throw txtprt_i_exception ("Vertex c out of range!"); |
142 | throw txtprt_i_exception ("Vertex c out of range!"); |
|
|
143 | |
136 | match_nl (); |
144 | match_nl (); |
137 | double smooth_fl; |
145 | double smooth_fl; |
138 | match_number (smooth_fl); |
146 | match_number (smooth_fl); |
139 | match_nl (); |
147 | match_nl (); |
140 | double u, v; |
148 | double u, v; |