For Programmers: Free Programming Magazines  


Home > Archive > Java Help > September 2006 > Simple 3D Point Plotting









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Simple 3D Point Plotting
Brian Bagnall

2006-09-24, 7:03 pm

I'm looking to create a simple Java app that outputs a bunch of 3D points
(X, Y, Z) into a window. Possibly being able to rotate the image of the dots
to appreciate the 3D. What would be my best way to do this in Java? The Java
3D API seems like overkill since you *need* OpenGL and a 3D card, but I'm
sure my app would run fine on any system without 3D hardware.

- Brian


Thomas Weidenfeller

2006-09-25, 4:08 am

Brian Bagnall wrote:
> I'm looking to create a simple Java app that outputs a bunch of 3D points
> (X, Y, Z) into a window. Possibly being able to rotate the image of the dots
> to appreciate the 3D. What would be my best way to do this in Java?


There is almost never a best way in programming, only compromises. And
without knowing your requirements, resources, etc. we can't even say
what a feasible way might be.

> The Java
> 3D API seems like overkill since you *need* OpenGL and a 3D card, but I'm
> sure my app would run fine on any system without 3D hardware.


You ruled out Java 3D (because you didn't want to make that compromise),
so now you have to make other compromises when e.g. using the Java2D API
(part of the java standard edition).

You could now start to learn the Java2D API. Then learn the math
involved in projecting 3D data on a 2D surface, rotation, translation,
scaling of 3D data, etc.

Alternatively, you could look for some 3rd party data visualization
toolkit (google ...) which might fit your needs. Or you could look for
similar examples. E.g. there is a very old applet demo which displays
somewire frame data. It might be possible to adapt it.

/Thomas
--
The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hi....lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS...ng/java/gui/faq
Brian Bagnall

2006-09-25, 10:02 pm

"Thomas Weidenfeller" <nobody@ericsson.invalid> wrote in message
news:ef8658$f48$1@news.al.sw.ericsson.se...
>
> Alternatively, you could look for some 3rd party data visualization
> toolkit (google ...) which might fit your needs. Or you could look for
> similar examples. E.g. there is a very old applet demo which displays
> somewire frame data. It might be possible to adapt it.


Yes, that sounds like a better way to go. I can output the data to a file
and display the scatter dots it in another program (probably around 400
dots). Could you point me to the Java app you mentioned, or possibly a free
data visualization application?

- Brian


Larry Barowski

2006-09-26, 8:41 am


"Thomas Weidenfeller" <nobody@ericsson.invalid> wrote in message
news:ef8658$f48$1@news.al.sw.ericsson.se...
> Brian Bagnall wrote:
> You could now start to learn the Java2D API. Then learn the math involved
> in projecting 3D data on a 2D surface, rotation, translation, scaling of
> 3D data, etc.
>
> Alternatively, you could look for some 3rd party data visualization
> toolkit (google ...) which might fit your needs. Or you could look for
> similar examples. E.g. there is a very old applet demo which displays
> somewire frame data. It might be possible to adapt it.


For either of those options, the OP might want to look at
VGJ. It displays graphs in 3D, with rotation controls.
http://www.eng.auburn.edu/departmen...rawing/vgj.html
Assuming you are plotting points that are the same solid
color, so you don't need a z-buffer or depth sort, this
would be all you'd need. The code is very old, somewhat
sloppy, and no longer maintained, but you can find updated
versions elsewhere.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com