How to Perform a Composite Concatenation [Transformation] Through Code

using C++ , OpenGL , and Visual Studio 2013 IDE


void drawSquare(){
	glBegin(GL_QUADS);   //Primitive
	glVertex2i(200, 100);//vertices for points(coordinates)
	glVertex2i(250, 100);
	glVertex2i(250, 150);
	glVertex2i(200, 150);
	glEnd();

}


void myDisplay(void)
{
	glClear(GL_COLOR_BUFFER_BIT);
	drawSquare();
	glTranslatef(1.5, 1.5, 0);
	drawSquare();
	glScalef(0.3, 0.3, 0);
	drawSquare();
	glRotatef(45, 0, 0, 1);
	drawSquare();
	glFlush();   //Set all output to display
}

does this code perform composite concatenation ?

Question

Build a transformation that
a) Rotate through 45 deg [M1]
b) Scale in X By 1.5 and in Y By -2 [M2]
c) Translate Through (3,5) [M3]

Find the image under this transofrmation of the point (1,2)

so we will work backwards and first apply part c then part b then part a

i.e M3 * M2 * M1

Step-1

[ATTACH=CONFIG]1608[/ATTACH]

Step-2

[ATTACH=CONFIG]1609[/ATTACH]

i understood the process of Composite Concatenation

what i dont understand is how to perform a composite concatenation through program code ?

consider the code i posted at the very beginning

it calls

drawSquare
glRotate
drawSquare
glTranslate
drawSquare

is this composite concatenation ?

how do i use the final generated Matrix (Qx,Qy,1) and use it to perform composite concatenation

[QUOTE=umartariq;1289271]does this code perform composite concatenation ?

i understood the process of Composite Concatenation
what i dont understand is how to perform a composite concatenation through program code ?[/QUOTE]

Websearch glTranslatef and glRotatef and read the manual pages. They’ll tell you the answer.

For other related reading, websearch ‘Composite Concatenation opengl’.