3 * (document settings) :noexport:
4 ** use dark style for TWBS-HTML exporter
5 #+HTML_HEAD: <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
6 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
7 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
8 #+HTML_HEAD: <style type="text/css">
9 #+HTML_HEAD: footer {background-color: #111 !important;}
10 #+HTML_HEAD: pre {background-color: #111; color: #ccc;}
14 - This software is part of [[../../../../index.html][QBasic apps package]].
16 - This program is free software: you can redistribute it and/or modify
17 it under the terms of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] as
18 published by the Free Software Foundation, either version 3 of the
19 License, or (at your option) any later version.
23 - Homepage: http://svjatoslav.eu
24 - Email: mailto://svjatoslav@svjatoslav.eu
26 - [[http://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
29 - [[http://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]
31 - [[http://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=summary][Browse Git repository online]]
33 - Clone Git repository using command:
34 : git clone http://www2.svjatoslav.eu/git/qbasicapps.git
38 Parses scene definition language and creates 3D world based on
39 it. Result will be in a [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj file]], witch can be then
40 visualized using external renderer.
42 Basic concept of defining scene is:
43 - Simple and primitive objects are created on point and polygon level.
44 - More complex ones can be created my combinig already existing ones,
45 while applying various transformations on them.
47 Objects with all its subobjects can be rotated, mirrored or resized
48 omong any axis. Generator has built in cache for data input and output
49 to minimize file access.
52 | software | preferred version |
53 |----------+-------------------|
57 + Unpack ZIP file in any folder.
58 + update include path inside bin/3dparse.bas
61 + 3dparse.bas - 3D generator main executable
62 + city1.3d - city with square-like buildings
63 + city2.3d - city with hexangular buildings
64 + result.mtl - shared material library
65 + *.bat - quick launch scripts
67 + include - 3D objects used to compose the scene
68 * Scene description language
79 defines new polygon, p4 may be unused
83 displays warning message, and wait for key
92 selects random material from list
94 : obj object xz45 xy20 x+3 y*2
95 includes sub object, can be rotated moved or resized, across X Y Z. If
96 object name begin vith ~ then it will be loaded from current
97 directory. if object name ends with ~ then object will be parsed
98 directly from file, and not chached, to allow loading of greater than
101 [[file:rotation.png]]
104 : rnd p^1^2^3 p^7^2^1
105 select random command to execute, ^ will be converted to spaces.
111 specify output file name, must be first command
113 : set variable contents
114 set variable contents, variable must be number, contents can be
115 string. max variables is 100. first is 0.
117 : anycommand %1 anything
118 inserts variable 1 contents info line
120 : cmp flag string1 string2
121 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.
124 executes command if flag is true.
126 exapmle: ?3 obj car z*2 xy45
129 dummy function, does notheing
132 Make sure you have QB binaries in your PATH. Execute
136 to generate example cities. After parsing is finished, appropriate
137 *.obj files will appear in the bin directory holding generated scene.
138 Visualize scene with your favourite renderer.
140 Download Blender files:
142 |------------------------+--------|
143 | [[file:rectangular city.blend][rectangular city.blend]] | 3.6 MB |
144 | [[file:hexagonal city.blend][hexagonal city.blend]] | 21 MB |
146 They were produced by importing generated [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj files]] into
147 [[https://www.blender.org/][Blender]].
150 [[file:rectangular city, 1.jpeg]]
152 [[file:rectangular city, 2.jpeg]]
154 [[file:rectangular city, 3.jpeg]]
156 [[file:hexagonal city, 1.jpeg]]
158 [[file:hexagonal city, 2.jpeg]]
160 [[file:hexagonal city, 3.jpeg]]