Urgent request interaction of MatLab<->LWJGL...

Started by Infotainment, November 05, 2007, 11:14:51

Previous topic - Next topic

Infotainment

Hello everybody I got an urgent request.
I am currently working at my diploma, and to make a long story short:

I would like to know if it is possible to use the "graphical output" from an application (www.jake2.de)
written (partially) in LWJGL directly in MatLab.
To visualize my needs: Imagine, that the game-screen which is normally seen by the user (the graphical output)
is directly mapped to MatLab to work on this data (image processing, a.s.o.).
If it wouldn't be a performance problem I could do every tenth of a second
a screenshot from the Jake2 output, save it, read it with MatLab and do all the
processing on the loaded image.
But beacuse I think this would be much too slow I am searching for another solution.
Any suggestions?

Some more Infos: www.jake2.de is a project which completely converts ID's Quake2 into Java,
also using LWJGL.
MatLab is a scientific programming language (http://www.mathworks.com/products/matlab/)
enable people to produce fast results.
MatLab also offers an Java-interface, but because I'm not to familiar with programming in Java (especially
using graphics (i've never done that before)) I'm pretty unsure if it would be possible.

Any ideas, hints or suggestions would be appreciated.
Thanks in advance for your support and ideas.

Matzon

You should be able to capture the output and either write it to a file for processing or hand it directly to the other program. However, to use it in matlab, you need a way to feed matlab - and having very little knowledge of matlab, I can't help you with that part.
So you need to identify how you get stuff into matlab.

Infotainment

Hi.
First at all thank you for your replie.
I've searched around and found something very interesting:
http://www.javagaming.org/forums/index.php?topic=8747.0

This seems to perfectly fit my needs.
Now I have different questions:
1. Can I also capture the window from Quake2 (using openGL?)

2. What is Gl gl? (I know GL is the data-type (like int) but...mhm)
Where can I start to understand that code, respectively which tutorials will help
me gaining a fast technical understanding for implementing this code?!
Any ideas? I would be glad of this, because since now I've never ever been in touch with graphics.

My idea is to capture from a running java-application (independent of Quake2) every tenth of a second
a screenshot from the Quake2-output, will this be possible (with the founded code-snippet)?

Momoko_Fan

GL gl in that case is a handle to the GL context. The code you specified will only work with JOGL, not LWJGL (which you said jake2 uses). In order to use LWJGL, the calls must be sent to the appropriate static GL binding class (GL11, GL12, etc).