diff options
Diffstat (limited to 'src/Models.cpp')
-rw-r--r-- | src/Models.cpp | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/src/Models.cpp b/src/Models.cpp index 8f3dc37..ff5c0e2 100644 --- a/src/Models.cpp +++ b/src/Models.cpp @@ -98,59 +98,6 @@ void Model::load(const char* path) CalculateNormals(); } -void Model::Scale(float xscale,float yscale,float zscale) -{ - int i; - for(i=0; i<vertexNum; i++){ - vertex[i].x*=xscale; - vertex[i].y*=yscale; - vertex[i].z*=zscale; - } - UpdateVertexArray(); -} - -void Model::MultColor(float howmuch) -{ - int i; - for(i=0; i<TriangleNum; i++){ - Triangles[i].r*=howmuch; - Triangles[i].g*=howmuch; - Triangles[i].b*=howmuch; - } - UpdateVertexArray(); -} - -void Model::ScaleNormals(float xscale,float yscale,float zscale) -{ - int i; - for(i=0; i<vertexNum; i++){ - normals[i].x*=xscale; - normals[i].y*=yscale; - normals[i].z*=zscale; - } - UpdateVertexArray(); -} - -void Model::Translate(float xtrans,float ytrans,float ztrans) -{ - int i; - for(i=0; i<vertexNum; i++){ - vertex[i].x+=xtrans; - vertex[i].y+=ytrans; - vertex[i].z+=ztrans; - } - UpdateVertexArray(); -} - -void Model::Rotate(float xang,float yang,float zang) -{ - int i; - for(i=0; i<vertexNum; i++){ - vertex[i]=DoRotation(vertex[i],xang,yang,zang); - } - UpdateVertexArray(); -} - void Model::CalculateNormals() { int i; @@ -198,34 +145,6 @@ void Model::draw(float r, float g, float b) glDrawArrays(GL_TRIANGLES, 0, TriangleNum*3); } -void Model::draw(float r, float g, float b, float o) -{ - if(!nocolors)glColor4f(r,g,b,o); - if(nocolors==1)glColor4f(0,0,0,1); - if(nocolors==2)glColor4f(1,0,0,1); - if(nocolors==3)glColor4f(1,1,1,1); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glVertexPointer(3, GL_FLOAT, 9*sizeof(GLfloat),&vArray[0]); - glNormalPointer(GL_FLOAT, 9*sizeof(GLfloat),&vArray[3]); - glDrawArrays(GL_TRIANGLES, 0, TriangleNum*3); -} - -void Model::draw(float r, float g, float b, float x, float y, float z) -{ - if(!nocolors)glColor4f(r,g,b,1); - if(nocolors==1)glColor4f(0,0,0,1); - if(nocolors==2)glColor4f(1,0,0,1); - if(nocolors==3)glColor4f(1,1,1,1); - glNormal3f(x,y,z); - glEnableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glVertexPointer(3, GL_FLOAT, 9*sizeof(GLfloat),&vArray[0]); - glDrawArrays(GL_TRIANGLES, 0, TriangleNum*3); -} - int Model::LineCheck(XYZ p1,XYZ p2, XYZ *p) { int j; |