Prefer HTTPS. Publish example Blender files.
[qbasicapps.git] / graphics / 3D / 3D Synthezier / doc / index.html
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <title>3D Synthezier</title>
5 <!-- 2019-01-20 Sun 03:19 -->
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/3/darkly/bootstrap.min.css" rel="stylesheet">
11 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
12 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/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">3D Synthezier</h1>
199
200 <div id="outline-container-sec-1" class="outline-2">
201 <h2 id="sec-1"><span class="section-number-2">1</span> General</h2>
202 <div class="outline-text-2" id="text-1">
203 <ul class="org-ul">
204 <li>This software is part of <a href="../../../../index.html">QBasic apps package</a>.
205 </li>
206
207 <li>This program is free software: you can redistribute it and/or modify
208 it under the terms of the <a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> as
209 published by the Free Software Foundation, either version 3 of the
210 License, or (at your option) any later version.
211 </li>
212
213 <li>Program author:
214 <ul class="org-ul">
215 <li>Svjatoslav Agejenko
216 </li>
217 <li>Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
218 </li>
219 <li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
220 </li>
221 </ul>
222 </li>
223
224 <li><a href="https://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a>
225 </li>
226 </ul>
227 </div>
228
229 <div id="outline-container-sec-1-1" class="outline-3">
230 <h3 id="sec-1-1"><span class="section-number-3">1.1</span> Source code</h3>
231 <div class="outline-text-3" id="text-1-1">
232 <ul class="org-ul">
233 <li><a href="https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=snapshot;h=HEAD;sf=tgz">Download latest snapshot in TAR GZ format</a>
234 </li>
235
236 <li><a href="https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=summary">Browse Git repository online</a>
237 </li>
238
239 <li>Clone Git repository using command:
240 <pre class="example">
241 git clone https://www2.svjatoslav.eu/git/qbasicapps.git
242
243 </pre>
244 </li>
245 </ul>
246 </div>
247 </div>
248 </div>
249
250 <div id="outline-container-sec-2" class="outline-2">
251 <h2 id="sec-2"><span class="section-number-2">2</span> Operating principle</h2>
252 <div class="outline-text-2" id="text-2">
253 <p>
254 Parses scene definition language and creates 3D world based on
255 it. Result will be in a <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">wavefront obj file</a>, witch can be then
256 visualized using external renderer.
257 </p>
258
259 <p>
260 Basic concept of defining scene is:
261 </p>
262 <ul class="org-ul">
263 <li>Simple and primitive objects are created on point and polygon level.
264 </li>
265 <li>More complex ones can be created my combinig already existing ones,
266 while applying various transformations on them.
267 </li>
268 </ul>
269
270 <p>
271 Objects with all its subobjects can be rotated, mirrored or resized
272 omong any axis. Generator has built in cache for data input and output
273 to minimize file access.
274 </p>
275 </div>
276 </div>
277
278 <div id="outline-container-sec-3" class="outline-2">
279 <h2 id="sec-3"><span class="section-number-2">3</span> System requirements</h2>
280 <div class="outline-text-2" id="text-3">
281 <table class="table table-striped table-bordered table-hover table-condensed">
282
283
284 <colgroup>
285 <col  class="left">
286
287 <col  class="right">
288 </colgroup>
289 <thead>
290 <tr>
291 <th scope="col" class="text-left">software</th>
292 <th scope="col" class="text-right">tested version</th>
293 </tr>
294 </thead>
295 <tbody>
296 <tr>
297 <td class="text-left">DOS</td>
298 <td class="text-right">6.22</td>
299 </tr>
300
301 <tr>
302 <td class="text-left">QBasic</td>
303 <td class="text-right">4.5</td>
304 </tr>
305 </tbody>
306 </table>
307 </div>
308 </div>
309 <div id="outline-container-sec-4" class="outline-2">
310 <h2 id="sec-4"><span class="section-number-2">4</span> Installation</h2>
311 <div class="outline-text-2" id="text-4">
312 <ul class="org-ul">
313 <li>Unpack ZIP file in any folder.
314 </li>
315 <li>update include path inside  bin/3dparse.bas
316 </li>
317 </ul>
318 </div>
319 <div id="outline-container-sec-4-0-1" class="outline-4">
320 <h4 id="sec-4-0-1"><span class="section-number-4">4.0.1</span> Directory layout</h4>
321 <div class="outline-text-4" id="text-4-0-1">
322 <ul class="org-ul">
323 <li>bin
324 <ul class="org-ul">
325 <li>3dparse.bas - 3D generator main executable
326 </li>
327 <li>city1.3d - city with square-like buildings
328 </li>
329 <li>city2.3d - city with hexangular buildings
330 </li>
331 <li>result.mtl - shared material library
332 </li>
333 <li>*.bat - quick launch scripts
334 </li>
335 </ul>
336 </li>
337
338 <li>include - 3D objects used to compose the scene
339 </li>
340 </ul>
341 </div>
342 </div>
343 </div>
344 <div id="outline-container-sec-5" class="outline-2">
345 <h2 id="sec-5"><span class="section-number-2">5</span> Scene description language</h2>
346 <div class="outline-text-2" id="text-5">
347 <p>
348 (read examples&#x2026;)
349 </p>
350 </div>
351 <div id="outline-container-sec-5-1" class="outline-3">
352 <h3 id="sec-5-1"><span class="section-number-3">5.1</span> here</h3>
353 <div class="outline-text-3" id="text-5-1">
354 <pre class="example">
355 here
356
357 </pre>
358 <p>
359 defines new segment
360 </p>
361 </div>
362 </div>
363 <div id="outline-container-sec-5-2" class="outline-3">
364 <h3 id="sec-5-2"><span class="section-number-3">5.2</span> p</h3>
365 <div class="outline-text-3" id="text-5-2">
366 <pre class="example">
367 p  x y z
368
369 </pre>
370 <p>
371 defines new point
372 </p>
373 </div>
374 </div>
375 <div id="outline-container-sec-5-3" class="outline-3">
376 <h3 id="sec-5-3"><span class="section-number-3">5.3</span> f</h3>
377 <div class="outline-text-3" id="text-5-3">
378 <pre class="example">
379 f  p1 p2 p3 p4
380
381 </pre>
382 <p>
383 defines new polygon,  p4  may be unused
384 </p>
385 </div>
386 </div>
387 <div id="outline-container-sec-5-4" class="outline-3">
388 <h3 id="sec-5-4"><span class="section-number-3">5.4</span> warn</h3>
389 <div class="outline-text-3" id="text-5-4">
390 <pre class="example">
391 warn  &lt;message&gt;
392
393 </pre>
394 <p>
395 displays warning message, and wait for key
396 </p>
397 </div>
398 </div>
399 <div id="outline-container-sec-5-5" class="outline-3">
400 <h3 id="sec-5-5"><span class="section-number-3">5.5</span> end</h3>
401 <div class="outline-text-3" id="text-5-5">
402 <pre class="example">
403 end
404
405 </pre>
406 <p>
407 terminates parser
408 </p>
409 </div>
410 </div>
411 <div id="outline-container-sec-5-6" class="outline-3">
412 <h3 id="sec-5-6"><span class="section-number-3">5.6</span> mtl</h3>
413 <div class="outline-text-3" id="text-5-6">
414 <pre class="example">
415 mtl  material
416
417 </pre>
418 <p>
419 selects material
420 </p>
421 </div>
422 </div>
423 <div id="outline-container-sec-5-7" class="outline-3">
424 <h3 id="sec-5-7"><span class="section-number-3">5.7</span> mtlrnd</h3>
425 <div class="outline-text-3" id="text-5-7">
426 <pre class="example">
427 mtlrnd  material ...
428
429 </pre>
430 <p>
431 selects random material from list
432 </p>
433 </div>
434 </div>
435 <div id="outline-container-sec-5-8" class="outline-3">
436 <h3 id="sec-5-8"><span class="section-number-3">5.8</span> obj</h3>
437 <div class="outline-text-3" id="text-5-8">
438 <pre class="example">
439 obj  object xz45 xy20 x+3 y*2
440
441 </pre>
442 <p>
443 includes sub object, can be rotated moved or resized, across X Y Z. If
444 object name begin vith ~ then it will be loaded from current
445 directory.  if object name ends with ~ then object will be parsed
446 directly from file, and not chached, to allow loading of greater than
447 500 lines files.
448 </p>
449
450
451 <figure>
452 <p><img src="rotation.png" class="img-responsive" alt="rotation.png">
453 </p>
454 </figure>
455 </div>
456 </div>
457 <div id="outline-container-sec-5-9" class="outline-3">
458 <h3 id="sec-5-9"><span class="section-number-3">5.9</span> rnd</h3>
459 <div class="outline-text-3" id="text-5-9">
460 <pre class="example">
461 rnd  p^1^2^3 p^7^2^1
462
463 </pre>
464 <p>
465 select random command to execute, ^ will be converted to spaces.
466 </p>
467 </div>
468 </div>
469 <div id="outline-container-sec-5-10" class="outline-3">
470 <h3 id="sec-5-10"><span class="section-number-3">5.10</span> #</h3>
471 <div class="outline-text-3" id="text-5-10">
472 <pre class="example">
473 # whatever text
474
475 </pre>
476 <p>
477 comment
478 </p>
479 </div>
480 </div>
481 <div id="outline-container-sec-5-11" class="outline-3">
482 <h3 id="sec-5-11"><span class="section-number-3">5.11</span> out</h3>
483 <div class="outline-text-3" id="text-5-11">
484 <pre class="example">
485 out  file
486
487 </pre>
488 <p>
489 specify output file name, must be first command
490 </p>
491 </div>
492 </div>
493 <div id="outline-container-sec-5-12" class="outline-3">
494 <h3 id="sec-5-12"><span class="section-number-3">5.12</span> set</h3>
495 <div class="outline-text-3" id="text-5-12">
496 <pre class="example">
497 set  variable  contents
498
499 </pre>
500 <p>
501 set variable contents, variable must be number, contents can be
502 string. max variables is 100. first is 0.
503 </p>
504 </div>
505 </div>
506 <div id="outline-container-sec-5-13" class="outline-3">
507 <h3 id="sec-5-13"><span class="section-number-3">5.13</span> variables usage</h3>
508 <div class="outline-text-3" id="text-5-13">
509 <pre class="example">
510 anycommand %1 anything
511
512 </pre>
513 <p>
514 inserts variable 1 contents info line
515 </p>
516 </div>
517 </div>
518 <div id="outline-container-sec-5-14" class="outline-3">
519 <h3 id="sec-5-14"><span class="section-number-3">5.14</span> cmp</h3>
520 <div class="outline-text-3" id="text-5-14">
521 <pre class="example">
522 cmp  flag string1 string2
523
524 </pre>
525 <p>
526 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.
527 </p>
528 </div>
529 </div>
530 <div id="outline-container-sec-5-15" class="outline-3">
531 <h3 id="sec-5-15"><span class="section-number-3">5.15</span> ?</h3>
532 <div class="outline-text-3" id="text-5-15">
533 <pre class="example">
534 ?flag anycommand
535
536 </pre>
537 <p>
538 executes command if flag is true.
539 </p>
540
541 <p>
542 exapmle: ?3 obj car z*2 xy45
543 </p>
544 </div>
545 </div>
546 <div id="outline-container-sec-5-16" class="outline-3">
547 <h3 id="sec-5-16"><span class="section-number-3">5.16</span> dum</h3>
548 <div class="outline-text-3" id="text-5-16">
549 <pre class="example">
550 dum
551
552 </pre>
553 <p>
554 dummy function, does notheing
555 </p>
556 </div>
557 </div>
558 </div>
559
560 <div id="outline-container-sec-6" class="outline-2">
561 <h2 id="sec-6"><span class="section-number-2">6</span> Usage</h2>
562 <div class="outline-text-2" id="text-6">
563 <p>
564 Make sure you have QB binaries in your PATH.  Execute
565 </p>
566 <pre class="example">
567 bin/city1.bat
568
569 </pre>
570 <p>
571 or
572 </p>
573 <pre class="example">
574 bin/city2.bat
575
576 </pre>
577 <p>
578 to generate example cities. After parsing is finished, appropriate
579 *.obj files will appear in the bin directory holding generated scene.
580 Visualize scene with your favourite renderer.
581 </p>
582 </div>
583 </div>
584 <div id="outline-container-sec-7" class="outline-2">
585 <h2 id="sec-7"><span class="section-number-2">7</span> Examples</h2>
586 <div class="outline-text-2" id="text-7">
587 <p>
588 Download Blender files:
589 </p>
590 <table class="table table-striped table-bordered table-hover table-condensed">
591
592
593 <colgroup>
594 <col  class="left">
595
596 <col  class="left">
597 </colgroup>
598 <thead>
599 <tr>
600 <th scope="col" class="text-left">file</th>
601 <th scope="col" class="text-left">size</th>
602 </tr>
603 </thead>
604 <tbody>
605 <tr>
606 <td class="text-left"><a href="rectangular city.blend">rectangular city.blend</a></td>
607 <td class="text-left">3.6 MB</td>
608 </tr>
609
610 <tr>
611 <td class="text-left"><a href="hexagonal city.blend">hexagonal city.blend</a></td>
612 <td class="text-left">21 MB</td>
613 </tr>
614 </tbody>
615 </table>
616
617 <p>
618 They were produced by importing generated <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">wavefront obj files</a> into
619 <a href="https://www.blender.org/">Blender</a>.
620 </p>
621 </div>
622
623 <div id="outline-container-sec-7-1" class="outline-3">
624 <h3 id="sec-7-1"><span class="section-number-3">7.1</span> Rectangular city</h3>
625 <div class="outline-text-3" id="text-7-1">
626
627 <figure>
628 <p><img src="rectangular city, 1.jpeg" class="img-responsive" alt="rectangular city, 1.jpeg">
629 </p>
630 </figure>
631
632
633 <figure>
634 <p><img src="rectangular city, 2.jpeg" class="img-responsive" alt="rectangular city, 2.jpeg">
635 </p>
636 </figure>
637
638
639 <figure>
640 <p><img src="rectangular city, 3.jpeg" class="img-responsive" alt="rectangular city, 3.jpeg">
641 </p>
642 </figure>
643 </div>
644 </div>
645 <div id="outline-container-sec-7-2" class="outline-3">
646 <h3 id="sec-7-2"><span class="section-number-3">7.2</span> Hexagonal city</h3>
647 <div class="outline-text-3" id="text-7-2">
648
649 <figure>
650 <p><img src="hexagonal city, 1.jpeg" class="img-responsive" alt="hexagonal city, 1.jpeg">
651 </p>
652 </figure>
653
654
655 <figure>
656 <p><img src="hexagonal city, 2.jpeg" class="img-responsive" alt="hexagonal city, 2.jpeg">
657 </p>
658 </figure>
659
660
661 <figure>
662 <p><img src="hexagonal city, 3.jpeg" class="img-responsive" alt="hexagonal city, 3.jpeg">
663 </p>
664 </figure>
665 </div>
666 </div>
667 </div>
668 </div><div class="col-md-3"><nav id="table-of-contents">
669 <div id="text-table-of-contents" class="bs-docs-sidebar">
670 <ul class="nav">
671 <li><a href="#sec-1">1. General</a>
672 <ul class="nav">
673 <li><a href="#sec-1-1">1.1. Source code</a></li>
674 </ul>
675 </li>
676 <li><a href="#sec-2">2. Operating principle</a></li>
677 <li><a href="#sec-3">3. System requirements</a></li>
678 <li><a href="#sec-4">4. Installation</a></li>
679 <li><a href="#sec-5">5. Scene description language</a>
680 <ul class="nav">
681 <li><a href="#sec-5-1">5.1. here</a></li>
682 <li><a href="#sec-5-2">5.2. p</a></li>
683 <li><a href="#sec-5-3">5.3. f</a></li>
684 <li><a href="#sec-5-4">5.4. warn</a></li>
685 <li><a href="#sec-5-5">5.5. end</a></li>
686 <li><a href="#sec-5-6">5.6. mtl</a></li>
687 <li><a href="#sec-5-7">5.7. mtlrnd</a></li>
688 <li><a href="#sec-5-8">5.8. obj</a></li>
689 <li><a href="#sec-5-9">5.9. rnd</a></li>
690 <li><a href="#sec-5-10">5.10. #</a></li>
691 <li><a href="#sec-5-11">5.11. out</a></li>
692 <li><a href="#sec-5-12">5.12. set</a></li>
693 <li><a href="#sec-5-13">5.13. variables usage</a></li>
694 <li><a href="#sec-5-14">5.14. cmp</a></li>
695 <li><a href="#sec-5-15">5.15. ?</a></li>
696 <li><a href="#sec-5-16">5.16. dum</a></li>
697 </ul>
698 </li>
699 <li><a href="#sec-6">6. Usage</a></li>
700 <li><a href="#sec-7">7. Examples</a>
701 <ul class="nav">
702 <li><a href="#sec-7-1">7.1. Rectangular city</a></li>
703 <li><a href="#sec-7-2">7.2. Hexagonal city</a></li>
704 </ul>
705 </li>
706 </ul>
707 </div>
708 </nav>
709 </div></div></div>
710 <footer id="postamble" class="">
711 <div><p class="author">Author: Svjatoslav Agejenko</p>
712 <p class="date">Created: 2019-01-20 Sun 03:19</p>
713 <p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="http://orgmode.org">Org-mode</a> 9.1.9)</p>
714 </div>
715 </footer>
716 </body>
717 </html>