opengl

How do I render thick 2D lines as polygons?

I have a path made up of a list of 2D points. I want to turn these into a strip of triangles in order to render a textured line with a specified thickness (and other such things). So essentially the list of 2D points need to become a list of vertices specifying the outline of a polygon that if rendered would render the line. The problem ...

How can I manage a cache texture in OpenGL?

I am writing a text renderer for an OpenGL application. Size, colour, font face, and anti-aliasing can be twiddled at run time (and so multiple font faces can appear on the screen at once). There are too many combinations to allocate one texture to each combination of string and attributes. However, only a small subset of the entire d...

OpenGL, Java and memory management

When using openGL in Java (in bindings like jogl), do you have to worry about memory management? Does the JVM do garbage collection with the created openGL objects? If so, what's the best way to approach cleanup? ...

how to use the key board as command to zoom in opengl?

can anyone tell me how? i've never done this before so i'm not sure as what library to use and how to call the command that a key pressed as a instruction rather than input.. i'm writing a OpenGL program in Visio C++ ...

Concave polygon drawing

For drawing complex concave polygons with OpenGL, is it better to tesselate it into triangles, or use the stencil buffer? I'm guessing the stencil buffer would be faster for a single frame, but triangulation would be better for multiple frames if the polygon doesn't change. However, I haven't actually tried it, so I don't know. ...

How does one convert world coordinates to camera coordinates?

I have an input 3D vector, along with the pitch and yaw of the camera. Can anyone describe or provide a link to a resource that will help me understand and implement the required transformation and matrix mapping? ...

What is the industry standard IDE for Game Development?

I'm guessing this depends on the OS, among other things. I would guess that development for Windows using DirectX would "force" people to use Visual Studio, but is that always the case? What about when OpenGL is the graphics API? How about Java? Is Eclipse the norm? UPDATED: I guess the general consensus is that there aren't really...

Perspective Projection - Help a Noob

Hey, I wish to determine the 2D screen coordinates (x,y) of points in 3D space (x,y,z). The points I wish to project are real-world points represented by GPS coordinates and elevation above sea level. For example: Point (Lat:49.291882, Long:-123.131676, Height: 14m) The camera position and height can also be determined as a x,y,z poi...

Framerate uneven on mouse input in 3D app

I'm writing a 3D application for Windows, using OpenGL. For now it renders a simple test scene with one model of about 50000 polygons and it renders smoothly at 60FPS. However, the framerate gets very uneven whenever the mouse is moved over the application window. It fluctuates from 400 FPS to 20 FPS randomly. Is there any reason for th...

What is a good way of implementing HCI in OpenGL?

I'd like to try and implement some HCI for my existing OpenGL application. If possible, the menus should appear infront of my 3D graphics which would be in the background. I was thinking of drawing a square directly in front of the "camera", and then drawing either textures or more primatives on top of the "base" square. While the menu...

OpenGL context without opening a window - wglMakeCurrent fails with HDC and HGLRC when using HWND made with GetDesktopWindow

This is somewhat a duplicate of this question. I am trying to make a windowless console application to check up on OpenGL version supported. In order to do this I need to set up a render context - but without creating a window. I am trying to use desktop handle, which I won't write to. I forgot to set pixel format in previous example -...

Looking for Linux/Windows -deployable OpenGL windowing-and-OS libraries

I'd like to set up an OpenGL development environment in Linux that I can also cross-compile for Windows out of. It looks like GLFW + OpenGL will give me what I need. I tried installing the GLFW development package for Ubuntu 8.10, but I had dependency problems. I may stick with it, though. Has anyone used GLFW for Linux? Has anyone ...

Quick sort in GLSL?

I'm considering porting a large chunk of processing to the GPU using a GLSL shader. One of the immediate problems I stumbled across is that in one of the steps, the algorithm needs to maintain a list of elements, sort them and take the few largest ones (which number is dependent on the data). On the CPU this is simply done using an STL v...

learning iphone game development

Hi There, What would be the quickest route for a developer to learn to game development on the iphone. Ive some .net winforms and webform experience but no experience with direct x or any graphics and game dev. In my spare time I want to learn these skills but would like to learn via the iphone. So Im just wondering what are the best re...

How do I set the opacity of a vertex in OpenGL?

The following snippet draws a gray square. glColor3b(50, 50, 50); glBegin(GL_QUADS); glVertex3f(-1.0, +1.0, 0.0); // top left glVertex3f(-1.0, -1.0, 0.0); // bottom left glVertex3f(+1.0, -1.0, 0.0); // bottom right glVertex3f(+1.0, +1.0, 0.0); // top right glEnd(); In my application, behind this single square exists a colored cube. ...

What disadvantages could I have using OpenGL for GUI design in a desktop application?

There are tons of GUI libraries for C/C++, but very few of them are based on the idea that opengl is a rather multiplatform graphics library. Is there any big disadvantage on using this OpenGL for building my own minimal GUI in a portable application? Blender is doing that, and it seems that it works well for it. EDIT: The point of my ...

Why does my colored cube not work with GL_BLEND?

My cube isn't rendering as expected when I use GL_BLEND. glEnable(GL_CULL_FACE); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); I'm also having a similar problem with drawing some semi-opaque vertices in front, which could well be related. Related: Why do my semi-opaque vertices make background objects brighter in OpenGL? ...

Why do my semi-opaque vertices make background objects brighter in OpenGL?

I am rendering 4 vertices (a square) in front of a colored cube. The vertices are colored white, but are blended at 0.5f. Related: Why does my colored cube not work with GL_BLEND? Please could someone tell me why the colored cube appears brighter when obscured by the semi-opaque square? Cube rendered without square in front: An...

Programs causing static noise in speakers?

Does anyone know a reason why my programs could be causing my speakers to output some soft static? The programs themselves don't have a single element that outputs sound to anything, yet when I run a few of my programs I can hear a static coming from my speakers. It even gets louder when I run certain programs. Moving the speakers around...

How do I render text on to a square (4 vertices) in OpenGL?

I'm using Linux and GLUT. I have a square as follows: glVertex3f(-1.0, +1.0, 0.0); // top left glVertex3f(-1.0, -1.0, 0.0); // bottom left glVertex3f(+1.0, -1.0, 0.0); // bottom right glVertex3f(+1.0, +1.0, 0.0); // top right I guess I can't use glutBitmapCharacter, since this is only ideal for 2D ortho. Simple enough, I'd like to re...