Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Virtual coordinate systems

Thread view: 
AJAskey - 30 Sep 2006 00:35 GMT
Hi.  I've scanned posts for about and hour and can't find what I need.
I'm trying to plot a missile flyout in earth centered earth fixed
(ECEF) coordinates.  Is there a class in SWING or elsewhere that will
let me map my coordinate system on top of the screen coordinates.  For
example, the idea is to draw a line using a call such as
DrawLine(300000,6000000,400000,7000000) and the class will convert it
back to the basic draw call with the screen coordinates.  I did this
all the time on HPs and SGI in the early 1990s but I can't figure out
how to do it with Java.

I don't need a lot - just a pointer to the class(es) I need to get me
headed in the right direction.  An example would be great but a web
link or class names is all I really need.

Thanx.
Andy
Knute Johnson - 30 Sep 2006 01:46 GMT
> Hi.  I've scanned posts for about and hour and can't find what I need.
> I'm trying to plot a missile flyout in earth centered earth fixed
[quoted text clipped - 12 lines]
> Thanx.
> Andy

You could use an AffineTransform and scale the drawing?

Signature

Knute Johnson
email s/nospam/knute/

Mark Space - 30 Sep 2006 06:25 GMT
> Hi.  I've scanned posts for about and hour and can't find what I need.
> I'm trying to plot a missile flyout in earth centered earth fixed
[quoted text clipped - 12 lines]
> Thanx.
> Andy

Not sure, SWING, maybe not.  But have you looked a JOGL?  OpenGL for
Java.  Might be good if you are really doing 3D, works for 2D too.  Joe
Bob says check it out.
AJAskey - 30 Sep 2006 17:52 GMT
> Not sure, SWING, maybe not.  But have you looked a JOGL?  OpenGL for
> Java.  Might be good if you are really doing 3D, works for 2D too.  Joe
> Bob says check it out.

Mark,

Thanx.  I just glanced at JOGL and that will probably do it.  I haven't
written graphics myself in 15 years but I wrote a lot in GL before it
turned into OpenGL.  I'm sure it is much different but the concepts are
probably the same.

If anyone has other suggestions I can still use them.

Andy
Nigel Wade - 02 Oct 2006 10:39 GMT
> Hi.  I've scanned posts for about and hour and can't find what I need.
> I'm trying to plot a missile flyout in earth centered earth fixed
[quoted text clipped - 12 lines]
> Thanx.
> Andy

AffineTransform in Graphics2D will allow you to do pretty much any
transformation on the graphics coordinate system. It can be tricky to get your
head around it at first as it's not exactly accessible - you need to understand
co-ordinate transformation matrices to get at what's really going on. There are
convenience methods for the simple transformations such as translate, scale,
rotate etc.

In essence, you obtain the Graphics of the object you are drawing to
(JComponent.getGraphics()), cast it to Graphics2D and then apply an
AffineTransform to it. Anything you now draw in that object using the
Graphics2D methods will be affected by the transform you've applied. Transforms
can be "chained" so you can scale, translate and rotate all in one transform
which helps to convert the native co-ordinate system (with 0,0 in the upper
left, y increasing downward) to a more natural mathematical one with y
increasing upward.

There's a basic guide to Java 2D here
file:///usr/java/docs/guide/2d/index.html. But the JavaDocs don't really have
much about graphics primitives, at least not that I found when I was doing this
sort of thing a couple of years ago.

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.