jogl

Render the depth buffer into a texture using a frame buffer

江枫思渺然 提交于 2019-12-22 13:01:03
问题 I am using JOGL, but this question applies to OpenGL in general. There seem to be similar questions lying around, but they are either directed at GLSL code, have to do with copying the contents of a frame buffer, or are a general advice - use frame buffer objects instead of glCopyTexSubImage2D . Question I am doing some shadow mapping. How do I render the depth channel directly to a texture using a frame buffer object? Can you please post a block of code that initializes the texture and the

How to use jzy3d in android using eclipse?

北城余情 提交于 2019-12-20 05:50:35
问题 Hi. I want to create a 3dplot graph in android. I want to use jzy3d lib and found this example for beginning. import org.jzy3d.chart.Chart; import org.jzy3d.colors.Color; import org.jzy3d.colors.ColorMapper; import org.jzy3d.colors.colormaps.ColorMapRainbow; import org.jzy3d.maths.Range; import org.jzy3d.plot3d.builder.Builder; import org.jzy3d.plot3d.builder.Mapper; import org.jzy3d.plot3d.builder.concrete.OrthonormalGrid; import org.jzy3d.plot3d.primitives.Shape; import org.jzy3d.plot3d

glReadPixels in mousePressed

柔情痞子 提交于 2019-12-20 02:41:59
问题 I am trying to get the color of a pixel in JOGL when the user clicks on it. If I put the following code in the display method (coming from the GLEventListener ), it works fine. FloatBuffer buffer = FloatBuffer.allocate(4); gl.glReadBuffer(GL3.GL_FRONT); gl.glReadPixels(10, 10, 1, 1, GL3.GL_RGBA, GL3.GL_FLOAT, buffer); float[] pixels = new float[3]; pixels = buffer.array(); float red = pixels[0]; float green = pixels[1]; float blue = pixels[2]; System.out.println(red + ", " + green + ", " +

Draw offscreen with JOGL

守給你的承諾、 提交于 2019-12-20 01:12:23
问题 As part of a larger project I'm trying to implement a facility using JOGL that will export 3D renderings to bitmap formats. We do this by creating a GLJPanel and drawing the scene we want to it, then extracting the bitmap. This all works fine as long as the system has at least one visible window on the screen - not necessarily the window containing the panel we are drawing to. But if we try to do this without making any window visible the GLJPanel won't draw. Stepping through the JOGL source

Loading JNI lib on Mac OS X?

為{幸葍}努か 提交于 2019-12-19 07:51:15
问题 Background So I am attempting to load a jnilib (specifically JOGL) into Java on Mac OS X at runtime. I have been following along the relevant Stack Overflow questions: Maven and the JOGL Library Loading DLL in Java - Eclipse - JNI How to make a jar file that include all jar files The end goal for me is to package platform specific JOGL files into a JAR and unzip them into a temp directory and load them at start-up. I worked my problem back to simply attempting to load JOGL using hard-coded

What are the steps necessary to render my scene to a Framebuffer Object(FBO) and then render that FBO to the screen?

拈花ヽ惹草 提交于 2019-12-18 13:13:56
问题 I've got a fairly complicated scene with many GL_POINTS that I need to render. The scene will be largely static, so I'd like to render it to a Framebuffer Object and then only update that FBO when my scene actually changes. I'd then like to render the FBO to the screen each frame. I've found examples that render an FBO into a texture. I've found examples that render an FBO into a RenderBuffer (still not quite sure what that is). I'm not sure what the steps are to achieve this. Do I need to

Is it possible to use Jzy3D in a Netbeans 7.0 application?

六月ゝ 毕业季﹏ 提交于 2019-12-18 09:36:29
问题 Alright, so we're trying to incorporate a 3D scatterplot into our project in Netbeans 7.0, and one of the libraries we chose to test was Jzy3D. It looks likes it would do everything we needed it to, but unfortunately, it's not doing anything. I have JOGL installed properly, and have tested it and found it to be working. Then I have included the same dependencies as in the demo. I have also tried directly including the .jars. And yes, gluegen-rt.jar is in the library folder. EDIT: To get JOGL

Using OpenGL in Matlab to get depth buffer

半世苍凉 提交于 2019-12-17 15:38:34
问题 Ive asked a similar question before and didnt manage to find a direct answer. Could someone provide sample code for extracting the depth buffer of the rendering of an object into a figure in Matlab? So lets say I load an obj file or even just a simple surf call, render it and now want to get to its depth buffer then what code will do that for me using both Matlab and OpenGL. I.e. how do I set this up and then access the actual data? I essentially want to be able to use Matlabs powerful

Maven and the JOGL library?

蹲街弑〆低调 提交于 2019-12-17 10:23:06
问题 I've been studying Maven in my free time over the last several days but can't seem to figure out how to organize a project so that the JOGL libraries are used. I would preferably like the following: Automatically download, if necessary, the OS-specific JOGL zip file from here (contains 4 jar files and some native library files (.so/.dll)); or depend on a Maven project which is a wrapper of one of the files. Unzip that zip file appropriately, so that: the jar files are added to the classpath

Applying map of the earth texture a Sphere

Deadly 提交于 2019-12-17 05:14:33
问题 i been trying to implement a 3D animation in openGL (using JOGL) of a solar system so far i have 5 planets of different sizes but the problem i seem to be having is i cant add a map of the earth texture on a Sphere can anybody help me on how its done? This is the code i have so far in my Display method: @Override public void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); GLU glu = new GLU(); gl.glClear(GL.GL_COLOR_BUFFER_BIT); //make sure we are in model_view mode gl