gifWhelk Readme

Whelk is a small interactive OpenGL program that generates a cornucopia of shells horns and many other 3D spiral forms. Exports Wavefront OBJ and POV-Ray mesh2. Copyright (c) Nicholas Shea 2014


This is a 32 bit development version; some features are disabled. The program has been tested on Windows XP 32 bit and Windows 7 64 bit.


Right mouse button: drag to zoom in and out.

Middle mouse button: drag to translate.

Left mouse button: drag to tumble; click to stop tumble.

Left and Right mouse buttons together: resets the view.


Wavefont OBJ; POV-Ray mesh2.

Files are exported using the current drawing attributes set in the View menu. Thus, if smooth shading is on (in the View menu), then the file exports with with weighted vertex normals. Be sure to turn on smooth shading if you want smooth triangles in your export file.


Built using mingw tool-chain and FLTK user interface tool kit. Whelk links to a modified version of WildMagic5p13 mathematics and custom versions of the Core and Application layers. Whelk uses modified FL_Trackball code with Wm5 Quaternion and Vector3. Please see the files BVM_Trackball and BVM_Gl_View for modifications.


Consult the Whelk home page:



Whelk-0-0-3q dev snapshot      [ Uploaded: 01 April 2015 ]               

Bugfix: Custom Profile UI state IO streaming. (The toggle button state was
incorrectly set after implementing Mobius inversion in Whelk-0-0-3k).
Whelk-0-0-3p dev snapshot      [ Uploaded: 01 April 2015 ]               

Implemented Perlin noise for the generator. Added two Perlin noise demos:


Perlin control panel widgets:
P:     the amount of turbulence to apply. Valid range is 0 to 1.
Oct:   the number of octaves. Valid range is 1 to 16.
k:     turbulence scaling factor
Seed:  re-seeds the random number generator. Valid range is 1 to 1000000.
Range: -1 to 1 applies negates from and adds to the original surface.
-1 to 0 negates from the original surface.
0 to 1 adds to the original surface.
Whelk-0-0-3n dev snapshot      [ Uploaded: 30 March 2015 ]               

Improved Tropism generator so that it works in both Pitch and Roll directions.
There are now two Tropism counters: Tropism A (pitch) and Tropism B (roll).
Demo files have been re-written over:


Modified UI so that it makes more sense; e.g., spiral type radio buttons are
now loctated in the SPIRAL group. This leaves more space in the GENERATOR
group for later additions.
Whelk-0-0-3m dev snapshot      [ Uploaded: 28 March 2015 ]               

Bugfix: Apex IO streaming.
Whelk-0-0-3k dev snapshot      [ Uploaded: 28 March 2015 ]               

Apex is now saved to '.wlk' file.

Added new generator control 'Mobius Invert'. This applies a trochoidal twist
such that the coil doubles back on itself, rather like a Mobius strip. As the
value moves toward HALF_PI, it will create two apparent coils - an inner and
an outer - though both are formed from the same mesh. This resuls in two
apertures, each facing in opposite directions. The normals of the inner
aperature face inward, whilst the normals of the outer aperture face outward.

Added new generator control 'Rotate'. This rotates the start position for each
slice array; the result is that slice perturbations rotate around the coil
cirumference. This was implemented for custom profiles in Whelk-0-0-3h dev
snapshot, but it now works for both custom and non-custom profiles.
The previous rotate widget has been removed from the Custom Profile window.

See files:

Added new generator control 'Tropism'. This 'bends' the axis of the trochoidal
shift and is useful when generating horns.

See file:

Added some reset buttons to generator counters.
Whelk-0-0-3j dev snapshot      [ Uploaded: 22 March 2015 ]               

Fixed winding bug for custom profiles and non-sinistral coils. This became
apparent when rendering mesh2 export in POV-Ray: the interior and exterior
textures were swapped. The 'Show normals' and 'Show winding' menus in Whelk
confirm that the winding is now correct for non-sinistral profiles.

Enabled smooth shading as default.
Whelk-0-0-3i dev snapshot      [ Uploaded: ?? ?? ???? ]               

POV-Ray mesh2 export
Added code to swap the Z coordinate from OpenGL's Right handed system to
POV-Ray's Left handed system.
Whelk-0-0-3h dev snapshot      [ Uploaded: 13 March 2015 ]               

Custom Profile UI
Added horizontal line to show current build axis; this is drawn in the same
colour as the 3D axis in the OpenGL view, i.e.,  X=Red, Y=Green, Z=Blue.

Added a counter to rotate anchor points. Note: changing the start position
of a custom profile also changes the start position in the wave supression
array; therefore, indicators have been added to the Wave Supression Window.
(See note* below).

Loading a '.cpr' profile from the menu now updates the model without having to
click the 'Apply' button.

Wave Supressor UI
Made sure canvas redraws with the active layer when the mesh resolution is
changed on the Generator UI.

*Added two vertical lines to show the medial symmetry of form if user has
elected to rotate anchor points. The CYAN line indicates the outer medial
point, whilst the BLACK line indicates the inner medial point.
Whelk-0-0-3g dev snapshot      [ Uploaded: 12 March 2015 ]

