Function:ss2tc
From S2PLOT
Revision as of 06:26, 6 March 2008; view current revision
←Older revision | Newer revision→
←Older revision | Newer revision→
ss2tc
Enable/disable (1,0) camera translation.
Prototype
void ss2tc(int enabledisable);
Description
Enable (enabledisable = 1) or disable (enabledisable = 0) camera translation. This is particularly useful in fisheye display modes.
See Also
ss2sc | Set the camera position, up vector and view direction. |
ss2qc | Query the camera position, up vector and view direction. |
ss2sas | Start/Stop the camera rotation. |
Code Example
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
int i, N = 20; /* Loop variables */
float x, y, z; /* Random data */
int trans = 0; /* Translation disabled */
srand48((long)time(NULL)); /* Seed random numbers */
s2opend("/?",argc, argv); /* Open the display */
s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0); /* Draw coordinate box */
s2slw(3); /* Set line width */
for (i=0;i<N;i++) {
x = drand48()*2.0 - 1.0; /* Random (x,y,z) */
y = drand48()*2.0 - 1.0;
z = drand48()*2.0 - 1.0;
s2sci(15*drand48() + 1); /* Random colour */
s2pt1(x,y,z,1); /* Plot the point */
}
ss2tc(trans); /* Set translation state */
s2sch(0.8); /* Set text height */
s2textxy(-1,0,0,"You can't translate camera with +/-!");
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.