Added a function (Not done)
This commit is contained in:
@@ -250,16 +250,24 @@ void PartInstance::addQuad(Vector3 v1,Vector3 v2, Vector3 v3, Vector3 v4)
|
|||||||
addTriangle(v1, v3, v4);
|
addTriangle(v1, v3, v4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PartInstance::genSmoothNormals(int count = -1)
|
||||||
|
{
|
||||||
|
if(count < 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PartInstance::addSmoothTriangle(Vector3 v1, Vector3 v2, Vector3 v3)
|
void PartInstance::addSmoothTriangle(Vector3 v1, Vector3 v2, Vector3 v3)
|
||||||
{
|
{
|
||||||
addVertex(v1,color);
|
addVertex(v1,color);
|
||||||
addVertex(v2,color);
|
addVertex(v2,color);
|
||||||
addVertex(v3,color);
|
addVertex(v3,color);
|
||||||
addNormals(cross(v2-v1,v3-v1).direction());
|
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||||
//addSingularNormal(Vector3(cross(v2-v1,v3-v1) + cross(v3-v2,v1-v2) + cross(v1-v3,v2-v3)).direction());
|
//addSingularNormal(Vector3(cross(v2-v1,v3-v1) + cross(v3-v2,v1-v2) + cross(v1-v3,v2-v3)).direction());
|
||||||
//addSingularNormal(v1.direction());
|
addSingularNormal(v1.direction());
|
||||||
//addSingularNormal(v2.direction());
|
addSingularNormal(v2.direction());
|
||||||
//addSingularNormal(v3.direction());
|
addSingularNormal(v3.direction());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
void addSingularNormal(Vector3 normal);
|
void addSingularNormal(Vector3 normal);
|
||||||
void addTriangle(Vector3 vertexPos,Vector3 vertexPos2, Vector3 vertexPos3);
|
void addTriangle(Vector3 vertexPos,Vector3 vertexPos2, Vector3 vertexPos3);
|
||||||
void addQuad(Vector3 v1,Vector3 v2, Vector3 v3, Vector3 v4);
|
void addQuad(Vector3 v1,Vector3 v2, Vector3 v3, Vector3 v4);
|
||||||
|
void genSmoothNormals(int);
|
||||||
void addSmoothTriangle(Vector3 vertexPos,Vector3 vertexPos2, Vector3 vertexPos3);
|
void addSmoothTriangle(Vector3 vertexPos,Vector3 vertexPos2, Vector3 vertexPos3);
|
||||||
void makeSmoothFace(int vertex1, int vertex2, int vertex3);
|
void makeSmoothFace(int vertex1, int vertex2, int vertex3);
|
||||||
void addPlus(Vector3 v1);
|
void addPlus(Vector3 v1);
|
||||||
|
|||||||
Reference in New Issue
Block a user