opengl

Equiv of glDrawpixels that operates on GPU memory?

glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const ovid *pixels); Is there a function like this, except instead of accessing CPU memory, it accesses GPU memory? [Either a texture of a frame buffer object] ...

Selection / glRenderMode(GL_SELECT)

In order to do object picking in OpenGL, do I really have to render the scene twice? I realize rendering the scene is supposed to be cheap, going at 30fps. But if every selection object requires an additional gall to RenderScene() then if I click at 30 times a second, then the GPU has to render twice as many times? ...

Compiling a C/C++ application against OpenGL and Xm in OSX

Hi, I am rather new to Mac OSX. I am trying to get an old code compiled in OSX Leopard, which uses OpenGL and XM. The headers are like: #include <malloc.h> #include <X11/Intrinsic.h> #include <X11/StringDefs.h> #include <X11/keysym.h> #include <Xm/MainW.h> #include <Xm/RowColumn.h> #include <Xm/PushB.h> #include <Xm/PushBG.h> #in...

opengl modelling rocket flame and vapour trails with particles

Does anyone have any guidance for coding an approximation for the particle stream coming out of a jet engine (with afterburner) in opengl using particles drawing using vertex buffers / 4f color buffers? I believe there are two aspects to this problem: The colour of the light as particles exit the jet engine as a function of temperatur...

Is it possible to get the width of a character when using OpenGL bitmap fonts?

I am trying to align my bitmap font text in my OpenGL application but I can't find anything on getting the width of each character. This is my renderText function: def renderText( self, text, fontFace, position ): ..... (omitted code to make post shorter) glRasterPos2i( position[0], self.windowSize[1] - position[1] ) glPushA...

Resizing a GLJPanel with JOGL causes my model to disappear.

I switched over to using a GLJPanel from a GLCanvas to avoid certain flickering issues, however this has created several unintended consequences of it's own. From what I've gleaned so far, GLJPanel calls GLEventListener.init() every time it's resized which either resets various openGL functions i've enabled in init() (depth test, lighti...

OpenGL texture mapping on sides cube using GL_QUADS

I am trying to map a different texture on each side of a cube using a GL_QUADS. My first problem is that I cannot even get a texture to display on the side of a GL_QUADS. I can however get a texture to display using GL_TRIANGLES but I do no understand how to draw things very well using triangles and I want to use QUADS. I also can only u...

Leveraging Core Animation for Animation in OpenGL

I'm interested in using Core Animation to drive custom animations in my OpenGL scene on the iPhone. I was hoping to find a mechanism that allowed you to generically animate a keypath of an NSObject or a delegate method for each animation tick. What I have come up with is to animate an arbitrary property of a CALayer and poll them from Op...

OpenGL audio waveform rendering

I am trying to figure out how to render a waveform from an audio file. Can I do that using OpenGL+OpenAL? The main idea is that I need to draw a 3D scene (like a rollercoaster) based on audio data. ...

Should i always use GL_CULL_FACE ?

Should i always be using this method when rendering? Does it slow down much on bad gfx cards? If the end result will not have many culled faces, should i even be using this method then? ...

GLSL Error: 2001 - What does this error code mean?

I got this after querying the info logs when a compile error occurred. I have not been able to find a single resource that tells me what the error code even means! Using Ubuntu 9.10 with an Intel mobile chipset that supports glsl 1.1. Mesa driver. Vertex Shader: #version 110 in vec3 m2d_blendcolor; out vec3 color; // out vec2 texcoor...

Eye candy in OpenGL

I'm interested in creating realtime visual special effects. I am limited to OpenGL (in particular, computing power of a MacBook Pro). I want to learn more about doing cool UI/special effects (think the "computers/displays" in Iron Man / Avatar). What are good books/resources for this? Thanks! ...

OpenGL: throw out triangles/quads in a certain direction.

Context: I'm doing shadow mapping. When rendering the scene from the eye's point of view, I'd like to throw out certain triangles/quads ... in particular, elements of the following property: L = light position C = center of scene V = L - C I want to throw out the elements whose normal N satisfy dot_product(V, N) = close to 0. [The r...

OpenGL multiple texture mapping on a cube using GLUT

Have been trying to figure out how to put a different texture on each side of a cube using OpenGL and GLUT. I can get it to be a simple texture but multiple texture won't. I would put up my code but it is ugly and cluttered right now. If this is pretty easy to do please post some code for me to follow. Thanks! ...

bias matrix in shadow mapping

I'm looking at shadow mapping in OpenGL. I see code like: // This is matrix transform every coordinate x,y,z // x = x* 0.5 + 0.5 // y = y* 0.5 + 0.5 // z = z* 0.5 + 0.5 // Moving from unit cube [-1,1] to [0,1] const GLdouble bias[16] = { 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0}; // G...

Drawing numbers into a panel?

I was wondering if there was already a component available which the user could use the touchscreen to draw numbers into. If not, I was considering an openGL panel which their input would draw onto, and then I'd need some algorithm to interpret the drawing and parse it to a number. Obviously, I'd prefer a component already exist, but am...

Why is my Python OpenGL render2DTexture function so slow?

SOLVED: The problem was actually using time.time() every CPU cycle to see whether the next frame should be drawn or not. The time it takes to execute time.time() was having an impact on the FPS. I made this function for drawing 2D textures as images in a 2D view in my OpenGL application. After doing some testing I found that it takes up...

How much does glCallList boost the performance?

Hi! I'm new to OpenGL. I have written a programm before getting to know OpenGL display lists. By now, it's pretty difficult to exploit them as my code contains many not 'gl' lines everywhere in between. So I'm curious how much I've lost in performance.. ...

glPushName + glPopName stack overflow and underflow

Can anybody please explain me how to use glPushName and glPopName. I like to use them instead of glLoadName, but I laways get GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW errors. (First, under then overflow). Example code would help me too. Thanks for any advice. Note #1: My Rendering/selection_rednering code consists of multiple glBegin(...

iPhone OpenGL tutorial

Hi, I am planning to make a 2D game on iphone. Is there any tutorial for getting started with opengl 2D example for iphone specially how to animate a sprites and draw tile map. Any other beginners tutorial is also welcome. Thank you in advance ...