
#include "view.h"
#include <stdio.h>

main()
{
	
	Tree *t;
	FaceList *facelist;
	View *view;
	Surface *surface;

	/*compute the scene, returned in BST tree t and list of faces*/
	Scene(&t,&facelist);

	initialiseDrawables();

	/*create a new drawing surface*/
	surface = newSurface(50,50,400,400);

	/*create a new 3d view tied to this surface*/
	view = newView(surface);

	/*set View Reference point etc*/
	setVRP(view,-34.0,84.0,68.0);
	setVPN(view,1.0,0.0,0.0);

	/*set front clipping plane and back clipping plane*/
	setClipView(view,0.0,1000.0);

	setCOP(view,0.0,0.0,-4.0);
	setVUV(view,0.0,0.0,1.0);

	/*this is the viewplane window*/
	setVPWindowView(view,-3.0,3.0,-3.0,3.0);

	/*click the camera*/
	setView(view);

	/*display the tree of data on the view*/
	displayTreeOnView(view,facelist,t);

	/*flush the output to X server*/
	flushDrawable();

	/*wait for a button click*/
	delayOnDrawable(GETDrawableOfSurface(surface));

	/*clear the display*/
	clearDrawable();
	flushDrawable();

	/*now view the scene slightly differently...*/
	setVRP(view,-15.0,84.0,68.0);
	setView(view);
	displayTreeOnView(view,facelist,t);
	flushDrawable();
	delayOnDrawable(GETDrawableOfSurface(surface));
	clearDrawable();
	flushDrawable();

	/*...and another one*/
	setVRP(view, 20.0, 84.0, 68.0);
	setView(view);
	displayTreeOnView(view,facelist,t);
	flushDrawable();
	delayOnDrawable(GETDrawableOfSurface(surface));
	clearDrawable();
	flushDrawable();
	


	/*continue with more views ...*/
}


