HowTo:S2Slides

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 05:55, 19 February 2008
Dbarnes (Talk | contribs)
(How to create an s2slides presentation)
← Previous diff
Revision as of 05:58, 19 February 2008
Dbarnes (Talk | contribs)
(How to create an s2slides presentation)
Next diff →
Line 32: Line 32:
</code></pre> </code></pre>
-In this example, the first three "slides" shown by s2slides are the images Slide1.tga, Slide2.tga and Slide3.tga. Following them, the executable "runme" is run from the subdirectory s2pg, because the line is prefixed with an exclamation mark "!" indicating executable not image. In this particular instance, runme is actually a C-shell script, which happens to look like this:+In this example, the first three "slides" shown by s2slides are the images Slide1.tga, Slide2.tga and Slide3.tga. In this case, they were created in Powerpoint.
 + 
 +0Following the slides, the executable "runme" is run from the subdirectory s2pg, because the line is prefixed with an exclamation mark "!" indicating executable not image. In this particular instance, runme is actually a C-shell script, which happens to look like this:
<pre><code> <pre><code>

Revision as of 05:58, 19 February 2008

How to create an s2slides presentation

As of S2PLOT version 2.0, a utility called s2slides is included with the distribution. S2slides is a program which can be used to combine 2-d and 3-d images, and interactive programs into a relatively slick, self-contained presentation.

Before using s2slides, you should be familiar with running an existing S2PLOT program over a background image and "scripting" key presses for S2PLOT applications.

To use s2slides, all you need is one or more mono or stereo bitmap images or S2PLOT programs. These should be arranged into a simple text file that s2slides will execute. Here is an example (taken from Barnes' 2007 ADASS talk).

<code>
#introduction
./slides/Slide1.tga
./slides/Slide2.tga
./slides/Slide3.tga
!./s2pg ./runme

# astro examples
./slides/Slide5.tga
!./6dF ./runme
./slides/Slide7.tga
!./cluster ./runme
./slides/Slide9.tga
!./slicer ./runme
./slides/Slide11.tga
!./milkyway ./runme

# pdf promo
./slides/Slide12.tga
!./paper ./runme

# final slide
./slides/Slide13.tga
</code>

In this example, the first three "slides" shown by s2slides are the images Slide1.tga, Slide2.tga and Slide3.tga. In this case, they were created in Powerpoint.

0Following the slides, the executable "runme" is run from the subdirectory s2pg, because the line is prefixed with an exclamation mark "!" indicating executable not image. In this particular instance, runme is actually a C-shell script, which happens to look like this:

<code>
#!/bin/csh -f

# Main keys in simulation are:
#
# Shift-Q      quit
# Shift-ESC    quit
# SPACE        quit
#
# 5            toggle mono / anaglyph mode
# +/-          move in / out
# cursor keys  control viewpoint
# mouse drag   control viewpoint

set arch=`uname -p`
set exe="./s2pg.$arch"

set dev="/S2MONO"
if ("$1" == "-ss" || "$2" == "-ss") then
  set dev="/S2PASSV"
endif
if ("$1" == "-s" || "$2" == "-s") then
  set dev="/S2ACTIV"
endif

if ("$1" == "-f" || "$2" == "-f") then
  set dev="${dev}F"
endif
 
if (! -x $exe) then
  echo Cannot locate suitable binary to run.
  exit
endif
echo
echo Showing inter/act s2slide ...
echo "  *** Press Shift-Q, Shift-ESC or SPACE to exit ***"
echo

# stereo passive version
setenv S2PLOT_X1 0.5
setenv S2PLOT_X2 0.97
setenv S2PLOT_Y1 0.3
setenv S2PLOT_Y2 0.85
setenv S2PLOT_BGIMG ./bg.tga

echo $dev | $exe >& /dev/null
</code>

A few points about this runme file:

  • the arch variable shows how you might support running S2PLOT applications and therefore s2slides on multiple architectures.
  • the dev variable is set according to the device s2slides provides the runme script with. The S2PLOT device settings with which s2slides is run (see below) are simply passed on to executables. This runme script parses the device settings to express them as standard S2PLOT devices.
  • the S2PLOT_BGIMG and associated window location variables are used to embed this demo S2PLOT program in a particular part of a background image "bg.tga".

S2slides command-line arguments

One of the key useful features of s2slides is that it can be run in active, passive and interleaved stereo mode, and mono mode, just by changing its command-line arguments:

  • -ss - passive stereo mode
  • -si - interleave stereo mode
  • -s - active stereo mode
  • -f - fullscreen mode

These arguments are passed on on the command-line to any executables that s2slides runs as part of a presentation.

Personal tools