opengl

Is stereoscopy (3D stereo) making a come back?

I'm working on a stereoscopy application in C++ and OpenGL (for medical image visualization). From what I understand, the technology was quite big news about 10 years ago but it seems to have died down since. Now, many companies seem to be investing in the technology... Including nVidia it would seem. Stereoscopy is also known as "3D St...

Error, Implementing Winding Number Algorithm, (OpenGL, C++)

Hi, I am trying to implement the Winding Number Algorithm to test if a point is within another polygon. Although the results from my algorithm are wrong and not consistent. I have been working on this for ages now and it has become a bit of a pain! I have basically converted pseudo code from notes and websites, such as, softsurfer.com...

SwapBuffers crashing my program!

I have an OpenGL program that works on all of my computers but one. It's a desktop with Vista 64 and a Radeon HD4850. The problem seems to be in my call to SwapBuffers(hdc). It compiles fine and then gives me an exception: Unhandled exception at 0x00000000 in Program.exe: 0xC0000005: Acces violation. Using VC++ to break before the cal...

Is there a Python library for easily writing zoomable UI's?

My next work is going to be heavily focused on working with data that is best understood when organized on a two-dimensional zoomable plane or canvas, instead of using lists and property forms. The library can be based on OpenGL, GTK+ or Cairo. It should allow me to: build widgets out of vector shapes and text (perhaps even SVG based?...

How can you draw primitives in OpenGL interactively?

I'm having a rough time trying to set up this behavior in my program. Basically, I want it that when a the user presses the "a" key a new sphere is displayed on the screen. How can you do that? ...

How to work with pixel modifications

I am working on an i phone game. In that I have to create texture from a Quartz Image Source. Then i want to do some pixel modifications. I am a beginner with openGl. please guide me with the steps that should be followed ...

What does this OpenGL compilation error mean?

Original Question: [Warning] passing GLfloat' for converting 2 of void glutSolidSphere(GLdouble, GLint, GLint)' [Warning] passing GLfloat' for converting 3 of void glutSolidSphere(GLdouble, GLint, GLint)' After applying one of the poster's suggestions of including glut.h, I now get this problem. I can't use glutSol...

problem with glut.h

[Linker error] undefined reference to `__glutInitWithExit@12' [Linker error] undefined reference to `__glutCreateWindowWithExit@8' [Linker error] undefined reference to `__glutCreateMenuWithExit@8' [Linker error] undefined reference to `glutSolidSphere@16' the problem above came out if i include glut.h header.. why? i cant use gl...

Need help with Converting Points to Shapes

below are a whole length of code i have copied from NEHE Production (Lesson 25).. i was just trying to play around but seem to not able to change/convert each points into a individual spheres nor cylinder.. somehow when i did my adjustment they are not arranged in the way they are suppose to and they won't rotate.. i planed to add light ...

Trouble porting OpenGL app to Windows

I am trying to move an OpenGL app to Windows. It was my understanding that Windows had a decent OpenGL implementation. But I'm starting to think that it doesn't... Specifically, I use array buffers and glDrawArrays. When I tried to compile my code in Visual Studio 2008 Pro, I received the following errors: vertexbuffers.cpp(31) : err...

How can I use a dynamically sized texture array with glTexImage2D?

Currently, I'm able to load in a static sized texture which I have created. In this case it's 512 x 512. This code is from the header: #define TEXTURE_WIDTH 512 #define TEXTURE_HEIGHT 512 GLubyte textureArray[TEXTURE_HEIGHT][TEXTURE_WIDTH][4]; Here's the usage of glTexImage2D: glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, TEXTURE_WIDT...

How to draw signature with lines on iPhone screen?

I want to let user draw a signature on iPhone screen, so I add a subclass of UIView and add some code to its 'touchesMoved' method. -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; firstTouch = [touch locationInView:self]; CGSize mySize = CGSizeMake(5, 5); UIGraph...

Can I use a grayscale image with the OpenGL glTexImage2D function?

I have a texture which has only 1 channel as it's a grayscale image. When I pass the pixels in to glTexImage2D, it comes out red (obviously because channel 1 is red; RGB). glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, dicomImage->GetColumns(), dicomImage->GetRows(), 0, GL_RGBA, GL_UNSIGNED_BYTE, pixelArrayPtr); Do I change GL_RGBA? If s...

Problem with light and depth in OpenGL

glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); ifstream myFile("Coordinates.txt"); if (!myFile.is_open()) { cout << "Unable to open file"; exit(1); // terminate with error } // Light values and coordinates float ambientLight[] = { 0.3f, 0.3f, 0.3f, 1.0f }; float diffuseLight[] = { 0.7f, 0.7f, 0.7f, 1.0f }; float specular[...

problem saving openGL FBO larger than window

Hello, I'm rendering into an OpenGL offscreen framebuffer object and like to save it as an image. Note that the FBO is larger than the display size. I can render into the offscreen buffer and use it as texture, which works. I can "scroll" this larger texture through the display using an offset, which makes me confident, that I render in...

How to visualize a depth texture in OpenGL?

I'm working on a shadow mapping algorithm, and I'd like to debug the depth map that it's generating on its first pass. However, depth textures don't seem to render properly to the viewport. Is there any easy way to display a depth texture as a greyscale image, preferably without using a shader? ...

What's wrong with my file dependencies?

I have a program using 3 header files and 3 .cpp files in addition to main.cpp. I'm using VC++ 2008. Here's the setup. All three headers are guarded with #ifndef HEADERNAME_H, etc. Also all three headers have corresponding .cpp files, which #include their respective headers. /* main.cpp */ #include "mainHeader.h" /* mainHeader.h *...

opengl rotation problem

can anyone tell me how to make my model rotate at its own center go gravity in stead of the default (0,0,0) axis? and my rotation seems to be only going left and right not 360 degree.. ...

How to preserve other application windows sizes and positions when changing resolution? (eg. to and from full screen game in other resolution than desktop one)

Has anyone noticed this odd behavior of application that utilize D3D or OpenGL when they go to full screen in Windows? It applies only when applications go to full screen and then switch back to window or terminate. They either shuffle window positions of other applications (when I am on single monitor machine), or move all the other ap...

unit-testing an openGl display.

I have an openGL display that I would like to write unit-tests for. However, I'm not sure what sort of tests should be written to ensure my display is working properly? I Know I can test that the context was created successfully. But, because it is a graphical element, and working correctly is based on what is displayed, does everything ...