Describe, in layman‟s terms, the geometrical transformations that would have to be performed on the shape shown in Figure 1, in order to produce the larger of the two shapes shown in Figure 2.
1. void drawChevron(){
2. glBegin(GL_TRIANGLES);
3. glColour3ub(127, 127,127);
4. glVertex2f(-2, -2);
5. glVertex2f( 0, -1);
6. glVertex2f( 0, +2);
7. glVertex2f(-2, +2);
8. glVertex2f( 0, +2);
9. glVertex2F( 0, -1);
10. glEnd(); 11. } //This is figure 1s code dont know how to insert the image.
Figure 2 has two of the same shapes all of which are of positive vertices.
The answer that was provided with the paper i dont fully understand what is happening, but i do know what is being done. I'm probably contradicting myself, guess im confused.
Solution to the question:
Scale by a factor of 1.5 in the vertical direction (y)
Scale by a factor of 0.5 in the horizontal direction (x)
Rotate 90 degrees anticlockwise
Translate (move) +2 units in the vertical direction
It's just transformations of a shape. They're stretching it in the y, shrinking it in the x, rotating it and then moving it up.
If you're using an openGL tutorial that still teaches immediate mode (glBegin, glEnd) you should find something more suitable right away. Immediate mode is extremely slow and outdated, and has been deprecated since version 3.0. I think openGL 3.1 removed it completely.
One site I like a lot is this one: http://arcsynthesis.org/gltut/index.html
It doesn't just teach you the openGL functions, but goes into (varying) depth about transformations, and the rendering pipeline and such. It's not too heavy on the math either, which can be a positive or a negative depending on your view.