Virtual coordinate systems

A

AJAskey

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
 
K

Knute Johnson

AJAskey said:
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

You could use an AffineTransform and scale the drawing?
 
M

Mark Space

AJAskey said:
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

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.
 
A

AJAskey

Mark said:
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
 
N

Nigel Wade

AJAskey said:
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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,888
Messages
2,569,964
Members
46,294
Latest member
HollieYork

Latest Threads

Top