opengl

How to learn OpenGL 3.0?

Is there a good book that focuses on the programmable aspect of OpenGL 3.0 I want something like the OpenGL Super Bible, but focusing solely on the "new testament" part -- the programmable rather than the fixed pipeline. Thanks! ...

OpenGL live text-rendering

I'm implementing a GUI built on top of OpenGL. I came to the problem that each GUI will have -- text rendering. I know of several methods of rendering text in OpenGL, however, I'm wonderin which of them would be best suited for a GUI. Generally in a GUI we have two types of text -- static and live. Static is easy enough -- we can render...

Cocoa OpenGL Texture Creation

Hello, I am working on my first OpenGL application using Cocoa (I have used OpenGL ES on the iPhone) and I am having trouble loading a texture from an image file. Here is my texture loading code: @interface MyOpenGLView : NSOpenGLView { GLenum texFormat[ 1 ]; // Format of texture (GL_RGB, GL_RGBA) NSSize texSize[ 1 ]; // Width a...

New to OpenGL and deprecation.

Hello, I've begun playing around with OpenGL in Python using PyOpenGL 3.0.1b. I looked at some sample code and started running it and modifying it etc. All was well until I became a little less ignorant. On http://pyopengl.sourceforge.net/documentation/manual-3.0/index.xhtml the OpenGL functions are listed as well as whether or not th...

Drawing a point using OpenGL, but not in immediate mode

So I would like to draw a 2D point in OpenGL, but not in immediate mode. It's been a while since I've programmed in OpenGL so I'm a bit rusty, and I can't find it in the Redbook. All help is appreciated. Thanks! ...

float vs double on graphics hardware

I've been trying to find info on performance of using float vs double on graphics hardware. I've found plenty of info on float vs double on CPUs, but such info is more scarce for GPUs. I code with OpenGL, so if there's any info specific to that API that you feel should be known, let's have at it. I understand that if the program is mov...

Java OpenGL Vertex Buffer Objects not working

I tried to implement Open GLs Vertex Buffer Objects the first time, and all i get is a black screen. I tried it with glOrtho instead of glPerspective, but it didnt work as well. thanks for helping Heres my code: public class VBufferTest { public static final int WIN_WIDTH = 640; public static final int WIN_HEIGHT = 480; public in...

How to load data from a plist for OpenGL Rendering (iPhone)?

I have an interesting problem. I have 4 arrays stored in a .plist file, they are called "vertices", "normals", "texCoords" and "polygons" (this file is attached, along with GLViewController.m). l want to load these arrays into arrays of type Vertex3D, Vector3D, GLfloat and GLubyte respectively, and then render them using OpenGL. However,...

How to enable VSYNC in OpenGL

The WGL_EXT_swap_control extension allows doing this on Windows, but I am unable to find anything even remotely cross-platform doing the same, i.e. syncing my buffer swaps with screen refresh. My application uses GLEW, so something offered by that would be preferable. Cross-platform support for Linux, Mac and Windows is necessary, but my...

How do I get OpenGL/GLUT working with Eclipse IDE (cocoa 64 bit) using C++ and on Snow Leopard.

This seems like it should be strait forward, but a lot of the information I'm finding it pre-snow leopard, deals with cocoa and carbon, or the XCode IDE. None of which helps me with my problem at hand. I simply want to compile, and run openGL using C++ without becoming dependent on the Mac environment since I will most likely need to g...

OpenGL: the ultimate coordinate system confusion solution?

I'm tired of thinking how the hell my coodinates are working at each case. I heard that I could flip the Y-axis by this code: glScalef(1, -1, 1); But should I? Doesnt this break some other external functions and lighting etc? ...

OpenGL in my HWND

Right now, I'm trying to port a Direct3D renderer from my engine. I'm and OpenGL begginer so i dont have much knowlegde about OpenGL, as now i can create windows and do my render via glut, but i can't use glut for my project, because the HWND is created in my code and then sent to the renderer DLL // Where pWindow is already a valid HWN...

Rotate a quad around a centre point in OpenGL

Hello, I'm making a 2D game. I want to be able to render a texture on the screen after rotating it a certain amount around a centre point. Basically this is for a level rotation around a player. The player position being the rotation point and the direction of the player as the angle. This code wont work: def draw_texture(texture,offset...

[OpenGL] Working with Lights

Trying to get a grasp on lights and working through the OpenGL Superbible book. Below is what I am currently using for my lighting. It's placed in the SetupRC function. The lighting is mostly working as I expected as per position etc but I am confused on why when I turn the camera, it gets brighter on places where it was previously dark...

glPushName() and GL_TRIANGLE_STRIP

Hi! I am trying to implement selecting a node in a terrain (represented by triangle strips). However I cannot use glPushName() between glBegin/glEnd, so I can only save the whole strip in a name buffer. Any other ideas how could I select a specific node/triangle with the mouse? I know that by creating GL_TRIANGLE objects instead of the...

Implementing Ray Picking

I have a renderer using directx and openGL, and a 3d scene. The viewport and the window are of the same dimensions. How do I implement picking given mouse coordinates x and y in a platform independent way? ...

Adapting OpenGL render context on remote desktop connection attempt

We have an application which uses an OpenGL render context in a subwindow to display a large bitmap. However, when a user remotely connects to a box running this app, the openGL display stops working, most likely due to the reduced texture resolution. While we can detect the remote desktop connection starting/ending using WTS_REMOTE_CO...

morphing in iphone

is there a (simple) way to make a morphing (faces as a typical example) using core animation or openGL? ...

gluOrtho2D and glViewport

Hi, I have an object defined in world coordinates, say a circle centered at (2,3) with radius 4. If I want the circle to not be distorted, to be entirely visible in the viewport and to be as big as possible within the viewport, how can I formulate a gluOrtho2D command to create a world window based on the aforementioned specs given that...

OpenGL: Calculating z-value for 1:1 pixel ratio

Hi folks, I have a 256x256 texture in my view frustum that I need to move to a z-position where the texture is replicated on-screen at ACTUAL size. What I have so far is: const float zForTrueScale = -((itemSize/2) / tanf(DEGREES_TO_RADIANS(fieldOfView/2)) ) * 2; where itemSize is the size of my texture in world space (2.0 u...