|
|
@ -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); |
|
|
|
|
|
|
|