javax.media.opengl.GL.glRenderbufferStorageMultisampleEXT
Posted: Fri 10. Aug 2012, 03:13
Any idea how to fix this or what it means or what it's trying to do?
I'm trying to call JReality from MATLAB through a class that I wrote (below the error)
Here's MATLAB session with the error. You can see that I set up the librarypath the way it sounds like it should be set up, but it seems it couldn't find something in JNI. Not sure why. Any clue?
Here's my program.
If we can get this to work I'll contribute a tutorial (practically completed) about how to do this and post it on the Wiki.
I'm trying to call JReality from MATLAB through a class that I wrote (below the error)
Here's MATLAB session with the error. You can see that I set up the librarypath the way it sounds like it should be set up, but it seems it couldn't find something in JNI. Not sure why. Any clue?
Code: Select all
Student License -- for use in conjunction with courses offered at a
degree-granting institution. Professional and commercial use prohibited.
EDU>> java.lang.System.getProperty('java.library.path')
ans =
/Applications/MATLAB_R2009aSV.app/bin/maci:/Users/ted/workspace/jreality/jni/macosx/:/Users/ted/workspace/jreality/jni/macosx/libgluegen-rt:/Users/ted/workspace/jreality/jni/macosx/libjacknative:/Users/ted/workspace/jreality/jni/macosx/libjinput-osx:/Users/ted/workspace/jreality/jni/macosx/libjogl_awt:/Users/ted/workspace/jreality/jni/macosx/libjogl_cg:/Users/ted/workspace/jreality/jni/macosx/libjogl:/Users/ted/workspace/jreality/jni/macosx/libpdnative:/Users/ted/workspace/jreality/jni/macosx/libSMSLib:/Users/ted/workspace/jreality/jni/macosx/libgluegen-rt.jnilib:/Users/ted/workspace/jreality/jni/macosx/libjacknative.dylib:/Users/ted/workspace/jreality/jni/macosx/libjinput-osx.jnilib:/Users/ted/workspace/jreality/jni/macosx/libjogl_awt.jnilib:/Users/ted/workspace/jreality/jni/macosx/libjogl_cg.jnilib:/Users/ted/workspace/jreality/jni/macosx/libjogl.jnilib:/Users/ted/workspace/jreality/jni/macosx/libpdnative.dylib:/Users/ted/workspace/jreality/jni/macosx/libSMSLib.jnilib
EDU>> import edu.utsa.ace.*
EDU>> jr4m = JReality4MatLab(100)
jr4m =
edu.utsa.ace.JReality4MatLab@d18a80
EDU>> jr4m.getFloats()
Allocating BI of size 100:100
??? Java exception occurred:
javax.media.opengl.GLException: java.lang.NoSuchMethodError:
javax.media.opengl.GL.glRenderbufferStorageMultisampleEXT(IIIII)V
at
javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:271)
at
javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:256)
at
javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
at
de.jreality.jogl.JOGLOffscreenRenderer.renderOffscreen(JOGLOffscreenRenderer.java:92)
at
de.jreality.jogl.AbstractViewer.renderOffscreen(AbstractViewer.java:341)
at
de.jreality.jogl.AbstractViewer.renderOffscreen(AbstractViewer.java:332)
at
de.jreality.jogl.AbstractViewer.renderOffscreen(AbstractViewer.java:328)
at
edu.utsa.ace.JReality4MatLab.getBufferedImage(JReality4MatLab.java:54)
at
edu.utsa.ace.JReality4MatLab.getFloats(JReality4MatLab.java:63)
Caused by: java.lang.NoSuchMethodError:
javax.media.opengl.GL.glRenderbufferStorageMultisampleEXT(IIIII)V
at
de.jreality.jogl.JOGLFBO.preRender(JOGLFBO.java:114)
at
de.jreality.jogl.JOGLRenderer.display(JOGLRenderer.java:557)
at
de.jreality.jogl.JOGLRenderer.display(JOGLRenderer.java:416)
at
de.jreality.jogl.AbstractViewer.display(AbstractViewer.java:410)
at
com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
at
javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:281)
at
com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
at
javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:298)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at
java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
max render buffer size = 8192
creating fbo 1
EDU>>
Here's my program.
Code: Select all
package edu.utsa.ace;
import java.awt.Component;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
import de.jreality.geometry.Primitives;
import de.jreality.io.JrSceneFactory;
public class JReality4MatLab {
private final de.jreality.jogl.Viewer v = new de.jreality.jogl.Viewer();
private int w,h;
private float[][][] fData;
private int[][][] iData;
/**
* Create a producer of images of nominal size
*/
public JReality4MatLab() {
this(1024,768);
}
/**
* Create a producer of images of the given size
* @param size
*/
public JReality4MatLab(int size) {
this(size,size);
}
/**
* Create a producer of images of the given size
* @param width
* @param height
*/
public JReality4MatLab(int width,int height) {
w=width;
h=height;
iData = new int[h][w][3];
fData = new float[h][w][3];
v.setSceneRoot(Primitives.wireframeSphere());
v.setCameraPath(JrSceneFactory.getDefaultDesktopScene().getPath("cameraPath"));
JFrame frame = new JFrame();
frame.getContentPane().add((Component) v.getViewingComponent());
frame.setVisible(true);
frame.setVisible(false);
}
private BufferedImage getBufferedImage() {
v.render();
return v.renderOffscreen(w,h);
}
/**
* Get an image formatted as MATLAB-organized array of floating point numbers
*
* @return the image
*/
public float[][][] getFloats() {
BufferedImage image = getBufferedImage();
int height = image.getHeight();
int width = image.getWidth();
for (int row = 0; row < height; row++ ) {
for (int col = 0; col < width; col++ ) {
fData[col][row][0] = ( (image.getRGB(row, col) >> 16) & 0xFF) / 256f;
fData[col][row][1] = ( (image.getRGB(row, col) >> 8) & 0xFF) / 256f;
fData[col][row][2] = (image.getRGB(row, col) & 0xFF) / 256f;
}
}
return fData;
}
/**
* Get an image formatted as MATLAB-organized array of integers
*
* @return the image
*/
public int[][][] getInts() {
BufferedImage image = getBufferedImage();
int height = image.getHeight();
int width = image.getWidth();
for (int row = 0; row < height; row++ ) {
for (int col = 0; col < width; col++ ) {
iData[col][row][0] = (image.getRGB(row, col) >> 16) & 0xFF;
iData[col][row][1] = (image.getRGB(row, col) >> 8) & 0xFF;
iData[col][row][2] = image.getRGB(row, col) & 0xFF;
}
}
return iData;
}
}