jogl

OpenGL - Unable to render colors other than white after texture mapping

可紊 提交于 2019-12-11 07:33:18
问题 I'm trying to render a colored cube after rendering other cubes that have textures. I have multiple "Drawer" objects that conform to the Drawer interface, and I pass each a reference to the GL object to the draw( final GL gl ) method of each individual implementing class. However, no matter what I do, I seem unable to render a colored cube. Code sample: gl.glDisable(GL.GL_TEXTURE_2D); gl.glColor3f( 1f, 0f, 0f ); gl.glBegin(GL.GL_QUADS); // Front Face Point3f point = player.getPosition(); gl

JOGL takes too long to start

这一生的挚爱 提交于 2019-12-11 07:10:15
问题 I'm trying to get a little bit into JOGL but it seems like I can't even get the program to start properly. @SuppressWarnings("serial") public class Test extends GLJPanel implements GLEventListener { public static final void main(final String[] args) { final long startTimeMillis = System.currentTimeMillis(); final GLProfile profile = GLProfile.get(GLProfile.GL4); System.out.println("GLProfile#get -> " + (System.currentTimeMillis() - startTimeMillis)); final GLCapabilities capabilities = new

JVM crashes using JOGL, vertex buffer objects, and trying to free the vbo in a finalize method

北慕城南 提交于 2019-12-11 06:45:47
问题 I have some CAD software I've written. Each component being drawn has a set of vertex buffer objects. If the component gets deleted, I have to free the vertex buffer objects in the finalize method such as: if (gl != null) { Integer[] keys = vbos.keySet().toArray(new Integer[0]); for (int i = 0; i < keys.length; i++) { Integer tmp = keys[i]; if (tmp != null) { if (gl.glIsBufferARB(tmp.intValue())); gl.glDeleteBuffersARB(1, new int[]{tmp.intValue()}, 0); } } } however I sometimes get a SIGSEV

JOGL 32 vs. 64 bit libraries error

笑着哭i 提交于 2019-12-11 05:08:35
问题 I am new to JOGL. I use Eclipse and I imported JOGL jar and dll (yes, Windows OS). But, when I was searching for JOGL libraries, I downloaded 32 bit version. I have 64 bit OS, but since I can run 32 bit apps I thought it will still be more suitable. But compiler is complaining: Can't load IA 32-bit .dll on a AMD 64-bit platform Well, first, I thought Java itself is NOT separated by architecture. Yes, I know I am using native libraries to link into Windows OpenGL interface (API), but I just

How can I achieve noSmooth() with the P3D renderer?

梦想的初衷 提交于 2019-12-11 04:28:58
问题 I'd like to render basic 3D shapes without any aliasing/smoothing with a PGraphics instance using the P3D renderer, but noSmooth() doesn't seem to work. In OF I remember calling setTextureMinMagFilter(GL_NEAREST,GL_NEAREST); on a texture. What would be the equivalent in Processing ? I tried to use PGL: PGL.TEXTURE_MIN_FILTER = PGL.NEAREST; PGL.TEXTURE_MAG_FILTER = PGL.NEAREST; but I get a black image as the result. If I comment PGL.TEXTURE_MIN_FILTER = PGL.NEAREST; I can see the render, but

Is there an Android implementation of JOGL's GL2ES2?

↘锁芯ラ 提交于 2019-12-10 18:22:28
问题 JOGL includes several interfaces that represent the common features of various versions of OpenGL and OpenGL-ES. Is there an Android implementation of the GL2ES2 interface somewhere in one of the JOGL packages, or do I have to bite the bullet and implement it myself? 回答1: You should read this documentation: http://jogamp.org/jogl/doc/Overview-OpenGL-Evolution-And-JOGL.html JOGL 2 already works as is under Android. What are you trying to do? Numerous tablets and mobile phones support OpenGL-ES

JOGL - glu.gluUnProject always returning 0.0

核能气质少年 提交于 2019-12-10 17:26:12
问题 I'm currently trying to work out how to get world coordinates from JOGL - at the moment it only returns x = 0.0, y= 0.0 and z = 0.0 no matter where I click. What am I doing wrong? public double[] getMousePosition(int x, int y){ int viewport[] = new int[4]; double modelview[] = new double[16]; double projection[] = new double[16]; float winX, winY, winZ; float posX, posY, posZ; double wcoord[] = new double[4]; gl.glGetDoublev( GL2.GL_MODELVIEW_MATRIX, modelview, 0 ); gl.glGetDoublev( GL2.GL

Worldwind PointPlacemark Pitch

天大地大妈咪最大 提交于 2019-12-10 13:17:28
问题 I'm trying to figure out why the setPitch in the PointPlacemarkAttributes does not seem to work correctly. I believe this JOGL code in PointPlacemark.java is where things are going wrong: Double heading = getActiveAttributes().getHeading(); Double pitch = getActiveAttributes().getPitch(); // Adjust heading to be relative to globe or screen if (heading != null) { if (AVKey.RELATIVE_TO_GLOBE.equals(this.getActiveAttributes().getHeadingReference())) heading = dc.getView().getHeading().degrees -

How to parse or load .obj file in JOGL? [closed]

旧城冷巷雨未停 提交于 2019-12-10 12:12:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm trying to load a car object made with 3DS Max into a JOGL program but I don't know how to do that. I have searched online but haven't gotten a good result. I tried this but got no result. Is there a tutorial on how to do that? or how to write your own loader? or an already written class that I can use? 回答1:

WorldWind PointPlacemark Heading

你离开我真会死。 提交于 2019-12-09 10:58:48
问题 In NASA WorldWind Java, I'm using PointPlacemark to represent an image because it stays the same size regardless of zoom level. The problem is that I want to set the heading on the Point Placemark and have it stay on that compass heading even when the camera is tilted. It works exactly as I want when viewing an untilted globe, but when I tilt, the placemark continues to face the screen instead of tilting with the globe, which causes it to act strange. Here is a GIF illustrating what I'm