- a brief tutorial

NOTE! THIS IS NOT FINISHED YET.

Contents

1. Introduction to stereograms
2. Getting started with Krosseye
3. The different renderers
4. Using layers
5. Using shapescripts
6. Freehand depthmap drawing
7. Some notes and ideas

(TODO: Add links down to each paragraph, fix spelling errors and add more info)

1. Introduction to stereograms

You havnt heard of stereograms? Where were you ten years ago when they were hotter than pr0n?

Stereograms are 3D pictures, but here we only deal with pictures that encode the 'depth' in the pattern. But lets start from the beginning. Here's two dots:

Now put your finger between the two dots, and slightly below them. Then slowly move your finger away from the screen - while still looking at your fingertip. When the finger is at a certain distance from the screen you'll hopefully notice that the two dots apprears to merge. (It isn't easy but dont give up!) You're now looking at the right dot with your left eye and at the left dor with your right eye. Actually you should see three dots, but only the middle one will seem 'real' and the other two are transparant. They are the images that you right eye sees of the right dot and vice versa. But lets add some more dots:

Using the same technique as before, you should now be able to se an entire row of dots. And all of them should seem real - except for the ones at the far left and right. All of the dots should appear to be on the same depth, but by varying the distance between the dots, we can do more complicated stereograms.

You should see that some of the dots appear to be at differen depth. The furter apart two dots are, the further away from the screen do they appear to be.
There is a second method to see the dots; instead of looking at a point above the image and thus crossing your eyes, you can also look beyond the image. I call this the wide-eyed method, but thats more tricky to do on a computer screen.

Some people just cannot see the hiddeen shape. But dont feel bad if you're one of them. If you try really hard you can perhaps learn to see them. And if you don't... Well, people can live a full and meaningful life without stereograms being a part of it!

;-)

2. Getting started with Krosseye

Here's a brief description to help you get started. First we must define what 3D shape we want to use. This can be done in several ways:

1. By loading a depthmap picture (easiest)
2. By painting it with the mouse (this is not recomended)
3. Using the shapescript function (more on this later)

For now we'll just load a depthmap picture from a file. There is a few depthmaps included in the distribution, so load the one called depthmap_propeller.png.

This is done from the "file" menu. The depthmap are automatically scaled to fit the stereogram (default is 640x480, but this can be changed by selecing 'New' in the file menu). Press the 'Depthmap'-tab to inspect the loaded depthmap.

Now return to the "Stereogram"-tab and press the "Render!"-button. After a few seconds, the rendering should be complete.
Presto! Wasnt that fun?

3. Using the different rendering methods

Krosseye v0.3 can use seven methods to render stereograms. The combobox in the upper left corner decide what method that is used:

Random colors
The simplest methods is the Random colors-method. It is only supplied for beginners. As the name suggest, it will render the stereogram using dots of random color.
If you use this method, you'll only have to load a depthmap and press "Render". (As above)
Now lets talk about how rendering is done, but first lets try a small excersize! Follow these steps:

1. Start with an empty stereogram (select "New" in the file menu).
2. Place the mouse somewhere on the stereogram and press the left button once.

A row of scattered pixels appear, and one of the pixels are where you pointed the mouse! Lets call that pixel the 'startpixel'. When rendering a line, a start pixel is first selected by the program, and this pixel is drawn in a random color. Then 'secondary' pixels are drawn to the right and to the left - using the same color - until a row has been completed.
Then a new 'startpixel' will be placed next to the previous, and so on until the line has been completly filled

The Dotsize slider affects the 'coarseness' of the stereogram.

Colormapped
This rendering method is very simmilar to the 'Random colors'-method, but you must indicate what colors that should be used by supplying a colormap. This is useful if you want to generate stereogram that only uses shades of blue (for example), of a vertical gradient.
Any picture will do as a colormap, landscape images, photos, etc...

You can also try to do horizontal gradients: Load a colormap, for example 'colormap_germanysmooth.png' and then set both 'Gradient' and 'Scatter' to about 1/3 from the left edge and press start.

If Scatter is set to its minimum value, the 'startpixels' are drawn in the color that the colormap has for that pixel. By increasing Scatter it add a random value to the horizontal position of the pixel before fetching the color from the colormap. When Scatter is set to max, it will use the color of any pixel on the colormap.

Previously we've said that all 'secondary pixels' are drawn in the same color as the 'startpixel', but thats only true if Gradient is set to zero. If it is nonzero, the 'secondary pixels' will have a slitly different color.

