opengl

OpenGL - animation stuttering when in full screen

I'm currently running into a problem regarding animation in OpenGL. I have between 200 and 10000 gears on the screen at a time all rotating. When the window is not in maximized view, my CPU runs at about 10-20 % consistently. No spikes, no stuttering in the animation, it runs perfectly smooth regardless of the number of gears on screen. ...

Is it possible to perform floating point operations on GPU when using OpenGL?

Hello! At university we have introduction to OpenGL and it's first time I'm working with it. So far I have implemented simple thing like Sierpinski carpet and I noticed that most of (both fixed and floating point) calculations are performed on CPU. Does OpenGL provide some API, which can "forward" these calculations to GPU? I know, tha...

How to set FPS to 30 with opengl?

so how? my app is running at 60FPS, but i want 30. ...

Opengl Hardware Accelerator Sleeping After Period of Inactivity

Hi All, I am working on a Opengl based 2D CAD software which requires heavy use of hardware OpenGL acceleator (pushing 250 million vertex per second at times). Here is my problem.... whenever the viewport is stagnant for more than 10 seconds, the Opengl accelerator (Geforce 9800 GT in this case) goes to a inactive mode. When the viewpor...

OpenGL: Triangles with points at infinity

I am trying to render a two-dimensional half-plane in OpenGL with the following code: void renderHalfplane(double *x, double *n) { glPushMatrix(); double theta = -360.0 * atan2(n[0], n[1])/(2.0*PI); glTranslated(x[0], x[1], 0); glRotated(theta, 0, 0, 1.0); glBegin(GL_TRIANGLES); glVertex4d(0.0, 0.0, 0.0, 1.0); glVertex4d...

OpenGL Rotation of an object around a line

Hi, I am programming in OpenGL and C++. I know 2 points on 1 line ( a diagonal line) and wish to rotate an object around that diagonal line. How can I go about doing this? I know how to use glrotatef to rotate it around the x, y or z axis but am not sure about this Thanks Jessica ...

GlutSolidSphere not solid

Hi my program is supposed to display a solid red colored sphere in the center of the screen, all i am getting is the boundary of the sphere : int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA); glutInitWindowSize(800,600); glutInitWindowPosition(0,0); glutCreateWindow("Sphere")...

Translating a Quaternion

(perhaps this is better for a math Stack Exchange?) I have a chain composed of bones. Each bone has a with a tip and tail. The following code computes where its tip will be, given a rotation, and sets the next link in the chain's position appropriately: // Quaternion is a hand-rolled class that works correctly (as far as I can tell...

My JOGL crashes if I'm not using an external monitor

This seems insane, but I've been able to reproduce an issue where my JOGL app crashes if I'm not using an external monitor. All I do is start the app, and it immediately becomes unresponsive. If I plug in an external monitor, the problem disappears. If I let the app run, then randomly pause it in a debugger, I get the following stack tr...

Why does my smudge image algorithm make the image darker?

I'm trying to write a graphical effect where a circle moves around an image smudging the image as it goes (like the way the smudge tool in Gimp or Photoshop would work). The basic algorithm I'm using is: the circle moves from position A to position B on the bitmap copy a circle of pixels from position A into a temporary bitmap draw thi...

Example for rendering with Cg to a offscreen frame buffer object

I would like to see an example of rendering with nVidia Cg to an offscreen frame buffer object. The computers I have access to have graphic cards but no monitors (or X server). So I want to render my stuff and output them as images on the disk. The graphic cards are GTX285. ...

How does the R coordinate(float) choose which part of a 3D texture to use? (OpenGL)

I am attempting to use 3D textures to texture my randomly generated terrain. I want to be able to have many different terrain textures that blend between different areas. I can't seem to figure out what part of the texture the R coordinate will pick up. If I set it to 0.0 then it gives a blend of the texture from before 1.0 and after 0.0...

OpenGL Multiple Viewports and gluPerspective()

Hello All, So I am trying to learn how to use glViewport(), "MULTIPLE TIMES". Below is my code, I have tried to follow others examples, but they are either so convoluted with other things not relevant to what I am doing or, I do not understand what they are doing. By the way I am using glut to manage my windowing system. So the best way...

How can I change the cursor image in python soya?

Soya is a 3D game framework for python. How can I change the cursor image to/from a different image? ...

Impact of "kernel: Clocksource tsc unstable" on a GUI application

I have this Java GUI application which uses OpenGL and Eclipse RCP + SWT running on a Linux (Fedora 7) machine equipped with Pentium P or Core 2 Duo CPU. It supposed to run and accept user input for months. After a few weeks of running the whole interface freezes without reason. Mouse is very slow and keyboard stops responding shortly....

Grayscale blending with OpenGL?

Is there a way to set the blending parameters so the whole scene renders in grayscale? (without using GLSL, only pipeline functions) Thanks ...

How can I fix these OpenGL linking problems in MinGW?

I have a project that I have been coding on OS X that I am now trying to get building on Windows. I have set up MinGW, created a makefile, and after a good deal of finagling everything compiles, however when it gets to the linker step a great number of errors occur along the lines of: SourceFile.cpp:(.text+0x1809): undefined reference t...

How do I convert this OpenGL makefile from Linux to Mac OS X?

I'm trying to compile a OpenGL program on my MacBook and can't figure out how to convert this makefile. CFLAGS= -I/usr/X11R6/include -I/usr/local/include LDFLAGS= -L/usr/X11R6/lib -L/usr/local/lib -lGL -lGLU -lm -lglut BINARIES=q2 all: $(BINARIES) clean: -rm *.o $(BINARIES) q2 : q2.o g++ $(LDFLAGS) $^ -o q2 q2.o: q2.cpp g+...

Mix OpenCL with OpenGL

Hello! Is it ok to use both OpenGL an OpenCL in one program? Both operate on GPU and I'm afraid how switching between OpenCL and OpenGL is handled in "background" (e.g. registers are overwritten). I'm using Linux working on computer with some nVidia graphic 8k, so i can use OpenCL implemented on top of the CUDA. ...

Mutlithreading an OpenGL/WinAPI application

NOTE: Please read the whole thing before posting, you'll see why. So I have an OpenGL/WinAPI application. I'm doing what you would expect, by doing cycles of handling messages, then rendering a frame, handling messages, rendering frame... The trouble is, when I resize or move a window, the screen freezes, and it can look quite ugly. I ...