587aaf65c30248bf71539177899ff4846cd4cf89
[qbasicapps.git] / graphics / 3D / 3D Synthezier / doc / index.org
1 #+TITLE:  QBasicApps - collection of applications mostly written in MS QBasic for DOS environment
2
3 -----
4 - [[http://www2.svjatoslav.eu/gitweb/?p=qbasicapps.git;a=snapshot;h=HEAD;sf=tgz][download latest snapshot]]
5
6 - This program is free software; you can redistribute it and/or modify
7   it under the terms of version 3 of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public
8   License]] or later as published by the Free Software Foundation.
9
10 - Program author:
11   - Svjatoslav Agejenko
12   - Homepage: http://svjatoslav.eu
13   - Email: mailto://svjatoslav@svjatoslav.eu
14
15 - [[http://www.svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]]
16
17
18
19 Parses scene definition language and creates 3D world based on
20 it. Result will be in a [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj file]], witch can be then
21 visualized using external renderer.
22
23 Basic concept of defining scene is:
24 - Simple and primitive objects are created on point and polygon level.
25 - More complex ones can be created my combinig already existing ones,
26   while applying various transformations on them.
27
28 Objects with all its subobjects can be rotated, mirrored or resized
29 omong any axis. Generator has built in cache for data input and output
30 to minimize file access.
31
32 * System requirements
33 | software | preferred version |
34 |----------+-------------------|
35 | DOS      |              6.22 |
36 | QBasic   |               4.5 |
37 * Installation
38 + Unpack ZIP file in any folder.
39 + update include path inside  bin/3dparse.bas
40 *** Directory layout
41 + bin
42   + 3dparse.bas - 3D generator main executable
43   + city1.3d - city with square-like buildings
44   + city2.3d - city with hexangular buildings
45   + result.mtl - shared material library
46   + *.bat - quick launch scripts
47
48 + include - 3D objects used to compose the scene
49 * Scene description language
50 (read examples...)
51
52
53 : here
54 defines new segment
55
56 : p  x y z
57 defines new point
58
59 : f  p1 p2 p3 p4
60 defines new polygon,  p4  may be unused
61
62
63 : warn  <message>
64 displays warning message, and wait for key
65
66 : end
67 terminates parser
68
69 : mtl  material
70 selects material
71
72 : mtlrnd  material ...
73 selects random material from list
74
75 : obj  object xz45 xy20 x+3 y*2
76 includes sub object, can be rotated moved or resized, across X Y Z. If
77 object name begin vith ~ then it will be loaded from current
78 directory.  if object name ends with ~ then object will be parsed
79 directly from file, and not chached, to allow loading of greater than
80 500 lines files.
81
82 [[file:rotation.png]]
83
84
85 : rnd  p^1^2^3 p^7^2^1
86 select random command to execute, ^ will be converted to spaces.
87
88 : # whatever text
89 comment
90
91 : out  file
92 specify output file name, must be first command
93
94 : set  variable  contents
95 set variable contents, variable must be number, contents can be
96 string. max variables is 100. first is 0.
97
98 : anycommand %1 anything
99 inserts variable 1 contents info line
100
101 : cmp  flag string1 string2
102 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.
103
104 : ?flag anycommand
105 executes command if flag is true.
106
107 exapmle: ?3 obj car z*2 xy45
108
109 : dum
110 dummy function, does notheing
111
112 * Usage
113 Make sure you have QB binaries in your PATH.  Execute
114 : bin/city1.bat
115 or
116 : bin/city2.bat
117 to generate example cities. After parsing is finished, appropriate
118 *.obj files will appear in the bin directory holding generated scene.
119 Visualize scene with your favourite renderer.
120 * Examples
121 Download Blender files:
122 | file                   | size   |
123 |------------------------+--------|
124 | [[file:rectangular city.blend][rectangular city.blend]] | 3.6 MB |
125 | [[file:hexagonal city.blend][hexagonal city.blend]]   | 21 MB  |
126
127 They were produced by importing generated [[https://en.wikipedia.org/wiki/Wavefront_.obj_file][wavefront obj files]] into
128 [[https://www.blender.org/][Blender]].
129
130 ** Rectangular city
131 [[file:rectangular city, 1.jpeg]]
132
133 [[file:rectangular city, 2.jpeg]]
134
135 [[file:rectangular city, 3.jpeg]]
136 ** Hexagonal city
137 [[file:hexagonal city, 1.jpeg]]
138
139 [[file:hexagonal city, 2.jpeg]]
140
141 [[file:hexagonal city, 3.jpeg]]
142
143 * (document settings) :noexport:
144 ** use dark style for TWBS-HTML exporter
145 #+HTML_HEAD: <link href="https://bootswatch.com/4/darkly/bootstrap.min.css" rel="stylesheet">
146 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
147 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
148 #+HTML_HEAD: <style type="text/css">
149 #+HTML_HEAD:   footer {background-color: #111 !important;}
150 #+HTML_HEAD:   pre {background-color: #111; color: #ccc;}
151 #+HTML_HEAD: </style>