1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>3D Synthezier</title>
11 This QBasic program was written by me in around 2003. It parses scene
12 definition language and creates 3D world based on it. Result will be
13 in a wavefront obj file, witch can be then visualized using external
16 Basic concept of defining scene is:
17 Simple and primitive objects are created on point and polygon level.
18 More complex ones can be created my combinig already existing ones,
19 while applying various transformations on them.
21 Objects with all its subobjects can be rotated, flipped or resized
22 omong any axis. Generator has built in cache for data input and
23 output to minimize file access.
29 <BR/><IMG src="city1.jpg">
30 <BR/>Attempt to make "Fifth Eelement" like city.
33 <BR/><IMG src="city2.jpg">
34 <BR/>Attempt to make "Fifth Eelement" like city. Night.
37 <BR/><IMG src="city3.jpg">
38 <BR/>Attempt to make "Fifth Eelement" like city. Night.
42 <BR/><IMG src="c1.jpg">
46 <BR/><IMG src="c2.jpg">
47 <BR/>Hexangular city, closer.
50 <BR/><IMG src="c3.jpg">
51 <BR/>Hexangular city, even closer.
58 I converted these 2 generated cities also
59 to <a href="http://www.blender.org/">Blender</a> format so you can
60 explore them interactively :)
63 <a href="city_square.blend">Square city (3.5 MB)</a>
64 <a href="city_hexagon.blend">Hexagonal city (20.3 MB)</a>
73 QBasic (4.5 preferred)
79 * Unpack ZIP file in any folder.
80 * update include path inside bin/3dparse.bas
86 Make sure you have QB binaries in your PATH.
87 Execute bin/city1.bat or bin/city2.bat to generate example citys.
88 After parsing is finished appropriate *.obj files will
89 appear in the bin directory holding generated scene.
90 Visualize scene with your favourite renderer.
91 (3D Studio MAX or Nugraf 3D rendering System will do)
98 3dparse.bas 3D generator main executable
99 city1.3d city with square-like buildings
100 city2.3d city with hexangular buildings
101 result.mtl shared material library
102 *.bat quick launch scripts
104 include 3D objects used to compose the scene
107 Scene description language
108 ==========================
112 here - defines new segment
113 p x y z - defines new point
114 f p1 p2 p3 p4 - defines new polygon, p4 may be unused
115 warn message - displays warning message, and wait for key
116 end - terminates parser
117 mtl material - selects material
118 mtlrnd material ... - selects random material from list
119 obj object xz45 xy20 x+3 y*2 - includes sub object, can be rotated moved
121 across X Y Z. If object name begin vith ~
122 then it will be loaded from current directory.
123 if object name ends with ~ then object will
124 be parsed directly from file, and not chached,
125 to allow loading of greater than 500 lines
130 rnd p^1^2^3 p^7^2^1 - select random command to execute, ^ will be
132 # whatever text - comment
133 out file - specify output file name, must be first command
134 set variable contents - set variable contents, variable must be
135 number, contents can be string. max variables
137 anycommand %1 anything - inserts variable 1 contents info line
138 cmp flag string1 string2 - compares strings, and inserts TRUE to flag, if
139 they are equal, else inserts FALSE. max 9 falgs
140 ,0 first. Each subobject has its own flags.
141 ?flag anycommand - executes command if flag is true.
142 exapmle: ?3 obj car z*2 xy45
143 dum - dummy function, does notheing