Question
Problem 7 (20 points) Consider a simple graphics toolkit that works like OpenGL (that is, it has a matrix stack, and the transformation commands post-multiply
Problem 7 (20 points) Consider a simple graphics toolkit that works like OpenGL (that is, it has a matrix stack, and the transformation commands post-multiply themselves onto it): The toolkit has the following commands translate(x,y) - post-multiplies a translation matrix onto the top of the matrix stack scale(x,y) - scales by x and y from the origin. BOTH X and Y MUST BE POSITIVE . push() - pushes a copy of the top element on the matrix stack pop() - removes the top element from the matrix stack draw(triangle) - draws a triangle with unit base and unit height .draw(square) - draws a unit square Sample: translate(1,1) draw(square) translate(1,0) draw(triangle) Write down the sequence of commands to make the following drawing in a minimum number of steps. Assume the origin of triangle and square is bottom left.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started