4 <title>3D Synthezier</title>
5 <!-- 2019-01-20 Sun 03:19 -->
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;}
17 <style type="text/css">
18 /* org mode styles on top of twbs */
35 background-color: #f5f5f5;
62 display: inline-block;
74 .bs-docs-sidebar.affix {
77 @media (min-width: 768px) {
83 /* All levels of nav */
84 .bs-docs-sidebar .nav > li > a {
91 .bs-docs-sidebar .nav > li > a:hover,
92 .bs-docs-sidebar .nav > li > a:focus {
95 text-decoration: none;
96 background-color: transparent;
97 border-left: 1px solid #A1283B;
99 .bs-docs-sidebar .nav > .active > a,
100 .bs-docs-sidebar .nav > .active:hover > a,
101 .bs-docs-sidebar .nav > .active:focus > a {
105 background-color: transparent;
106 border-left: 2px solid #A1283B;
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;
114 .bs-docs-sidebar .nav .nav > li > a {
121 .bs-docs-sidebar .nav .nav > li > a:hover,
122 .bs-docs-sidebar .nav .nav > li > a:focus {
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 {
132 /* Nav: third level (shown on .active) */
133 .bs-docs-sidebar .nav .nav .nav {
134 padding-bottom: 10px;
136 .bs-docs-sidebar .nav .nav .nav > li > a {
143 .bs-docs-sidebar .nav .nav .nav > li > a:hover,
144 .bs-docs-sidebar .nav .nav .nav > li > a:focus {
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 {
154 /* Show and affix the side nav when space allows it */
155 @media (min-width: 992px) {
156 .bs-docs-sidebar .nav > .active > ul {
159 /* Widen the fixed sidebar */
160 .bs-docs-sidebar.affix,
161 .bs-docs-sidebar.affix-bottom {
164 .bs-docs-sidebar.affix {
165 position: fixed; /* Undo the static from mobile first approach */
168 .bs-docs-sidebar.affix-bottom {
169 position: absolute; /* Undo the static from mobile first approach */
171 .bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
176 @media (min-width: 1200px) {
177 /* Widen the fixed sidebar again */
178 .bs-docs-sidebar.affix-bottom,
179 .bs-docs-sidebar.affix {
184 <script type="text/javascript">
188 $('.bs-docs-sidebar li').first().addClass('active');
190 $(document.body).scrollspy({target: '.bs-docs-sidebar'});
192 $('.bs-docs-sidebar').affix();
197 <div id="content" class="container">
198 <div class="row"><div class="col-md-9"><h1 class="title">3D Synthezier</h1>
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">
204 <li>This software is part of <a href="../../../../index.html">QBasic apps package</a>.
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.
215 <li>Svjatoslav Agejenko
217 <li>Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
219 <li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
224 <li><a href="https://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a>
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">
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>
236 <li><a href="https://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=summary">Browse Git repository online</a>
239 <li>Clone Git repository using command:
240 <pre class="example">
241 git clone https://www2.svjatoslav.eu/git/qbasicapps.git
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">
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.
260 Basic concept of defining scene is:
263 <li>Simple and primitive objects are created on point and polygon level.
265 <li>More complex ones can be created my combinig already existing ones,
266 while applying various transformations on them.
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.
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">
291 <th scope="col" class="text-left">software</th>
292 <th scope="col" class="text-right">tested version</th>
297 <td class="text-left">DOS</td>
298 <td class="text-right">6.22</td>
302 <td class="text-left">QBasic</td>
303 <td class="text-right">4.5</td>
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">
313 <li>Unpack ZIP file in any folder.
315 <li>update include path inside bin/3dparse.bas
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">
325 <li>3dparse.bas - 3D generator main executable
327 <li>city1.3d - city with square-like buildings
329 <li>city2.3d - city with hexangular buildings
331 <li>result.mtl - shared material library
333 <li>*.bat - quick launch scripts
338 <li>include - 3D objects used to compose the scene
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">
348 (read examples…)
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">
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">
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">
383 defines new polygon, p4 may be unused
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">
395 displays warning message, and wait for key
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">
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">
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">
431 selects random material from list
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
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
452 <p><img src="rotation.png" class="img-responsive" alt="rotation.png">
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">
465 select random command to execute, ^ will be converted to spaces.
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">
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">
489 specify output file name, must be first command
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
501 set variable contents, variable must be number, contents can be
502 string. max variables is 100. first is 0.
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
514 inserts variable 1 contents info line
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
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.
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">
538 executes command if flag is true.
542 exapmle: ?3 obj car z*2 xy45
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">
554 dummy function, does notheing
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">
564 Make sure you have QB binaries in your PATH. Execute
566 <pre class="example">
573 <pre class="example">
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.
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">
588 Download Blender files:
590 <table class="table table-striped table-bordered table-hover table-condensed">
600 <th scope="col" class="text-left">file</th>
601 <th scope="col" class="text-left">size</th>
606 <td class="text-left"><a href="rectangular city.blend">rectangular city.blend</a></td>
607 <td class="text-left">3.6 MB</td>
611 <td class="text-left"><a href="hexagonal city.blend">hexagonal city.blend</a></td>
612 <td class="text-left">21 MB</td>
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>.
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">
628 <p><img src="rectangular city, 1.jpeg" class="img-responsive" alt="rectangular city, 1.jpeg">
634 <p><img src="rectangular city, 2.jpeg" class="img-responsive" alt="rectangular city, 2.jpeg">
640 <p><img src="rectangular city, 3.jpeg" class="img-responsive" alt="rectangular city, 3.jpeg">
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">
650 <p><img src="hexagonal city, 1.jpeg" class="img-responsive" alt="hexagonal city, 1.jpeg">
656 <p><img src="hexagonal city, 2.jpeg" class="img-responsive" alt="hexagonal city, 2.jpeg">
662 <p><img src="hexagonal city, 3.jpeg" class="img-responsive" alt="hexagonal city, 3.jpeg">
668 </div><div class="col-md-3"><nav id="table-of-contents">
669 <div id="text-table-of-contents" class="bs-docs-sidebar">
671 <li><a href="#sec-1">1. General</a>
673 <li><a href="#sec-1-1">1.1. Source code</a></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>
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>
699 <li><a href="#sec-6">6. Usage</a></li>
700 <li><a href="#sec-7">7. Examples</a>
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>
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>