Newer
Older
cg / include / glumodel.h
@glproj03 glproj03 on 9 Feb 2006 1 KB sdafsa:x
#ifndef _GLUMODEL_H
#define _GLUMODEL_H

#include "vec.h"
#include "thing.h"
#include "poly.h"
#include <string>

class GenericModel : public Thing {
	public:  
		bool visible;
		GLUquadricObj* pt;
		Vec* pos;
		Vec* rot;
		Material* mat;
		float scalefactor;

		GenericModel();
		GenericModel(Vec _pos, Material _mat);
		void init(Vec _pos, Material _mat);

		void setColor(Color* c);
		void setMaterial(Color _amb);
		void setMaterial(Color _amb, Color _spec);  

		void translate(Vec d);
		void rotate(Vec r);

		void show();
		void hide();

		void scale(float f);
};

class GluSphere : public GenericModel {
	public:
		float rad;
		GluSphere();
		GluSphere(Vec _pos, Material _mat, float _rad);
		void init(Vec _pos, Material _mat, float _rad);
		void draw();
};

class Fractal : public GenericModel {
	public:
		int iters;
		float len;
		Fractal();
		void init(Vec pos, Material m, int _iters, float _len);  
		void setIterations(int _iters);

};

class SierpinskiPyramid : public Fractal {
	private:
		GLuint list;
	public:
		SierpinskiPyramid(Vec p, int iters, float len);
		void construct(int n);
		void draw();
		void drawPyramid();
		void buildList();
		virtual ~SierpinskiPyramid();
};

class KochFractal : public Fractal {
	public:
		float multiplicity;
		float mult_angle;
		float mylen;
		KochFractal(Vec pos, int iters, float len);
		//TODO: move draw function to Fractal class, it's common for all 
		//inheriting fractals....
		void draw();
		void iter(float nbit);

		void setIterations(int _iters);
};

#endif