1 Welcome!
This sub-module will enable you to create 3d-models you can use in any available
3d-package to create real 3d-images with refraction-effects, shadows and whatever
you want. You could even create solid objects to put onto your (real! :-)) desk
using a 3d-printing-service!
But, you will need a lot of patience and a modern computer with at least 8 GB of RAM, otherwise it may also work, but will probably not be much fun.
You may copy this text and paste it into an editor like Wordpad for easier
reading (<Strg+A> to select all, <Strg+C> to copy it, and then use
"Paste" in your editor).
2 How does it work?
The basic idea is the one of a CT scan. You scan an object slice by slice to obtain a model of the whole.
The make it work, the object (i. e. the fractal) must to be a (pseudo-)3d-fractal. A "slice" is just a 2D-render of this object at a certain "scan-position" (z-coordinate).
So, there are five steps involved:
- Design the fractal
- Render the slices ("perform the CT scan")
- Create a model from those slices
- clean-up, smooth, refine, ... the model
- render the model in any 3d-software
3 What do we need?
You will need a lot of passion, some decent computer hardware and a few software packages for various tasks. But you do not need any expensive commercial software,
anything can be done using fine free software. All of this will be explained in the following sections in detail.
3.1 "Solid" flame fractals
What helps the most is the ability to create "solid" (i. e. not too noisy) flame-fractals, in 3d. But there are many tutorials around which help you.
Good candidates to start are the so-called "3D Bubbles", "3D Julian Bubbles" or "Xenophilia".
3.2 The JWildfire volumetric renderer
The JWildfire volumetric renderer is a specialized version of the default renderer and is capable to render a number of images (=slices) in parallel,
in order to save time. It is also multi-threaded and can use the whole power of your machine.
The parallel computation comes at the cost of higher memory consumption. You can adjust how many slices you want to generate in one step.
Imagine that all slices would fit into memory, then you could generate all slices in the same time you would just render one regular image :-)
3.3 The JWildfire Mesh-generator
The built-in mesh-generator uses the marching-cubes algorithm to create a mesh from the previously rendered slices. The mesh-generator is also multi-threaded and this way comes with very decent speed.
Please note, that it is absolutely intended that slice-rendering and mesh-generation are two distinct steps. This is because you could create different meshes
from the same set of slices by chosing different options like threshold, but generating the slices is rather expensive.
3.4 The free MeshLab-software
The free MeshLab-software is used to clean-up, smooth, reduce, ... your model.
You can download it from http://meshlab.sourceforge.net/
3.5 Any 3D-package
Use any 3D-Renderer you want, to finally render the model created in *.obj-format. If you have no idea, where to start: both Blender ( http://www.blender.org/ )
and Bryce ( http://www.daz3d.com/software/bryce) are excellent choices, the latter is not exactly free, but cost only about 20$.
4 Let's create the first model!
4.1 Inside JWildfire
- Load a previously designed "solid" flame-fractal, if you have no idea were to start, just try the example from the Appendix of this document (you may freely use and alter this for aynthing you want)
- Select the right "top-view"-position using the "CentreX", "CentreY" and "Zoom"-sliders. This the size of each "scan"
- Select slicing area (range of the "scan") using the "Position 1" and "Position 2" sliders. To help you with this those positions are visualized inside the fractal-preview
- Select the volumetric-resolution, quality and memory-consumption
- "Render width" and "Render height" specifies the resolutiuon of each slice
- "Total number of slices" specifies the number of slices and together with the slicing range ("Position 1" and "Postion 2") the cutting range
- "Slices per pass" is a major speed-up option. It allows to generate any number of slices in parallel, at nearly no CPU-cost, but, ... each slice must fit into memory.
So, the higher this value, the faster the render, but the more memory is needed.
- "Render quality" is the quality for generating slices. If you have a noisy fractal, you may need higher values. As a general rule of thumb use a quality level in the range equal or down to the half of the slice size.
- Wait until the rendering process is finished (should only take a about some minutes) and enter the "Mesh generation"-tab
- Chose your recently created slices by hitting the "From renderer"-button. If you later come back after shutting down JWildfire you can also select them from the folder you saved them to by using the "Load sequence" button
- Choose an appropriate image-downsampling value. Image-downsampling reduces the resolution of the model (i. e. reduces both size and detail-level) and makes it more smooth. You will chose values in the range of 1 ... 3 in the most cases
- Choose an appropriate filter radius for smoothing the model. Beware that this filtering can slow down the mesh-generation a lot, while it has only a rather local impact. Typical values are in the range of 0 ... 0.4
- Choose an appropriate brightness-threshold. This is the most important setting and affects at which brightness level algorithm starts to "see" the model.
The default value of 0 means that every detail of a slice which is not exactly black will find its way into the model.
Maybe it will later be filtered out by the spatial filter, but still it has a little influence. If you increase the threshold only brighter portions of the slices will be
"seen" by the mesh-generator. So increasing this threshold especially helps to filter out dark background noise. But beyond this, you can get some really interesting effect
by just playing with this setting around.
- Sometimes you may have created too many slices, for example if you used the default volumetric resolution of 512x512x512 and have a very flat object. In this case you can use the image-step-option
to skip generated slices for mesh-generation. This option defaults to 1 which means that every slice is taken into account. If you increase ot to 2, only every 2nd slice is taken etc.
- If your slices are very noisy or contain very thin details, you can apply upto two pre-filters to it. You can choose between different filters to reduce noise and increase the thickness of image details.
Just play around with different options and generate different models for later comparison to choose the best.
- Click the "Generate"-button and choose a filename for your Mesh. Currently, the meshes are saved in Wavefront *.obj-format, because it is very easy to create files in this format,
and it can be read by almost any 3d-package around. Maybe later I will add more formats.
- Note that you can cancel both slice-rendering and mesh-generation
- If you have enabled the "Auto preview"-checkbox, JWildfire will automaticall render a preview-image after creating the mesh. This may take some seconds if you create a really huge mesh.
- You can manipulate the preview by altering zoom, position and rotation. If the mesh is too large to be displayed quick, JWildfire automatically creares a reduced model
which is displayed while you modify the view. To view the complete model again, press the "Refresh Preview"-button
4.3 Inside MeshLab
- start the MeshLab-software
- for example "meshlab.exe" in the installation drawer "MeshLab" on Windows
- open the generated mesh
- choose the menu item "File"->"Import Mesh"
- turn the orientation of faces into the right direction
- choose the menu item "Filters"->"Normals, Curvature and Orientation"->"Invert Faces Orientation"
- in the next window click "Apply" and the "Close"
- eventually smooth the mesh
- for example "Filters"->"Smoothing, Fairing and Deformation"->"Taubin Smooth"
- eventually recreate the mesh with lower polygon count
- for example "Filters->"Remeshing, Simplification and Reconstruction"->"Quadric Edge Collapse Decimation" (enter any desired "Target number of faces" value)
- there are endless options to play around :-)
- finally, save the altered mesh "File"->"Export Mesh As..."
4.4 Have fun to use the model in your 3d-package
Appendix: A simple example flame to start
Just select the following text (starting with "<flame ", ending with
"</flame>") with your mouse and press <Ctrl+C> to copy it
into the clipboard, then press the "From-clipboard"-button inside JWildfire
to load this flame.
<flame name="JWildfire" version="JWildfire 1.80 ALPHA (18.07.2014)" size="732 412" center="0.07597973873633698 -0.22993868301786188" scale="128.47323641882377" rotate="0.0" filter="1.2" filter_kernel="GAUSSIAN" quality="100.0" background="0.0 0.0 0.0" bg_transparency="0" brightness="4.0" saturation="1.0" gamma="4.0" gamma_threshold="0.04" vibrancy="1.0" contrast="1.0" temporal_samples="1.0" cam_zoom="1.0" cam_pitch="0.9983283321407566" cam_yaw="-1.1588986233242349" cam_persp="0.0" cam_xfocus="0.0" cam_yfocus="0.0" cam_zfocus="0.0" cam_pos_x="0.0" cam_pos_y="0.0" cam_pos_z="0.0" cam_zpos="0.0" cam_dof="0.0" cam_dof_area="0.5" cam_dof_exponent="2.0" resolution_profile="800x600" shading_shading="FLAT" antialias_amount="0.75" antialias_radius="0.36" post_symmetry_type="NONE" post_symmetry_order="3" post_symmetry_centre_x="0.0" post_symmetry_centre_y="0.0" post_symmetry_distance="1.25" post_symmetry_rotation="6.0" frame="1" frame_count="300" >
<xform weight="0.5" color="0.0" mod_gamma="0.0" mod_gamma_speed="0.0" mod_contrast="0.0" mod_contrast_speed="0.0" mod_saturation="0.0" mod_saturation_speed="0.0" symmetry="0.0" pre_blur="1.0" bubble="1.0" oscilloscope="0.2" oscilloscope_separation="1.0" oscilloscope_frequency="3.141592653589793" oscilloscope_amplitude="1.0" oscilloscope_damping="0.0" coefs="1.0 0.0 0.0 1.0 0.0 0.0" chaos="1.0" />
<palette count="256" format="RGB" >
E65B95E15992DC588FD6568BD15588CC5385C75182C2507FBD4E7BB74D78B24B75AD4972
A8486EA3466B9D45689843659342628E405E893E5B843D587E3B55793A5274384E6F364B
6A35486533455F32425A303E552E3B502D384B2B35452A3140282E3B262B362528312325
2C222126201E211E1B1C1D18171B15121A110C180E0B170E0F1813141A19191B1E1E1C23
231D29281E2E2C1F3431203936213F3B224440234945244F4925544E265A53285F582964
5D2A6A622B6F662C756B2D7A702E80752F857A308A7E319083329588339B8D34A09236A5
9737AB9B38B0A039B6A53ABBAA3BC0AF3CC6B43DCBB83ED1BD3FD6C240DCC741E1CC42E6
D144ECD545F1D446F0CF48ECCA4AE7C64BE3C14DDEBC4FDAB850D5B352D1AE54CDA955C8
A557C4A059BF9B5ABB975CB6925EB28D5FAE8861A98463A57F65A07A669C766897716A93
6C6B8F686D8A636F865E708159727D5574785075744B777047796B427A673D7C62387E5E
3480592F81552A835126854C2186481C8843178A3F138B3A0E8D360E8A380F873A0F843C
0F823E107F3F107C41107943117645117347127049126E4B126B4D13684F136551136252
145F54145C56145A5815575A15545C15515E164E60164B62164864174665174367174069
183D6B183A6D19376F1934711932731A2F751A2C771A29781B267A1B237C1B207E1C1D80
1C1B821C18841D15861E13872115862516862817852B18852F1984321A84351C83391D83
3C1E823F1F824320814621814923804D248050257F53267F57277E5A287E5D2A7D612B7D
642C7C672D7B6B2E7B6E307A71317A7532797833797B34787F3578823777853877893976
8C3A768F3B75933C75963E74993F749D4073A04173A34272A74372AA4571A94670A6466F
A3476EA0486D9D496C9A4A6B974A6A944B69914C678E4D668B4E65884F64854F63825062
7F51617C526079535F76535E73545C70555B6D565A6957596658586358576059565D5A55
5A5B54575C53545D51515D504E5E4F4B5F4E48604D45614C42614B3F624A3C6349396448
3665463366453066442D6743</palette>
</flame>