Change color to green what transforma ons to include

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x Composi:on •  What if we want to rotate and translate? –  Ex: Rotate line segment by 45 degrees about endpoint a a a 39 Mul:plica:on Order – Wrong Way •  Our line is defined by two endpoints –  Applying a rota:on of 45 degrees, R(45), affects both points –  We could try to translate both endpoints to return endpoint a to its original posi:on, but by how much? a a a Wrong R(45) 40 Mul:plica:on Order •  Scaling and rota:on are both about the origin •  Translate shape to the origin, rotate, translate back to where you want it a a p R(45)*T(- 3,0)*p T(- 3,0)*p a T(3,0)*R(45)*T(- 3,0)*p 41 Java2D Intro •  Check out the Graphics2D class –  Your graphics object can be cast as a Graphics2D object •  Graphics2D contains an affine transform that is applied to shapes •  Useful methods: –  AffineTransform getTransform(), void setTransform(AffineTransform Tx) •  Returns/sets a copy of the...
View Full Document

This note was uploaded on 03/19/2013 for the course CSC 101 taught by Professor Merl during the Fall '12 term at Arizona State University at the West Campus.

Ask a homework question - tutors are online