Added widgets so user can move the Apex whan applying trochoidal shifts.
Cosmetic re-design of UI to make space for the above.
Whelk-0-0-3f dev snapshot      [ Uploaded: 11 March 2015 ]

Fixed orientation bug introduced in Whelk-0-0-3e by non-sinistral windings.
Whelk-0-0-3e dev snapshot      [ Uploaded: 11 March 2015 ]

Added Wave Supressor UI.
The Wave Supressor UI can limit generated waveforms to designated sectors
of the profile. Each sector of the profile is represented by a bezier curve.
Drag on the anchor/control points to adjust supressor amplitude.
(Anchor points can only move up and down; the first and last anchor points
move together). The Wave Supressor operates on individual layers for both
Stacks and Slices.

Note: if the supressor has no effect then either the generator amplitude is
zero, or the supressor strength is zero.

The Wave Supressor required an update to the Whelk file version which is now
WhelkV1.1. This means that '.wlk' export files from previous dev snapshots
will not load with Whelk-0-0-3e; but previous custom profiles will load.

The minimum number of slices has been changed to 16.

Added 'Sinistral' check box. When checked, spiral forms in an anti-clockwise
direction; i.e., with the apex at the top, the bottom aperture is on the left.
E.g., most land snails are sinistral but Japanese Wonder Shell is not.
(See the demo file in the Output/Generators directory for example).

Removed Edit Menu. The 'Custom Profile window is now acessed via a 'Set...'
button which is only active when 'Use Custom Profile' is ON.

Changed idle callback in OpenGL view so that view only updates when trackball
is changed. This speeds up the UI tenfold when tumbling has stopped - 
Left mouse button: drag to tumble; click to stop tumble.

TO DO: Aperture thickness and mesh deformation folds; aperture profiles, etc.
Whelk-0-0-3d dev snapshot      [ Uploaded: 04 March 2015 ]

Added custom texture and transform declarations for the mesh2 INC file.
Consult the following file for sample use:

Whelk-0-0-3c dev snapshot      [ Uploaded: 04 March 2015 ]

Added mesh2 export for POV-Ray 3.7.

Test render output files:

Implemented streaming for the generator and all its widgets. The model state
can now be saved and loaded from a binary file. The extensions for Whelk
binary files are:

'.wlk' = Generator files         Saved in ./Output/Generators directory
'.cpr' = Custom profile files    Saved in ./Output/CustomProfiles directory

About Generator files
Generator files include custom profile data if 'Use Custom Profile'is ON.
In this case, the Mode menu state in the Custom Profile window is also
written to the 'wlk' file. There is no need to save a separate 'cpr' file.

About Custom Profile files
Custom profiles can also be saved individually as with Whelk-0-0-3a. In this
case, the Mode menu state is not saved with the 'cpr' file. This is so you
can apply different profiles to the same generator.

Fixed UI bug where the generator widgets were resized with the main window.
Whelk-0-0-3a dev snapshot      [26 February 2015 ]

Custom profiles can now be saved and opened. To save a custom profile use
the menu 'File->Save profile' in the Custom Profile Window. Profiles are
saved in the Data/CustomProfiles directory and have a '.cpr' file extension.
When you open a custom profile, the profile view updates and the model is
rebuilt - but please ensure the toggle button 'Use Custom Profile' is ON or
you will not see the changes.

Remember that Whelk 'cpr' files only save profile data; they do not save
generator information such as trochoidal shift, or the cotangent alpha value.
This is so you can apply different profiles to the same generator.
Various test profiles are the Data/CustomProfiles directory ready to load.
For example, load the profile called 'ShellTest_1.cpr', then try using these
Manual values for the generator:

Stacks: 840
Slices: 80
Alpha: 80.5553877  or Cot alpha: 0.1663490
Scaling constant 0.0050
Stack size divisor: 26.0
Trochoidal shift: 1.1
Profile radius factor: 0.630

Remember that the smaller the cotangent of alpha, the tighter the winding, and
the more stacks required to build up the form.

Increase the number of slices to increase the resolution of the swept profile.
Whelk-0-0-2z dev snapshot      [ Uploaded: 17 February 2015 ]

Amplitudes can now have negative values. For example a positive value in one
layer can be modified by a negative value in another. This allows for subtle
modifications in waveform deformations.

Cleaned up the source code.
Added more instructions to the Makevariables file.
Whelk-0-0-2x dev snapshot      [ Uploaded: 09 October 2014 ]

New custom profile menu option 'Perturb along profile normals'. When checked
perturbations are extruded along custom profile normals rather than along the
radii vectors. The effect is most noticeable with concave profiles and/or at
anchor points which form the 'seams' of an extrued profile.
Custom profile menu option 'Perturb along profile normals' is only active for
literal profiles and turned off for magnitude profiles.
Custom Profile window: added option to draw the bezier curve normals which
show the extrusion direction for perturbations.
Whelk-0-0-2r dev snapshot      [ Uploaded: 06 October 2014]

