Programming and Graphics

(Kiana) #1

7.7 Three-dimensional interactive graph 241


Function plot3dtrans


The implementation of the functionplot3dtransis:

/*------------------------
plot3dtrans

transform a 3D plot produced
by drawplot3d
-------------------------*/

#include<fstream>
#include<iostream>
#include<iomanip>
#include<cmath>
#include "VOGLE/voglec++.h"
#include "drawplot3d.h"
#include "plot3dglobals.h"

using namespace std;

void plot3dtrans ()
{
char outfile[10];
float xaddr,yaddr;
int click;

//--- Initialize:

angx = angxinit;
angy = angyinit;
angz = angzinit;
zoom = zoominit;

/*---------------------------------
loop over keys and buttons
until a key or button is pressed
---------------------------------*/

again:

//--- Check the keyboard:

char kbd = char(checkkey());

//--- If ’r’ is pressed, reset:

if(kbd==’r’)
{
Free download pdf