mesh graph in java? (i.e. matlab 3d plot)

N

NickPick

It it possible in java to create a mesh graph like in matlab? Any
advice is appreciated.
 
J

Jerry Gerrone

It it possible in java to create a mesh graph like in matlab? Any
advice is appreciated.

Of course it is. Java is Turing-complete.

You'll want to study the Java 2D API to know how to actually render
the results:

http://java.sun.com/docs/books/tutorial/2d/index.html

and also the Javadocs for Graphics2D and friends, which should be
linked from the above.

Of course you'll need to generate the mesh from something, and project
it down into two dimensions, before rendering. That requires
mathematical know-how and is somewhat dependent on the specific
problem domain (what you're graphing). If you need help with that, the
computational-mathematics newsgroups may be the best place to ask non-
Java-specific questions and perhaps learn of useful algorithms. If you
need further help doing it in Java, questions specific to the Java
implementation of your grapher, ask those here.
 
A

Andrew Thompson

It it possible in java to create a mesh graph like in matlab? ..

I am not sure if it covers the exact type
of graph you refer to, but check out JFreeChart,
an often recommended Java charting API.
 
N

NickPick

I'm a fan of JFreeChart, but the *3D renderers are more of a decorative
effect, somewhat like beveled borders:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/cat
egory/BarRenderer3D.html>
<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/cat
egory/LineRenderer3D.html>

Alternatively, the XYBlockRenderer can render an XYZDataset nicely:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/xy/
XYBlockRenderer.html>

The OP's examples include a fourth dimension rendered as a color
gradient, which might be done with an extension of AbstractXYZDataset.

Thanks, but neither of those examples appeaar to be able to reproduce
what matlab is doing as described here: http://www.dickreuter.com/strat8.php.
Am I to take it that there are no java classes available where a an x-
y-z depiction in a 3d grid is possible?
 
J

John B. Matthews

NickPick said:
I'm a fan of JFreeChart, but the *3D renderers are more of a decorative
effect, somewhat like beveled borders:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/cat
egory/BarRenderer3D.html>
<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/cat
egory/LineRenderer3D.html>

Alternatively, the XYBlockRenderer can render an XYZDataset nicely:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/xy/
XYBlockRenderer.html>

The OP's examples include a fourth dimension rendered as a color
gradient, which might be done with an extension of AbstractXYZDataset.
[...]
Thanks, but neither of those examples appear to be able to reproduce
what matlab is doing as described here: http://www.dickreuter.com/strat8.php.
Am I to take it that there are no java classes available where a an x-
y-z depiction in a 3d grid is possible?

The 3D API is a counter-example, but your examples appear to be 4D:

<http://java.sun.com/javase/technologies/desktop/java3d/index.jsp>

You might also investigate commercial alternatives, e.g.:

<http://www.quinn-curtis.com/QCChart3DJavaProdPage.htm>
 
A

Arne Vajhøj

John said:
I'm a fan of JFreeChart, but the *3D renderers are more of a decorative
effect, somewhat like beveled borders:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/cat
egory/BarRenderer3D.html>
<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/cat
egory/LineRenderer3D.html>
Ah.

Alternatively, the XYBlockRenderer can render an XYZDataset nicely:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/xy/
XYBlockRenderer.html>

It looks more promising indeed.

Arne
 
A

Arne Vajhøj

NickPick said:
Thanks, but neither of those examples appeaar to be able to reproduce
what matlab is doing as described here: http://www.dickreuter.com/strat8.php.

If you want the exact matlab output then by far the easiest approach
is to use matlab.
Am I to take it that there are no java classes available where a an x-
y-z depiction in a 3d grid is possible?

If you want it exactly as you want it, then you can always code it
yourself.

Probably only a few thousand hours of work.

Arne
 
K

Kevin Calders

Arne said:
If you want it exactly as you want it, then you can always code it
yourself.

Probably only a few thousand hours of work.

Bollocks. I cobbled together a multifunction* 3D mesh grapher in
Smalltalk-80 in under an hour back in the day. Needed a graph for
something, so I figured what the hey.

Then again, it might not be quite that fast to do in Java. :) But still
pretty fast if you know what you're doing.

* Heightfield, surfaces of two parameters (x(s, t), y(s, t), z(s, t)),
surfaces of revolution (r = f(z)), and several other possibilities,
including implicit surfaces (F(x,y,z) = 0) which was tricky and a bit
slow to execute. It had to sample volumetrically the camera FOV and
further subsample where the sign of F flipped, and could miss small
isolated bits if the pre-subsampling gridsize was too big for the
function being graphed. But subject to these constraints, it worked, and
it produced a mesh or a shaded polygon surface as desired.

Adding a fourth D shown as colors would have been trivial. Expanding or
modifying it in other ways was trivial. Function could be replaced
arbitrarily, dropping in an expression parser would have been trivial.
 
A

Andrew Thompson

Bollocks. ..

Good to see a bit of 'roll up your damn sleeves
and code the damn thing' (damn) sentiment added
to this (damnable) thread.

The impression I get from the earlier replies is
more 'let us all hug and hope this works out well'.

Screw diplomacy. If you want a solution NickPick,
code it (and open source the code - if you don't
want to be labeled as a leeching worm) and stop
whining at us.
 
A

Arne Vajhøj

Kevin said:
Bollocks. I cobbled together a multifunction* 3D mesh grapher in
Smalltalk-80 in under an hour back in the day. Needed a graph for
something, so I figured what the hey.

Then again, it might not be quite that fast to do in Java. :) But still
pretty fast if you know what you're doing.

I am sure that the original poster would appreciate it, if you
coded it.

Arne
 
N

NickPick

I am sure that the original poster would appreciate it, if you
coded it.

Arne

Ok, I've heard enough. It's obviously not possible in java to do a
mesh graph the way matlab does it (with automatic rotation etc)
without programming it myself. I'll stick with matlab...

thanks
 
Joined
Dec 10, 2009
Messages
2
Reaction score
0
Hi all!
You can now very efficiently have the equivalent of matlab plot3d function with Jzy3d library. It has an active google code repository and discussion group.
Browse the doc and samples, you can do many things :)
Cheers,
Martin
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top