• Post Reply Bookmark Topic Watch Topic
  • New Topic

need advise on coordinates  RSS feed

 
Monic Sherm
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on trying to place a shape inside of an applet. I have the html coded and the rest of the applet class written. My problem is that I have not taken math in a very long time. I remember graphing but I am a little confused about using java's coordinate system. In my reading it seems as thought each shape has the 0,0 and you set it from there. But then I tried counting each place in order to place the shape. Is there some formula I should be using.

Any help would be greatly appreciated. Thanks in advance
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

From your description, I can't be sure what's going on, but I can tell you that in Java, as in most computer graphics, 0, 0 is the top left corner of the window, and the Y coordinate increases as you go down; this is the opposite of how mathematicians normally do things.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you haven't done so already, you should flip through the 2D graphics tutorial.
In particular, there is a section on AffineTransforms, which make it easy to
translate the origin, flip the Y-axis and generally rescale.
[ November 01, 2005: Message edited by: Jeff Albrechtsen ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!