All pastes #240527 Raw Edit

Untitled

public text v1 · immutable
·published 2006-11-05 20:06 UTC
rendered paste body
#include <iostream>
#include <vector>

struct v3d {
	   float x,y,z;
	   v3d() x(0), y(0), z(0) {}
	   v3d(ax, ay, az)  x(ax), y(ay), z(az) {}
	   v3d(v3d a) { x=a.x; y=a.y; z=a.z; }
}

struct Tri
{
	   v3d points[3];
	   Tri() {}
	   Tri(a,b,c) { points[0]=a; points[1]=b; points[2]=c; }
	   Tri(Tri a) { points[0]=a.points[0]; points[1]=a.points[1]; points[2]=a.points[2];  }
};

class Object
{
 	  v3d location;
	  std::vector<Tri> triangles;
}

ostream& operator<<(ostream &out, v3d &p)
{
	   out << "(";
	   out << p.x << ", ";
	   out << p.y << ", ";
	   out << p.z << ")";
	   return out; 
}

void main()
{
 	 vector<Object> objects;
}