コード例 #1
0
ファイル: plane.cpp プロジェクト: ChristianWeeks/817
plane::plane(const GLfloat values[]){
	for(int i = 0; i < 4; i++){
		points[i].x = values[i*3];
		points[i].y = values[i*3 + 1];
		points[i].z = values[i*3 + 2];
	}
	calcNormal();
    calcCentroid();
}
コード例 #2
0
ファイル: plane.cpp プロジェクト: ChristianWeeks/817
//The primary method of instantiating a plane will be to give it an array of values
plane::plane(const point pointsb[]){
	for(int i = 0; i < 4; i++){
		points[i].x = pointsb[i].x;
		points[i].y = pointsb[i].y;
		points[i].z = pointsb[i].z;
	}
	calcNormal();
    calcCentroid();
}
コード例 #3
0
ファイル: plane.cpp プロジェクト: ChristianWeeks/817
const plane& plane::operator=(const GLfloat values[]){
	for(int i = 0; i < 4; i++){
		points[i].x = values[i*3];
		points[i].y = values[i*3 + 1];
		points[i].z = values[i*3 + 2];
	}
	calcNormal();
    calcCentroid();
    return *this;
}
コード例 #4
0
ファイル: ntFace3.cpp プロジェクト: jwarton/N-Technium-Libs
void ntFace3::init(){
	//initialize vertex
	vert0 = new ntVertex (v0,col);
	vert1 = new ntVertex (v1,col);
	vert2 = new ntVertex (v2,col);

	verts.push_back(vert0);
	verts.push_back(vert1);
	verts.push_back(vert2);
	//initialize edges
	edges.push_back(ntEdge(v0,v1,col));
	edges.push_back(ntEdge(v1,v2,col));
	edges.push_back(ntEdge(v2,v0,col));
	//initialize centroid and normal
	calcCentroid();
	calcNorm();
}
コード例 #5
0
ファイル: ntFace3.cpp プロジェクト: jwarton/N-Technium-Libs
ntFace3::ntFace3(ntVec3* v0,ntVec3* v1,ntVec3* v2,ntVertex* vert0,ntVertex* vert1,ntVertex* vert2):
v0(v0),v1(v1),v2(v2),vert0(vert0),vert1(vert1),vert2(vert2){

	this->vecs[0] = v0;
	this->vecs[1] = v1;
	this->vecs[2] = v2;

	verts.push_back(this->vert0);
	verts.push_back(this->vert1);
	verts.push_back(this->vert2);

	edges.push_back(ntEdge(v0,v1,vert0,vert1));
	edges.push_back(ntEdge(v1,v2,vert1,vert2));
	edges.push_back(ntEdge(v2,v0,vert2,vert0));

	//initialize centroid and normal
	calcCentroid();
	calcNorm();
}
コード例 #6
0
ファイル: ntTriCell.cpp プロジェクト: jwarton/N-Technium-Libs
void ntTriCell::init(){
	// INITIALIZE VECS 
	// 0, 1, 2
	vecs_SD.push_back(v0);
	vecs_SD.push_back(v1);
	vecs_SD.push_back(v2);

	// INITIALIZE VERTEX
	vert0 = new ntVertex (v0,col);
	vert1 = new ntVertex (v1,col);
	vert2 = new ntVertex (v2,col);
	verts.push_back(vert0);
	verts.push_back(vert1);
	verts.push_back(vert2);

	// INITIALIZE EDGES
	edges.push_back(ntEdge(v0,v1,col));
	edges.push_back(ntEdge(v1,v2,col));
	edges.push_back(ntEdge(v2,v0,col));

	// DUPLICATE VECS 
	// 3, 4, 5
	ntVec3* v00 = new ntVec3(v0->x, v0->y, v0->z);
	ntVec3* v01 = new ntVec3(v1->x, v1->y, v1->z);
	ntVec3* v02 = new ntVec3(v2->x, v2->y, v2->z);
	vecs_SD.push_back(v00);
	vecs_SD.push_back(v01);
	vecs_SD.push_back(v02);
	edges.push_back(ntEdge(v00, v01, col));
	edges.push_back(ntEdge(v01, v02, col));
	edges.push_back(ntEdge(v02, v00, col));

	// INITIALIZE SUB DIVISION POINTS
	calcCentroid();
	calcNorm();
	calc_EdgeMid();
	calc_innerTri();
	calc_starPts();
	calc_Faces();
	setPolylines();
}