Skip to main content

[JAVA2D] Transforms - Tutorial

2 replies [Last post]
Anonymous

Hi,

I'm new to java2d, and I was wondering if exists some good tutorial for it!
I wanna lern things like apply transforms in some elements in my canvas.
For example: rotate this rectangle r1, re scale that ellipse, but not
everything in paint method of my canvas.

The way to do this is something like :
g2d.rotate(x);
g2d.draw(r1);
g2d.rotate(-x);
.....
? It make sense?

Regards
Danilo

--
"...YOU CANNOT KNOW THE MEANING OF YOUR LIFE UNTIL YOU ARE CONNECTED
WITH THE POWER THAT CREATED YOU..."
Shri Mataji Nirmala Devi

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ted Hill

Here is a wonderful on-line interactive tutorial for the AffineTransform

http://www.glyphic.com/transform/plugin/1intro.html

As an aside: I find the AffineTransform useful and 'easy' to use for
doing 'easy' things.

However, with concatenation, preconcatenation and the lack of any way to
extract from the transform the exact angle of rotation, etc., it quickly
becomes very tricky trying to combine rotations, scalings, shears, etc
in a predictable way.

Ted Hill

-----Original Message-----
From: Discussion list for Java 2D API
[mailto:JAVA2D-INTEREST@JAVA.SUN.COM] On Behalf Of Danilo Costa
Sent: Thursday, September 30, 2004 3:05 PM
To: JAVA2D-INTEREST@JAVA.SUN.COM
Subject: [JAVA2D] Transforms - Tutorial

Hi,

I'm new to java2d, and I was wondering if exists some good tutorial for
it! I wanna lern things like apply transforms in some elements in my
canvas. For example: rotate this rectangle r1, re scale that ellipse,
but not everything in paint method of my canvas.

The way to do this is something like :
g2d.rotate(x);
g2d.draw(r1);
g2d.rotate(-x);
.....
? It make sense?

Regards
Danilo

--
"...YOU CANNOT KNOW THE MEANING OF YOUR LIFE UNTIL YOU ARE CONNECTED
WITH THE POWER THAT CREATED YOU..." Shri Mataji Nirmala Devi

========================================================================
===
To unsubscribe, send email to listserv@java.sun.com and include in the
body of the message "signoff JAVA2D-INTEREST". For general help, send
email to listserv@java.sun.com and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Brian Burkhalter

Danilo,

You might check out

http://java.sun.com/products/java-media/2D/index.jsp

from where you can find these links

http://java.sun.com/products/java-media/2D/reference/docs/index.html
http://java.sun.com/developer/Books/2dgraphics/index.html

There is also

http://www.oreilly.com/catalog/java2d/index.html

and the Java 101 link on this page

http://java.sun.com/products/java-media/jai/utilities/jaiutils.html

Brian

On Thu, 30 Sep 2004, Danilo Costa wrote:

> Hi,
>
> I'm new to java2d, and I was wondering if exists some good tutorial for it!
> I wanna lern things like apply transforms in some elements in my canvas.
> For example: rotate this rectangle r1, re scale that ellipse, but not
> everything in paint method of my canvas.
>
> The way to do this is something like :
> g2d.rotate(x);
> g2d.draw(r1);
> g2d.rotate(-x);
> .....
> ? It make sense?
>
> Regards
> Danilo
>
>
> --
> "...YOU CANNOT KNOW THE MEANING OF YOUR LIFE UNTIL YOU ARE CONNECTED
> WITH THE POWER THAT CREATED YOU..."
> Shri Mataji Nirmala Devi
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

----------------
Brian Burkhalter
Advanced Development, Graphics and Media
Software Chief Technology Office
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".