Patternmapped
Instead of using just colored dots, you can use a pattern (or if you prefer wallpaper) to render the stereogram. The following stereogram were created using 'depthmap_propeller' and 'pattern_10c':

In patternmapped renderings, the so called nullzones (marked with red arrows) are a problem. We both want the pattern to look nice and we want the shape accurate. But if there are sharp edges there will be parts of the pattern that either disappears or we have these gaps (nullzones). You can see the nullzones better if you enable 'visual debug' (actually a developement tool, but you may find it useful too) in the menu before rendering.
How can we minimize the nullzones then? Well what to do with nullzones are controlled with the combobox to the lower left. The following options are available:

Leave blank. This will just ignore the nullzones. It is seldom a good thing.
Bridge: As in the picture above. The pattern will be stretched over the nullzone.
Overlap aligned: The nullzone will be rerendered with a copy of the patternmapped that is aligned to the pattern on the edge of the nullzone. This can cause ambigous 3D-shapes, but often works remarkebly well. Short distances will still be bridged all the same because ovelapping only looks good for larger nullzones.
Overlap mirrored: Same as above but the pattern will be mirrored in the nullzone. This doesnt cause any ambigous shapes, but doesnt look as nice.
Overlap far: Doesnt align the overlap at all. Sometimes looks good.

But the most important method to minimize the nullzones is to adjust the Horizontal position that the 'startpixels' is placed in. Nullzones appears when going from lower to higher areas (for krosseyed vieweing) and from higher to lower areas if the 'invert depth' checkbox is marked. You can also use the mouse on the stereogram to indicate where you want the 'startpixels'. Just click with the left mousebutton on the stereogram (or push and move mouse) and you'll re-render tha area.

Hint: You can reduce the sharp horizontal edges on the depthmap by using the 'Soften' slider. This is useful for 'Bridging' - but is counterproductive if 'overlapping' is selected.

The slider called Vertical affects the vertical offset of the pattern.

Patterndotted
Patterndotted rendering should only be attempted with small patterns - such as 'pattern_heart'. It will draw a copy of the pattern instead of the dots. You can have the patterns rotated by checking the box marked Rotate dots.

This is probably a good spot to talk about the black is transp checkbox. If checked, the pixels that are absolutely black will not be drawn. (Yet pixels that are almost black will be drawn and jpeg enconders tend to sometimes convert som black pixels to 'almost black' pixels, so use png:s instead)

Colordotted
Colordotted rendering as a variant of the colormapped rendering. The only difference is that the dots are round (adjust size with the Dotsize slider) and that the rows are not completly filled with dots.

Colorpunched
The Colorpunched rendered is in its turn a variant of the 'Colordotted' renderer. The difference between Colorpunched and Collordotted (with Max Gradient and Min Scattering) is hardly visible.
Colorpunched will 'punch out little holes' from the colormap and paste them in as dots in the stereogram. Its visible for big Dotsize:s...

Goggle
Well, If you have a pair of those old red/green glasses:
put them on, set min depth to '1', uncheck invert depth and render the stereogram.
Not really that useful, except for people who just cant see stereograms otherwise.

4. Using layers

There are two layers called 'current' and 'locked'. During rendering, data is drawn upon the 'current' layer. The two layers are combined into the stereogram using the selected layer function. When selecting 'Lock stereogram as layer', the stereogram (ie the combination of the layers) are stored into the 'lockaed' layer and the other is cleared. If you experiment a little, you'll soon undertand the layer functions. Just keep in mind, when rendering a stereogram - or loading one from a file - it is always done to the 'current' layer. Saving the stereogram saves the combination of the layers though.

5. Using shapescripts

Shapescripts are a crude way to specify the 3D shapes. There are a few examples provided in the package. Just keep in mind that coordinates X=0, Y=0 are the center of the screen. Depths may range from 0 (lowest) to 255 (highest). Here is a command reference:

CLEAR
This command doesnt take any arguments. It will start a new depthmap from scratch.

DOT
Draws a flat dot on the screen.
Attributes:
CX: X position of dot (required)
CY: Y position of dot (required)
CZ: Depth of the dot (required)

RAISE
Raise or lower a part of the depthmap.
Attributes:
CX: X position of center of area to lift (required)
CY: Y position of center of area to lift (required)
DIST: How far to raise the area as an abolute distance (default 0)
POW: How far to raise the area as a relative distance in percent (default 0)
SIZE: Radius if area to lift (default 1 pixel)

