Skip to main content

2D Transformation (Scale and Translate)


Write a program to accomplish the following tasks:
  1. draw a rectangle with vertices (0,0), (0,100), (200,100), (200,0).
  2. translates the rectangle to the mouse clicked location.
  3. Zoom-in the shape by pressing the "+" key, and Zoom-out by pressing the "-" key. (Hint: Use the equations x = x0*Sx, and y = y0*Sy, where Sx and Sy are constants)
   The file for the above will be available [-here-]
 

Comments

Popular posts from this blog

Scan Conversion(Circle) - Midpoint Algorithm

Assignment 05. Use the mid-point circle technique to derive the necessary equations to scan convert the following circular sector (i.e., points from  27 0 o  to 315 o ) .  Implement your method and u se the circle's symmetric property to draw complete circles.   The file is available here ( ScanConvertCirclemidpoint.cpp ) Play with it. You will understand..

TrashCoders

As I'm forming a Club "TrashCoders" after our Summer Holidays (May 2nd week), and going to share the knowledge I have, I created a new blog to upload all of the works we do in the Club. Hope you guys have some ideas and/or tips. Trash Coders  Happy Holidays..

Scan Conversion(Line) - Bresenham's Algorithm

As the second Assignment we implemented Bresenham's Algorithm. For details visit  here . Assignment 02. 1.   Use the  Bresenham’s method to derive an algorithm to scan convert lines  with slope between 0 o  and -45 o (NOT  0 o  and +45 o ). 2.   Implement your algorithm to rasterize   lines that go from left to right, with slope between 0 o  and -45 o . 3.    Modify your program to scan convert lines with any slope. The file is available here (ScanConvertLine.cpp)