4 - This software is part of [[../../../../index.html][QBasic apps package]].
6 Parses scene definition language and creates 3D world based on
7 it. Result will be in a [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj file]], witch can be then
8 visualized using external renderer.
10 Basic concept of defining scene is:
11 - Simple and primitive objects are created on point and polygon level.
12 - More complex ones can be created my combinig already existing ones,
13 while applying various transformations on them.
15 Objects with all its subobjects can be rotated, mirrored or resized
16 omong any axis. Generator has built in cache for data input and output
17 to minimize file access.
20 | software | preferred version |
21 |----------+-------------------|
25 + Unpack ZIP file in any folder.
26 + update include path inside bin/3dparse.bas
29 + 3dparse.bas - 3D generator main executable
30 + city1.3d - city with square-like buildings
31 + city2.3d - city with hexangular buildings
32 + result.mtl - shared material library
33 + *.bat - quick launch scripts
35 + include - 3D objects used to compose the scene
36 * Scene description language
47 defines new polygon, p4 may be unused
51 displays warning message, and wait for key
60 selects random material from list
62 : obj object xz45 xy20 x+3 y*2
63 includes sub object, can be rotated moved or resized, across X Y Z. If
64 object name begin vith ~ then it will be loaded from current
65 directory. if object name ends with ~ then object will be parsed
66 directly from file, and not chached, to allow loading of greater than
73 select random command to execute, ^ will be converted to spaces.
79 specify output file name, must be first command
81 : set variable contents
82 set variable contents, variable must be number, contents can be
83 string. max variables is 100. first is 0.
85 : anycommand %1 anything
86 inserts variable 1 contents info line
88 : cmp flag string1 string2
89 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.
92 executes command if flag is true.
94 exapmle: ?3 obj car z*2 xy45
97 dummy function, does notheing
100 Make sure you have QB binaries in your PATH. Execute
104 to generate example cities. After parsing is finished, appropriate
105 *.obj files will appear in the bin directory holding generated scene.
106 Visualize scene with your favourite renderer.
108 Download Blender files:
110 |------------------------+--------|
111 | [[file:rectangular city.blend][rectangular city.blend]] | 3.6 MB |
112 | [[file:hexagonal city.blend][hexagonal city.blend]] | 21 MB |
114 They were produced by importing generated [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj files]] into
115 [[https://www.blender.org/][Blender]].
118 [[file:rectangular city, 1.jpeg]]
120 [[file:rectangular city, 2.jpeg]]
122 [[file:rectangular city, 3.jpeg]]
124 [[file:hexagonal city, 1.jpeg]]
126 [[file:hexagonal city, 2.jpeg]]
128 [[file:hexagonal city, 3.jpeg]]
130 * (document settings) :noexport:
131 ** use dark style for TWBS-HTML exporter
132 #+HTML_HEAD: <link href="https://bootswatch.com/4/darkly/bootstrap.min.css" rel="stylesheet">
133 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
134 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
135 #+HTML_HEAD: <style type="text/css">
136 #+HTML_HEAD: footer {background-color: #111 !important;}
137 #+HTML_HEAD: pre {background-color: #111; color: #ccc;}
138 #+HTML_HEAD: </style>