rotating text problem



Hi,

I have problem with a piece of code (see below). When the text is rotated on
my panel it seems that the coordinate system is corrupt. If I put something
on x,y = 100, 200 it looks that the object is put somewhere else. I think it
has to do with the rotation. How can i go back to the norm coordinate
system/

PS : The rotation works fine for the first time

Johan

void paintComponent() {
Graphics2D g2 = (Graphics2D)g;

AffineTransform af = new AffineTransform();
af.translate(100.,50.);
af.rotate(Math.PI / 2);
FontRenderContext renderContext = new
FontRenderContext(null, false, false);
g2.transform(af);
TextLayout layout = new TextLayout("This text is rotated",
g2.getFont(), renderContext );
layout.draw(g2, 0, 0);
}


.



Relevant Pages

  • Re: 2008 Mate Coordinate System
    ... Cimatron uses coordinate system mating extensivly. ... delta moves from the original UCS to UCS vector and XYZ rotation with 1st ... rotation, second rotation, 3rd rotation logic. ... delta distance from existing part origin. ...
    (comp.cad.solidworks)
  • Re: 2008 Mate Coordinate System
    ... believe that there were NO coordinate system mates!?!? ... delta moves from the original UCS to UCS vector and XYZ rotation with 1st ... rotation, second rotation, 3rd rotation logic. ... delta distance, and/or rotation options while mating the two coordinate ...
    (comp.cad.solidworks)
  • Re: a obfuscation about trackball implementation for a long time, who can help me???
    ... > So basically you're asking why the sign is opposite of what you would ... But your hint about left/right-handed coordinate system reminded me. ... from the center of the glass sphere, the compute the rotation axis by ... model-view transformation is done in right-handed coordinate system. ...
    (comp.graphics.api.opengl)
  • Re: moment of inertia of a cube
    ... The similarity transform for a 2d rank tensor T is A*TA ... where A and A* are cosine rotation matrices for angle a and -a. ... you must divide the distance traveled by the travel ... the coordinate system must be ...
    (sci.physics)
  • Re: Racing With Evolutionary Algorithms
    ... Rotation of the coordinate system ... Another reason for the nice performance of the CMA-ES, ... some evolutionary algorithms perform poorly when the ...
    (comp.ai.genetic)