HowTo:BackgroundImg
From S2PLOT
(Difference between revisions)
| Revision as of 05:25, 19 February 2008 Dbarnes (Talk | contribs) ← Previous diff |
Revision as of 05:25, 19 February 2008 Dbarnes (Talk | contribs) Next diff → |
||
| Line 31: | Line 31: | ||
| | 0.9 | | 0.9 | ||
| |- | |- | ||
| - | } | + | |} |
| The coordinates are given in the range [0,1], and define the sub-window of the S2PLOT window which is used for the S2PLOT 3-d graphics. The background image covers the entire window, even if it must be stretched to do so. | The coordinates are given in the range [0,1], and define the sub-window of the S2PLOT window which is used for the S2PLOT 3-d graphics. The background image covers the entire window, even if it must be stretched to do so. | ||
Revision as of 05:25, 19 February 2008
It is simple to run an existing S2PLOT program over the top of a background image. This behaviour is completely controlled by runtime environment variables, so no modification to program code is required.
You will need a background image in TGA format. You can use the ImageMagick "convert" utility to write a TGA file from almost any bitmap format file.
Prior to running your S2PLOT program, simply set the following environment variables:
| variable | meaning | sample value |
|---|---|---|
| S2PLOT_BGIMG | filename of background TGA image | "universe.tga" |
| S2PLOT_X1 | X coord of bottom left corner for S2PLOT graphics | 0.2 |
| S2PLOT_Y1 | Y coord of bottom left corner for S2PLOT graphics | 0.1 |
| S2PLOT_X2 | X coord of top right corner for S2PLOT graphics | 0.7 |
| S2PLOT_Y2 | Y coord of top right corner for S2PLOT graphics | 0.9 |
The coordinates are given in the range [0,1], and define the sub-window of the S2PLOT window which is used for the S2PLOT 3-d graphics. The background image covers the entire window, even if it must be stretched to do so.