Stopped recursive callbacks from altering the control point state when using
custom profile morphers.
Whelk-0-0-2q dev snapshot      [ Uploaded: 06 October 2014]

Activated the anchor point spinner control in the Custom Profile window.
Custom profiles can have either 8 or 4 anchor points:
8 anchor points: the steps value for slices counter control is reset to 8:16,
and the minimum number of slices is 8.
4 anchor points: the steps value for slices counter control is reset to 4:8,
and the minimum number of slices is 4.
Added morpher sliders to the Profile Editor window. Morphers target all
control points simultaneously. This allows symmetrical modification of the
profile. Use the sliders to change control point angles and lengths. The
morph actions are Mirror, Twist, CP1 and CP2. These function just like they do
in my 2D Java application  Griselda . If  Use Custom Profile  is ON,
(yellow light), the geometry is rebuilt when you click Apply.
Whelk-0-0-2p dev snapshot      [ Uploaded: 01 October 2014]

Fixed turtle orientation error when building custom profiles about the Y axis.
This was made apparent when Distributing 'One phase peak to peak' in slices
with Sin(5x)/5 - but only when the amplitude was large enough to show the
error. The phase 'peak' now correctly aligns with the positive build axis, (as
for X and Z). This fix makes orientation consistent for both custom and sine
wave profiles and preserves perturbation geometry in all axes of rotation.
Custom profile window:
Top anchor point    = Outer perimeter of form
Right anchor point  = Positive build axis
Left anchor point   = Negative build axis
Bottom anchor point = Inner perimeter of form
For example, to make a sinistral (left-handed) shell, build around Y axis and
use a negative trochoidal shift. Applied waveform(s) now share the same
intrinsic orientation and profile when the build axis is changed.
Whelk-0-0-2m dev snapshot      [ Uploaded: 29 September 2014]

Added check box option: 'Sample by curve length' to the Mode menu of Custom
Profile window. This option distributes vertices evenly on the bezier curves
(the custom profile is constructed from four bezier curves).
Whelk-0-0-2k dev snapshot      [ Uploaded: 28 September 2014]

Enabled layers; inevitably, this makes the build process slightly slower.
Corrected custom profile orientation bug when building around the Y-axis
(top-bottom and left-right were swapped).
Added about box.
Whelk-0-0-2j dev snapshot      [ Uploaded: 26 September 2014]

Fixed UI bug where the waveform choice menu did not display the start up
default waveform of ONE_PHASE_PEAK_TO_PEAK.
Whelk-0-0-2i dev snapshot      [ Uploaded: 26 September 2014]

Added custom profile option with a bezier profile editor window. Perturbations
may still be applied to custom profiles, so it is possible to distribute along
slices with f(x) and perturb the custom profile radii. Custom profiles may be
'Literal' representations of the curve or constructed by 'Magnitude' of radii.
Added more sine wave options.
Added Phase shift check button. Phase shift is a summation of values for
sin(mx)/m for m=1 to m=m, in steps of m+2. This only works when m is ODD.
Eg sin(3x)/3, sin(5x/5) etc. Higher m values result in more square wave forms.
See the enclosed spreadsheets in the output folder for examples.
Remember to increase the amplitude if a waveform doesn't appear to change the
geometry. Alternatively, if you are using a manual interval for f(x), change
the interval to another point on the waveform.
Layers remain deactivated in this version.
NOTE: 0-0-2i corrects a Phase shift loop bug in 0-0-2g, where m was
incremented by 1 instead of 2. Version 0-0-2i deactivates and clears the
Phase shift check button when m is 1 or even.
Whelk-0-0-2e dev snapshot       [ Uploaded: 20 September 2014]

Redesigned drawing algorithm. Slice amplitude now scales in or out from centre
of slice. Note that Slice distribution behaviour is now slightly different and
requires larger amplitudes. A 'profile editor' is in development...
Added dashes and gaps for Repeat action.
Redesigned UI with more meaningful controls.
Added Chromatic scale spiral (embodies equiangular spiral of music where alpha
is 77 degrees and fifty minutes).
Added Golden spiral that embodies both the golden section and the golden
numbers of the Fibonacci series. (The Divine Proportion - A Study in
Mathematical Beauty, H.E. Huntley).
Wrote preliminary code to support layers, (disabled in this version).
Added option to change the build axis - i.e. Build along Z, Y, or X.
Whelk-0-0-1c dev snapshot       [ Uploaded: 13 September 2014]

Updated Whelk_Readme.htm with better explanations and more examples. Improved
Stack and Slice sine wave code so that perturbations are truly zero at start
of growth and increase in direct proportion. The perturbation code now models
the same fundamental property of logarithmic spiral growth, i.e. the size
increases but the shape remains unaltered.
Added View menu options: 'Flip model normals', 'Draw model normals' and 'Draw
winding normals'.
Whelk-0-0-1b dev snapshot       [ Uploaded: 12 September 2014]

Added 'Slice ripple' controls
Fixed UI init bug for Ripple interval spinners
(negative intervals are not allowed).
Whelk-0-0-1 dev snapshot        [ Uploaded: 12 September 2014]

First upload