Home > Archive > Java Help > May 2004 > Intersections between transforms
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Intersections between transforms
|
|
| Paul Graham 2004-05-15, 2:31 pm |
| Hi All,
New to Java2D and am trying to do something I know should be relatively
simple but isn't turning out to be.
I want to draw intersecting rectangles across an arbitrary shape that can
rotate to any position around the center of the screen. The shape can
rotate but the rectangles cannot. They must stay horizontal.
I have been investigating the AffineTransform class but am still a little
.
Couple things are going on that I don't understand:
1) The shape I am drawing on can be rotated to some angle. The rectangles
crossing it won't be. I need to find the intersections of the rectangles
and the shape but they are using different rotational transformations so
their coordinate systems are different. How do I determine where the
rectangles intersect the transformed shape? I see I can use the Area class
to do an intersect between the rectangle and the shape but how is this
accomplished when both are in different coordinate spaces?
2) The user can use the mouse to grab onto the shape or rectangles and move
them. I can track the mouse click by using createInverse that will return
the pretransformed mouse point, but how do I drag the shape so that when the
user moves the mouse horizontally the shape moves horizontally rather than
moving according to its transformed axes? I know I am missing something
simple somewhere. Any help would be appreciated.
Paul
| |
| Stewart Gordon 2004-05-17, 11:42 am |
| Paul Graham wrote:
> Hi All,
> New to Java2D
<snip>
And new to Usenet as well I see. Welcome.
You have not given people adequate time to answer on comp.lang.java
before reposting here. And even if you had, it is totally
counter-productive to just copy and paste the same message here without
reference to your previous post.
http://smjg.port5.com/faqs/usenet/xpost.html
http://www.cs.tut.fi/~jkorpela/usenet/xpost.html
Meanwhile, please pick one of the 'groups you've multiposted to on which
you wish someone to answer you.
Stewart.
--
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment. Please keep
replies on the 'group where everyone may benefit.
|
|
|
|
|