diff --git a/src/7threed/Raster.cc b/src/7threed/Raster.cc index 44195f3..dc5e8e9 100644 --- a/src/7threed/Raster.cc +++ b/src/7threed/Raster.cc @@ -270,7 +270,7 @@ void Raster::drawTriangle(Ege eges[3], Image* image) { //printf("sho:%d (%d,%d) (%d,%d) (%d,%d,%d) (%d,%d,%d)\n", iShort1,eges[iShort1].x1, eges[iShort1].y1, eges[iShort1].x2, eges[iShort1].y2, eges[iShort1].color1._r, eges[iShort1].color1._g, eges[iShort1].color1._b, eges[iShort1].color2._r, eges[iShort1].color2._g, eges[iShort1].color2._b); drawEge(eges[iMax], eges[iShort1], image); - //drawEge(eges[iMax], eges[iShort2], image); + drawEge(eges[iMax], eges[iShort2], image); } void Raster::drawTriangle(const Vertex& vertex, Image* image) { diff --git a/src/7threed/threed.cc b/src/7threed/threed.cc index 9be67ea..6c8a0a2 100644 --- a/src/7threed/threed.cc +++ b/src/7threed/threed.cc @@ -21,15 +21,24 @@ struct Vertex { void example3() { Vertex vertexs[] = { - {-1.0f, 0.0f, -2.0f, 0.0f, 0.0f, Rgba(255, 0, 0, 255)}, + {-1.0f, 0.0f, -9.0f, 0.0f, 0.0f, Rgba(255, 0, 0, 255)}, { 0.0f, 1.0f, -9.0f, 1.0f, 1.0f, Rgba(0, 255, 0, 255)}, - { 1.0f, 0.0f, -2.0f, 1.0f, 0.0f, Rgba(0, 0, 255, 255)} + { 1.0f, 0.0f, -9.0f, 1.0f, 0.0f, Rgba(0, 0, 255, 255)} }; raster.loadIdentity(); Image* image = Image::loadFromFile("/home/blobt/Documents/dev/cpp/3dbase/image/scale.jpg"); + matrix4 matScale; + matScale.scale(2,2,1); + + matrix4 matTran; + matTran.translate(-1,-1,0); + + matrix4 mat = matScale * matTran; + + raster.loadMatrix(mat); raster.bindTexture(image);