Reorganized files. Modernized documentation.
[qbasicapps.git] / graphics / 3D / 3D Synthezier / doc / index.html
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <title>QBasicApps - collection of applications mostly written in MS QBasic for DOS environment</title>
5 <!-- 2018-06-03 Sun 02:00 -->
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width, initial-scale=1">
8 <meta name="generator" content="Org-mode">
9 <meta name="author" content="Svjatoslav Agejenko">
10 <link href="https://bootswatch.com/4/darkly/bootstrap.min.css" rel="stylesheet">
11 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
12 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
13 <style type="text/css">
14 footer {background-color: #111 !important;}
15 pre {background-color: #111; color: #ccc;}
16 </style>
17 <style type="text/css">
18 /* org mode styles on top of twbs */
19
20 html {
21     position: relative;
22     min-height: 100%;
23 }
24
25 body {
26     font-size: 18px;
27     margin-bottom: 105px;
28 }
29
30 footer {
31     position: absolute;
32     bottom: 0;
33     width: 100%;
34     height: 101px;
35     background-color: #f5f5f5;
36 }
37
38 footer > div {
39     padding: 10px;
40 }
41
42 footer p {
43     margin: 0 0 5px;
44     text-align: center;
45     font-size: 16px;
46 }
47
48 #table-of-contents {
49     margin-top: 20px;
50     margin-bottom: 20px;
51 }
52
53 blockquote p {
54     font-size: 18px;
55 }
56
57 pre {
58     font-size: 16px;
59 }
60
61 .footpara {
62     display: inline-block;
63 }
64
65 figcaption {
66   font-size: 16px;
67   color: #666;
68   font-style: italic;
69   padding-bottom: 15px;
70 }
71
72 /* from twbs docs */
73
74 .bs-docs-sidebar.affix {
75     position: static;
76 }
77 @media (min-width: 768px) {
78     .bs-docs-sidebar {
79         padding-left: 20px;
80     }
81 }
82
83 /* All levels of nav */
84 .bs-docs-sidebar .nav > li > a {
85     display: block;
86     padding: 4px 20px;
87     font-size: 14px;
88     font-weight: 500;
89     color: #999;
90 }
91 .bs-docs-sidebar .nav > li > a:hover,
92 .bs-docs-sidebar .nav > li > a:focus {
93     padding-left: 19px;
94     color: #A1283B;
95     text-decoration: none;
96     background-color: transparent;
97     border-left: 1px solid #A1283B;
98 }
99 .bs-docs-sidebar .nav > .active > a,
100 .bs-docs-sidebar .nav > .active:hover > a,
101 .bs-docs-sidebar .nav > .active:focus > a {
102     padding-left: 18px;
103     font-weight: bold;
104     color: #A1283B;
105     background-color: transparent;
106     border-left: 2px solid #A1283B;
107 }
108
109 /* Nav: second level (shown on .active) */
110 .bs-docs-sidebar .nav .nav {
111     display: none; /* Hide by default, but at >768px, show it */
112     padding-bottom: 10px;
113 }
114 .bs-docs-sidebar .nav .nav > li > a {
115     padding-top: 1px;
116     padding-bottom: 1px;
117     padding-left: 30px;
118     font-size: 12px;
119     font-weight: normal;
120 }
121 .bs-docs-sidebar .nav .nav > li > a:hover,
122 .bs-docs-sidebar .nav .nav > li > a:focus {
123     padding-left: 29px;
124 }
125 .bs-docs-sidebar .nav .nav > .active > a,
126 .bs-docs-sidebar .nav .nav > .active:hover > a,
127 .bs-docs-sidebar .nav .nav > .active:focus > a {
128     padding-left: 28px;
129     font-weight: 500;
130 }
131
132 /* Nav: third level (shown on .active) */
133 .bs-docs-sidebar .nav .nav .nav {
134     padding-bottom: 10px;
135 }
136 .bs-docs-sidebar .nav .nav .nav > li > a {
137     padding-top: 1px;
138     padding-bottom: 1px;
139     padding-left: 40px;
140     font-size: 12px;
141     font-weight: normal;
142 }
143 .bs-docs-sidebar .nav .nav .nav > li > a:hover,
144 .bs-docs-sidebar .nav .nav .nav > li > a:focus {
145     padding-left: 39px;
146 }
147 .bs-docs-sidebar .nav .nav .nav > .active > a,
148 .bs-docs-sidebar .nav .nav .nav > .active:hover > a,
149 .bs-docs-sidebar .nav .nav .nav > .active:focus > a {
150     padding-left: 38px;
151     font-weight: 500;
152 }
153
154 /* Show and affix the side nav when space allows it */
155 @media (min-width: 992px) {
156     .bs-docs-sidebar .nav > .active > ul {
157         display: block;
158     }
159     /* Widen the fixed sidebar */
160     .bs-docs-sidebar.affix,
161     .bs-docs-sidebar.affix-bottom {
162         width: 213px;
163     }
164     .bs-docs-sidebar.affix {
165         position: fixed; /* Undo the static from mobile first approach */
166         top: 20px;
167     }
168     .bs-docs-sidebar.affix-bottom {
169         position: absolute; /* Undo the static from mobile first approach */
170     }
171     .bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
172         margin-top: 0;
173         margin-bottom: 0
174     }
175 }
176 @media (min-width: 1200px) {
177     /* Widen the fixed sidebar again */
178     .bs-docs-sidebar.affix-bottom,
179     .bs-docs-sidebar.affix {
180         width: 263px;
181     }
182 }
183 </style>
184 <script type="text/javascript">
185 $(function() {
186     'use strict';
187
188     $('.bs-docs-sidebar li').first().addClass('active');
189
190     $(document.body).scrollspy({target: '.bs-docs-sidebar'});
191
192     $('.bs-docs-sidebar').affix();
193 });
194 </script>
195 </head>
196 <body>
197 <div id="content" class="container">
198 <div class="row"><div class="col-md-9"><h1 class="title">QBasicApps - collection of applications mostly written in MS QBasic for DOS environment</h1>
199 <hr >
200 <ul class="org-ul">
201 <li><a href="http://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=snapshot;h=HEAD;sf=tgz">download latest snapshot</a>
202 </li>
203
204 <li>This program is free software; you can redistribute it and/or modify
205 it under the terms of version 3 of the <a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public
206 License</a> or later as published by the Free Software Foundation.
207 </li>
208
209 <li>Program author:
210 <ul class="org-ul">
211 <li>Svjatoslav Agejenko
212 </li>
213 <li>Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
214 </li>
215 <li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
216 </li>
217 </ul>
218 </li>
219
220 <li><a href="http://www.svjatoslav.eu/programs.jsp">other applications hosted at svjatoslav.eu</a>
221 </li>
222 </ul>
223
224
225
226 <p>
227 Parses scene definition language and creates 3D world based on
228 it. Result will be in a <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">wavefront obj file</a>, witch can be then
229 visualized using external renderer.
230 </p>
231
232 <p>
233 Basic concept of defining scene is:
234 </p>
235 <ul class="org-ul">
236 <li>Simple and primitive objects are created on point and polygon level.
237 </li>
238 <li>More complex ones can be created my combinig already existing ones,
239 while applying various transformations on them.
240 </li>
241 </ul>
242
243 <p>
244 Objects with all its subobjects can be rotated, mirrored or resized
245 omong any axis. Generator has built in cache for data input and output
246 to minimize file access.
247 </p>
248
249 <div id="outline-container-sec-1" class="outline-2">
250 <h2 id="sec-1"><span class="section-number-2">1</span> System requirements</h2>
251 <div class="outline-text-2" id="text-1">
252 <table class="table table-striped table-bordered table-hover table-condensed">
253
254
255 <colgroup>
256 <col  class="left">
257
258 <col  class="right">
259 </colgroup>
260 <thead>
261 <tr>
262 <th scope="col" class="text-left">software</th>
263 <th scope="col" class="text-right">preferred version</th>
264 </tr>
265 </thead>
266 <tbody>
267 <tr>
268 <td class="text-left">DOS</td>
269 <td class="text-right">6.22</td>
270 </tr>
271
272 <tr>
273 <td class="text-left">QBasic</td>
274 <td class="text-right">4.5</td>
275 </tr>
276 </tbody>
277 </table>
278 </div>
279 </div>
280 <div id="outline-container-sec-2" class="outline-2">
281 <h2 id="sec-2"><span class="section-number-2">2</span> Installation</h2>
282 <div class="outline-text-2" id="text-2">
283 <ul class="org-ul">
284 <li>Unpack ZIP file in any folder.
285 </li>
286 <li>update include path inside  bin/3dparse.bas
287 </li>
288 </ul>
289 </div>
290 <div id="outline-container-sec-2-0-1" class="outline-4">
291 <h4 id="sec-2-0-1"><span class="section-number-4">2.0.1</span> Directory layout</h4>
292 <div class="outline-text-4" id="text-2-0-1">
293 <ul class="org-ul">
294 <li>bin
295 <ul class="org-ul">
296 <li>3dparse.bas - 3D generator main executable
297 </li>
298 <li>city1.3d - city with square-like buildings
299 </li>
300 <li>city2.3d - city with hexangular buildings
301 </li>
302 <li>result.mtl - shared material library
303 </li>
304 <li>*.bat - quick launch scripts
305 </li>
306 </ul>
307 </li>
308
309 <li>include - 3D objects used to compose the scene
310 </li>
311 </ul>
312 </div>
313 </div>
314 </div>
315 <div id="outline-container-sec-3" class="outline-2">
316 <h2 id="sec-3"><span class="section-number-2">3</span> Scene description language</h2>
317 <div class="outline-text-2" id="text-3">
318 <p>
319 (read examples&#x2026;)
320 </p>
321
322
323 <pre class="example">
324 here
325 </pre>
326 <p>
327 defines new segment
328 </p>
329
330 <pre class="example">
331 p  x y z
332 </pre>
333 <p>
334 defines new point
335 </p>
336
337 <pre class="example">
338 f  p1 p2 p3 p4
339 </pre>
340 <p>
341 defines new polygon,  p4  may be unused
342 </p>
343
344
345 <pre class="example">
346 warn  &lt;message&gt;
347 </pre>
348 <p>
349 displays warning message, and wait for key
350 </p>
351
352 <pre class="example">
353 end
354 </pre>
355 <p>
356 terminates parser
357 </p>
358
359 <pre class="example">
360 mtl  material
361 </pre>
362 <p>
363 selects material
364 </p>
365
366 <pre class="example">
367 mtlrnd  material ...
368 </pre>
369 <p>
370 selects random material from list
371 </p>
372
373 <pre class="example">
374 obj  object xz45 xy20 x+3 y*2
375 </pre>
376 <p>
377 includes sub object, can be rotated moved or resized, across X Y Z. If
378 object name begin vith ~ then it will be loaded from current
379 directory.  if object name ends with ~ then object will be parsed
380 directly from file, and not chached, to allow loading of greater than
381 500 lines files.
382 </p>
383
384
385 <figure>
386 <p><img src="rotation.png" class="img-responsive" alt="rotation.png">
387 </p>
388 </figure>
389
390
391 <pre class="example">
392 rnd  p^1^2^3 p^7^2^1
393 </pre>
394 <p>
395 select random command to execute, ^ will be converted to spaces.
396 </p>
397
398 <pre class="example">
399 # whatever text
400 </pre>
401 <p>
402 comment
403 </p>
404
405 <pre class="example">
406 out  file
407 </pre>
408 <p>
409 specify output file name, must be first command
410 </p>
411
412 <pre class="example">
413 set  variable  contents
414 </pre>
415 <p>
416 set variable contents, variable must be number, contents can be
417 string. max variables is 100. first is 0.
418 </p>
419
420 <pre class="example">
421 anycommand %1 anything
422 </pre>
423 <p>
424 inserts variable 1 contents info line
425 </p>
426
427 <pre class="example">
428 cmp  flag string1 string2
429 </pre>
430 <p>
431 compares strings, and inserts TRUE to flag, if they are equal, else inserts FALSE. max 9 falgs, 0 first. Each subobject has its own flags.
432 </p>
433
434 <pre class="example">
435 ?flag anycommand
436 </pre>
437 <p>
438 executes command if flag is true.
439 </p>
440
441 <p>
442 exapmle: ?3 obj car z*2 xy45
443 </p>
444
445 <pre class="example">
446 dum
447 </pre>
448 <p>
449 dummy function, does notheing
450 </p>
451 </div>
452 </div>
453
454 <div id="outline-container-sec-4" class="outline-2">
455 <h2 id="sec-4"><span class="section-number-2">4</span> Usage</h2>
456 <div class="outline-text-2" id="text-4">
457 <p>
458 Make sure you have QB binaries in your PATH.  Execute
459 </p>
460 <pre class="example">
461 bin/city1.bat
462 </pre>
463 <p>
464 or
465 </p>
466 <pre class="example">
467 bin/city2.bat
468 </pre>
469 <p>
470 to generate example cities. After parsing is finished, appropriate
471 *.obj files will appear in the bin directory holding generated scene.
472 Visualize scene with your favourite renderer.
473 </p>
474 </div>
475 </div>
476 <div id="outline-container-sec-5" class="outline-2">
477 <h2 id="sec-5"><span class="section-number-2">5</span> Examples</h2>
478 <div class="outline-text-2" id="text-5">
479 <p>
480 Download Blender files:
481 </p>
482 <table class="table table-striped table-bordered table-hover table-condensed">
483
484
485 <colgroup>
486 <col  class="left">
487
488 <col  class="left">
489 </colgroup>
490 <thead>
491 <tr>
492 <th scope="col" class="text-left">file</th>
493 <th scope="col" class="text-left">size</th>
494 </tr>
495 </thead>
496 <tbody>
497 <tr>
498 <td class="text-left"><a href="rectangular city.blend">rectangular city.blend</a></td>
499 <td class="text-left">3.6 MB</td>
500 </tr>
501
502 <tr>
503 <td class="text-left"><a href="hexagonal city.blend">hexagonal city.blend</a></td>
504 <td class="text-left">21 MB</td>
505 </tr>
506 </tbody>
507 </table>
508
509 <p>
510 They were produced by importing generated <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">wavefront obj files</a> into
511 <a href="https://www.blender.org/">Blender</a>.
512 </p>
513 </div>
514
515 <div id="outline-container-sec-5-1" class="outline-3">
516 <h3 id="sec-5-1"><span class="section-number-3">5.1</span> Rectangular city</h3>
517 <div class="outline-text-3" id="text-5-1">
518
519 <figure>
520 <p><img src="rectangular city, 1.jpeg" class="img-responsive" alt="rectangular city, 1.jpeg">
521 </p>
522 </figure>
523
524
525 <figure>
526 <p><img src="rectangular city, 2.jpeg" class="img-responsive" alt="rectangular city, 2.jpeg">
527 </p>
528 </figure>
529
530
531 <figure>
532 <p><img src="rectangular city, 3.jpeg" class="img-responsive" alt="rectangular city, 3.jpeg">
533 </p>
534 </figure>
535 </div>
536 </div>
537 <div id="outline-container-sec-5-2" class="outline-3">
538 <h3 id="sec-5-2"><span class="section-number-3">5.2</span> Hexagonal city</h3>
539 <div class="outline-text-3" id="text-5-2">
540
541 <figure>
542 <p><img src="hexagonal city, 1.jpeg" class="img-responsive" alt="hexagonal city, 1.jpeg">
543 </p>
544 </figure>
545
546
547 <figure>
548 <p><img src="hexagonal city, 2.jpeg" class="img-responsive" alt="hexagonal city, 2.jpeg">
549 </p>
550 </figure>
551
552
553 <figure>
554 <p><img src="hexagonal city, 3.jpeg" class="img-responsive" alt="hexagonal city, 3.jpeg">
555 </p>
556 </figure>
557 </div>
558 </div>
559 </div>
560 </div><div class="col-md-3"><nav id="table-of-contents">
561 <div id="text-table-of-contents" class="bs-docs-sidebar">
562 <ul class="nav">
563 <li><a href="#sec-1">1. System requirements</a></li>
564 <li><a href="#sec-2">2. Installation</a></li>
565 <li><a href="#sec-3">3. Scene description language</a></li>
566 <li><a href="#sec-4">4. Usage</a></li>
567 <li><a href="#sec-5">5. Examples</a>
568 <ul class="nav">
569 <li><a href="#sec-5-1">5.1. Rectangular city</a></li>
570 <li><a href="#sec-5-2">5.2. Hexagonal city</a></li>
571 </ul>
572 </li>
573 </ul>
574 </div>
575 </nav>
576 </div></div></div>
577 <footer id="postamble" class="">
578 <div><p class="author">Author: Svjatoslav Agejenko</p>
579 <p class="date">Created: 2018-06-03 Sun 02:00</p>
580 <p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.1.1 (<a href="http://orgmode.org">Org-mode</a> 8.2.10)</p>
581 </div>
582 </footer>
583 </body>
584 </html>