home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
graphics
/
stereo_1
/
!Stereo
/
!readme
< prev
next >
Wrap
Text File
|
1994-04-06
|
7KB
|
189 lines
Readme file for StGrams
Copyright ever and forever myself: Florent de Dinechin
THIS PROGRAM IS NOT FREEWARE, IT IS NOT SHAREWARE, IT IS
PLEASE-PUT-ALL-YOUR-BEAUTIFUL-STEREOGRAMS-ON-ALT.3D-WARE
As such, it may not be included or partially included in any commercial
product.
That's it.
This program (not an application yet) produces pattern-mapped
stereograms, much easier to view than the Random Dots Stereograms.
If you don't know what is a stereogram, you should! Have a glance at
alt.3d first, and ask them there. It is just great, believe me.
Now, for those who are already enlighted...
Syntax: stgram <workdir>
<workdir> must contain:
<workdir>.zb A 256-colour sprite considered as a Z-buffer
to be rendered as a stereogram. This Z-buffer may be produced
using Paint (The palette is sorted by colour number!)
or by any other means. The program Sources.c.zb_create
is an example of a C program computing a (?mathematical)
function. The BASIC program z=f(x,y) also produces such
zb-sprites. More info about how to use the latter is given
below in the tutorial section.
<workdir>.pat A 256-colour sprite, used as a pattern to be
mapped on the stereogram. Width must be a multiple of 4.
Don't ask me why.
<workdir>.cst A text file containing the picture constants
(size of the picture, distance of the eyes, etc) , as
documented below in the technical section. Don't panic,
There is a sample .cst enclosed.
'stgram <workdir>' then outputs
<workdir>.ste, a sprite of a stereogram.
<workdir>.log, a few comments about the execution.
If <workdir>.pat has a palette, then <workdir>.ste has the same...
Below is a tutorial to help you use all this.
Below the tutorial is a technical reference to let you use all its
possibilities.
Below the latter is an apology explaining why it is so
anti-user-friendly, and what hope you may have in this respect.
_______________________________________________________________
| |
| T U T O R I A L E X A M P L E |
|_______________________________________________________________|
look at the Example directory.
Read !CreateZB and run it, then look at the Example.zb sprite it has created.
Read and run !Example, then look at the Example.ste stereogram
(to be viewed in a 640-width mode). The execution might need a minute or 2.
(also works in a taskwindow)
Change the Example.pat sprite as you want, and rerun !example.
Modify the .cst file to adapt the sizes to your favourite (256-colour) mode.
(do not modify the three other constants yet)
Rerun !example.
Read the .log file : it tells you which size your Z-buffer (i.e .zb file)
should be to get a full size picture.
Create your own .zb sprite with !Paint: color 0 corresponds to
the furthest points (the background), color 255 to the nearest points.
rerun !example and repeat...
To create your own functions: the BASIC prog z=f(x,y) inputs width
and height of the Z-buffer (as read in the .log file), a filename, and
outputs the Z-buffer corresponding to the function FNz defined on
the very beginning of the prog. This function takes two arguments, x and y
(x between -width/2 and width/2, y between -height/2 and height/2) and must
return a number between 0 and 255. Just edit this program and play around.
The best is to create a background with a mathematical function, and then
to hand-edit it with !paint to add what you like.
_______________________________________________________________
| |
| T E C H N I C A L P A R T |
|_______________________________________________________________|
There is actually little to know.
The .cst file contains
W : integer : the width of the stereogram (pixels)
H : integer : its height (in pixels)
D : float : the distance of the eye to the plane z=0 of the
3d object
d : float : the z coord of the projection screen
e : float : the half of the distance between your eyes.
(Don't panic, it neednot be accurate)
The three last numbers are expressed in pixels. That is, for a particular
monitor, to get 'e' you need to smash your face on your screen and
count the number of pixels between your former eyes (in the mode you want
the stereogram to be output).
Perfect typical values for mode 28 on an A4 are:
640
480
2000.0
800.0
100.0
You need to have 256>d>D.
Those values are not really significant. The only point is that the
horizontal "period" of the picture must be smaller than the distance
between your eyes. Think of it if you want to print your stereogram, though.
The process to produce a stereogram is a bit like computing a perspective
( but in one direction only). Therefore, the Z-buffer needs to be bigger
than the picture. If you want another size of the picture, the .log file
will tell you which size the Z-buffer should be.
Enjoy!
_______________________________________________________________
| |
| A P O L O G I E S |
|_______________________________________________________________|
I DON'T HAVE THE PRMS!
That's why.
And besides, I am all alone with my Arc in a crual PC world, so I
try to write things my poor friends are able to quickly port to their
crappy heating boxes.
But I really feel bad about it, you know. My program
looks like a uniqs (ta mère) port, whereas I did it all on my Arc.
Shameful.
For the hackers:
There is a working version allowing the picture to be displayed
while computed. Edit Sources.C.Main, change: #define VERBOSE 0
and #define SCREEN 1, and re-make and move the runimage (stgramcode)
in the Bin directory. (need gcc, tla and gnu make, all from hensa)
The problem is that it only supports mode 28. Without the PRMs, it is
too much of a pain to adapt to the screenmode. (I don't know how to read
which mode I am in, I don't
even know how to change modes in C!)
But if you can display mode 28, do it!
Things to do:
A version that fits in 100k (easy, the prog scans a line after the other.
I should have done that from the beginning)
A lot of hassle to the people who write 3d editors, so that they
gently produce Z-buffers as I need. (Easy, isn't it?)
An assembler version allowing real-time computation and a port of Zarch
where you actually can see how far are the bloody monsters to blast them
more efficiently
(on my A92000 next decade.)
A front-end (God knows when).
Florent de Dinechin, march 1994
Feel free to ask questions or send flowers to
fdupont@irisa.fr
Florent de Dinechin
Résidence des deux-rives
4, pré des bonnets-rouges
F-35000 Rennes
Royaume de France