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 |
|
#include <stdlib.h> |
#include <stdio.h> |
#include <pkvaria.h> |
#include <xgedit.h> |
|
//auxiliary function |
void |
output(int p1, point3d* p2){} |
|
int main(int argc, char *argv[]) |
{ |
CameraRecd CPos [] = { |
(CameraRecd) { |
.parallel = 1, |
.upside = 1, |
.c_fixed = 1, |
.magnification = 'A', |
.xmin = 1, |
.ymin = 2, |
.width = 24, |
.height = 32, |
.aspect = 1.5, |
.position = (point3d) {.x = 2.5, .y = 3.5, .z = 4.5}, |
.psi = 5.5, |
.theta = 6.5, |
.phi = 7.5, |
.g_centre = (point3d) {.x = 8.5, .y = 9.5, .z = 10.5}, |
.c_centre = (point3d) {.x = 11.5, .y = 12.5, .z = 13.5}, |
.xscale = 14.5, |
.yscale = 15.5, |
.CTr = (trans3d) {.U0 = { |
.a11 = 16.5, |
.a12 = 17.5, |
.a13 = 18.5, |
.a14 = 19.5, |
.a21 = 20.5, |
.a22 = 21.5, |
.a23 = 22.5, |
.a24 = 23.5, |
.a31 = 24.5, |
.a32 = 25.5, |
.a33 = 26.5, |
.a34 = 27.5}}, |
.CTrInv = (trans3d) {.U0 = { |
.a11 = 28.5, |
.a12 = 29.5, |
.a13 = 30.5, |
.a14 = 31.5, |
.a21 = 32.5, |
.a22 = 33.5, |
.a23 = 34.5, |
.a24 = 35.5, |
.a31 = 36.5, |
.a32 = 37.5, |
.a33 = 38.5, |
.a34 = 39.5}}, |
.ncplanes = 'B', |
.cplane = { |
(vector4d) { |
.x = 40.5, |
.y = 41.5, |
.z = 42.5, |
.w = 43.5}, |
(vector4d) { |
.x = 44.5, |
.y = 45.5, |
.z = 46.5, |
.w = 47.5}, |
(vector4d) { |
.x = 48.5, |
.y = 49.5, |
.z = 50.5, |
.w = 51.5}, |
(vector4d) { |
.x = 52.5, |
.y = 53.5, |
.z = 54.5, |
.w = 55.5}, |
(vector4d) { |
.x = 56.5, |
.y = 57.5, |
.z = 58.5, |
.w = 59.5}, |
(vector4d) { |
.x = 60.5, |
.y = 61.5, |
.z = 62.5, |
.w = 63.5}}, |
.zmin = 64.5, |
.zmax = 65.5, |
.vd = {.persp = { |
.f = 66.5, |
.xi0 = 67.5, |
.eta0 = 68.5, |
.dxi0 = 69.5, |
.deta0 = 70.5}}}, |
(CameraRecd) { |
.parallel = 1, |
.upside = 1, |
.c_fixed = 1, |
.magnification = 'C', |
.xmin = 5, |
.ymin = 6, |
.width = 56, |
.height = 64, |
.aspect = 71.5, |
.position = (point3d) {.x = 72.5, .y = 73.5, .z = 74.5}, |
.psi = 75.5, |
.theta = 76.5, |
.phi = 77.5, |
.g_centre = (point3d) {.x = 78.5, .y = 79.5, .z = 80.5}, |
.c_centre = (point3d) {.x = 81.5, .y = 82.5, .z = 83.5}, |
.xscale = 84.5, |
.yscale = 85.5, |
.CTr = (trans3d) {.U0 = { |
.a11 = 86.5, |
.a12 = 87.5, |
.a13 = 88.5, |
.a14 = 89.5, |
.a21 = 90.5, |
.a22 = 91.5, |
.a23 = 92.5, |
.a24 = 93.5, |
.a31 = 94.5, |
.a32 = 95.5, |
.a33 = 96.5, |
.a34 = 97.5}}, |
.CTrInv = (trans3d) {.U0 = { |
.a11 = 98.5, |
.a12 = 99.5, |
.a13 = 100.5, |
.a14 = 101.5, |
.a21 = 102.5, |
.a22 = 103.5, |
.a23 = 104.5, |
.a24 = 105.5, |
.a31 = 106.5, |
.a32 = 107.5, |
.a33 = 108.5, |
.a34 = 109.5}}, |
.ncplanes = 'D', |
.cplane = { |
(vector4d) { |
.x = 110.5, |
.y = 111.5, |
.z = 112.5, |
.w = 113.5}, |
(vector4d) { |
.x = 114.5, |
.y = 115.5, |
.z = 116.5, |
.w = 117.5}, |
(vector4d) { |
.x = 118.5, |
.y = 119.5, |
.z = 120.5, |
.w = 121.5}, |
(vector4d) { |
.x = 122.5, |
.y = 123.5, |
.z = 124.5, |
.w = 125.5}, |
(vector4d) { |
.x = 126.5, |
.y = 127.5, |
.z = 128.5, |
.w = 129.5}, |
(vector4d) { |
.x = 130.5, |
.y = 131.5, |
.z = 132.5, |
.w = 133.5}}, |
.zmin = 134.5, |
.zmax = 135.5, |
.vd = {.persp = { |
.f = 136.5, |
.xi0 = 137.5, |
.eta0 = 138.5, |
.dxi0 = 139.5, |
.deta0 = 140.5}}}, |
(CameraRecd) { |
.parallel = 1, |
.upside = 1, |
.c_fixed = 1, |
.magnification = 'E', |
.xmin = 9, |
.ymin = 10, |
.width = 8, |
.height = 16, |
.aspect = 141.5, |
.position = (point3d) {.x = 142.5, .y = 143.5, .z = 144.5}, |
.psi = 145.5, |
.theta = 146.5, |
.phi = 147.5, |
.g_centre = (point3d) {.x = 148.5, .y = 149.5, .z = 150.5}, |
.c_centre = (point3d) {.x = 151.5, .y = 152.5, .z = 153.5}, |
.xscale = 154.5, |
.yscale = 155.5, |
.CTr = (trans3d) {.U0 = { |
.a11 = 156.5, |
.a12 = 157.5, |
.a13 = 158.5, |
.a14 = 159.5, |
.a21 = 160.5, |
.a22 = 161.5, |
.a23 = 162.5, |
.a24 = 163.5, |
.a31 = 164.5, |
.a32 = 165.5, |
.a33 = 166.5, |
.a34 = 167.5}}, |
.CTrInv = (trans3d) {.U0 = { |
.a11 = 168.5, |
.a12 = 169.5, |
.a13 = 170.5, |
.a14 = 171.5, |
.a21 = 172.5, |
.a22 = 173.5, |
.a23 = 174.5, |
.a24 = 175.5, |
.a31 = 176.5, |
.a32 = 177.5, |
.a33 = 178.5, |
.a34 = 179.5}}, |
.ncplanes = 'F', |
.cplane = { |
(vector4d) { |
.x = 180.5, |
.y = 181.5, |
.z = 182.5, |
.w = 183.5}, |
(vector4d) { |
.x = 184.5, |
.y = 185.5, |
.z = 186.5, |
.w = 187.5}, |
(vector4d) { |
.x = 188.5, |
.y = 189.5, |
.z = 190.5, |
.w = 191.5}, |
(vector4d) { |
.x = 192.5, |
.y = 193.5, |
.z = 194.5, |
.w = 195.5}, |
(vector4d) { |
.x = 196.5, |
.y = 197.5, |
.z = 198.5, |
.w = 199.5}, |
(vector4d) { |
.x = 200.5, |
.y = 201.5, |
.z = 202.5, |
.w = 203.5}}, |
.zmin = 204.5, |
.zmax = 205.5, |
.vd = {.persp = { |
.f = 206.5, |
.xi0 = 207.5, |
.eta0 = 208.5, |
.dxi0 = 209.5, |
.deta0 = 210.5}}}, |
(CameraRecd) { |
.parallel = 1, |
.upside = 1, |
.c_fixed = 1, |
.magnification = 'G', |
.xmin = 3, |
.ymin = 4, |
.width = 40, |
.height = 48, |
.aspect = 211.5, |
.position = (point3d) {.x = 212.5, .y = 213.5, .z = 214.5}, |
.psi = 215.5, |
.theta = 216.5, |
.phi = 217.5, |
.g_centre = (point3d) {.x = 218.5, .y = 219.5, .z = 220.5}, |
.c_centre = (point3d) {.x = 221.5, .y = 222.5, .z = 223.5}, |
.xscale = 224.5, |
.yscale = 225.5, |
.CTr = (trans3d) {.U0 = { |
.a11 = 226.5, |
.a12 = 227.5, |
.a13 = 228.5, |
.a14 = 229.5, |
.a21 = 230.5, |
.a22 = 231.5, |
.a23 = 232.5, |
.a24 = 233.5, |
.a31 = 234.5, |
.a32 = 235.5, |
.a33 = 236.5, |
.a34 = 237.5}}, |
.CTrInv = (trans3d) {.U0 = { |
.a11 = 238.5, |
.a12 = 239.5, |
.a13 = 240.5, |
.a14 = 241.5, |
.a21 = 242.5, |
.a22 = 243.5, |
.a23 = 244.5, |
.a24 = 245.5, |
.a31 = 246.5, |
.a32 = 247.5, |
.a33 = 248.5, |
.a34 = 249.5}}, |
.ncplanes = 'H', |
.cplane = { |
(vector4d) { |
.x = 250.5, |
.y = 251.5, |
.z = 252.5, |
.w = 253.5}, |
(vector4d) { |
.x = 254.5, |
.y = 255.5, |
.z = 256.5, |
.w = 257.5}, |
(vector4d) { |
.x = 258.5, |
.y = 259.5, |
.z = 260.5, |
.w = 261.5}, |
(vector4d) { |
.x = 262.5, |
.y = 263.5, |
.z = 264.5, |
.w = 265.5}, |
(vector4d) { |
.x = 266.5, |
.y = 267.5, |
.z = 268.5, |
.w = 269.5}, |
(vector4d) { |
.x = 270.5, |
.y = 271.5, |
.z = 272.5, |
.w = 273.5}}, |
.zmin = 274.5, |
.zmax = 275.5, |
.vd = {.persp = { |
.f = 276.5, |
.xi0 = 277.5, |
.eta0 = 278.5, |
.dxi0 = 279.5, |
.deta0 = 280.5}}}, |
(CameraRecd) {0}}; |
double3 p = {.x = 281.5, .y = 282.5, .z = 283.5}; |
CameraClipPolygon3d( |
CPos, |
4, |
&p, |
&output); //target call |
return 0; |
} |
|