RLINE
Line of round dots.
Attributes:
AX,AY,AZ: First end point and its depth (required)
BX,BY,BZ: Second end point and its depth (required)
SIZE: Radius of dots in line (default 1 )

LINE
Normal line.
Attributes:
AX,AY,AZ: First end point and its depth (required)
BX,BY,BZ: Second end point and its depth (required)
SIZE: Width of lines (default 1)
POW: Roundness of line in percent (default 0)

SOFTEN
Soften area of depthmap
Attributes:
CX,CY: Center position for area to soften (required)
SIZE: Radius of area (default 10)
POW: How many iterations (default 20)

TRIANGLE
Flat triangle.
Attributes:
AX,AY,AZ: First point and its depth (required)
BX,BY,BZ: Second point and its depth (required)
CX,CY,CZ: Third point and its depth (required)

CONE
Cone pointing towards screen (pretty useless).
Attributes:
CX,CY,CZ: Center of base circle (required)
SIZE: Radius of base circle (required)
POW: Heigth of cone (default: 100)

SPHERE
Sphere.
Attributes:
CX,CY,CZ: Center of sphere (required)
SIZEX: Size of sphere (required)
SIZEY: Second size - for elipsoids.
ARG: Rotation for elipsoid in degrees (default 0).
POW: Heigth (indentation) in percent (default 100).

DISC
Draws a disc (angled or not).
Attributes:
CX,CY,CZ: Center of disc (required)
RAD: Radius of disc (required)
ARG1: Angle of gradient in degrees (default 0)
ARG2: Gradient strength angle in degrees(default 0)

COPY (or TILT)
Copies and tilt area of depthmap.
Attributes:
SX,SY: Center of source area (required)
DX,DY: Center of destination area (set to source if omitted)
SIZEX: Horizontal size of area to copy (required)
SIZEY: Vertical size of area to copy (=SIZEX if omitted)
ARGX,ARGY,ARGZ: Tilt angle in degrees (use one at a time)

LOAD
Load depthmap from file and paste into this.
This is probably the most useful drawing primitive
FIRST ARGUMENT MUST BE NAME OF FILE:
LOAD depthmap_jultomten.png
Attributes:
CX,CY: Destination position in depthmap (default: all zero)
CZ: Offset for loaded depthmap (default zero)
SIZEX,SIZEY: Scale of loaded depthmap (default: scale to fit current stereogram)
ARG: Rotate depthmap (default zero degrees)

In addition, the drawing methods can be configured by setting some global parameters with the SET command:

SET
MODE: Drawmode (Hint; LOAD and COPY are also affected by this)
0=NORMAL
1=ONLY DRAW PIXEL IF HIGHER THAN PRESENT VALUE
2=ONLY DRAW PIXEL IF LOWER THAN PRESENT VALUE
3=DISCARD OLD PIXEL IF LOWER, KEEP OLD IF HIGHER (useless?)

SCALE: Tries to scale all other commands. Not all commands are quite scalable...

OFFSETX, OFFSETY: Offset added to all X and Y positions

6. Freehand dephmap drawing

The mouse is used on the stereogram page to paint the rendering, but on the depthmap page it can be used to draw the shape. Only a few drawingtools are available so far, though. If you experiment a little, you'll soon get the hang of it. One thing is probably not too obvious though:
If you want the 'Bridge (R)' to lower areas too, set power to max...

7. Notes and ideas

Think of Krosseye as a canvas, not a magic box that creates 3D images. You're supposted to be the artist here... I've just supplied a few depthmaps and patterns to get you started.
Try to experiment a little. For example: Why not create hybrid-stereograms? Try this:
1. Load a depthmap and colormap and generate a normal ordinary colormapped stereogram.
2. Lock the stereogram as a layer
3. Increase both the mindepth and maxdepth (decrese if invert depth is checked).
4. Load a pattern such as 'pattern_heart'.
5. Press the left button about half in inch from the top of the stereogram (centerred horizontally).
6. Draw a wave line with the mouse all the way down to the bottom.
7. If you're not satisfied with the results, select 'Clear current layer' and redo from srep 5.

You get the idea.... Or you can draw a patterndotted on top of a patternmapped etc. Go nuts!

A note on rendering quality: If you notice that the 3D-shape seems to be build up by small 'steps', then you should use antialiasing to higher quality.