HowTo:BackgroundImg
From S2PLOT
(Difference between revisions)
| Revision as of 04:43, 19 February 2008 Dbarnes (Talk | contribs) ← Previous diff |
Revision as of 05:25, 19 February 2008 Dbarnes (Talk | contribs) Next diff → |
||
| Line 5: | Line 5: | ||
| Prior to running your S2PLOT program, simply set the following environment variables: | Prior to running your S2PLOT program, simply set the following environment variables: | ||
| - | {| class="wikitable" | + | {| border="1" |
| |- | |- | ||
| ! variable | ! variable | ||
| Line 16: | Line 16: | ||
| |- | |- | ||
| | S2PLOT_X1 | | S2PLOT_X1 | ||
| - | | window-fractional X coordinate (in range 0,1) of bottom left corner for S2PLOT animation | + | | X coord of bottom left corner for S2PLOT graphics |
| | 0.2 | | 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. | ||
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 |
