opengl

How expensive are OpenGL operations?

I'm curious how expensive functions like: glViewPort glLoadIdentity glOrtho are in terms of both the work done on the CPU and the work done on the GPU. Where is this documented? ...

Why does sign matter in opengl projection matrix

I'm working on a computer vision problem which requires rendering a 3d model using a calibrated camera. I'm writing a function that breaks the calibrated camera matrix into a modelview matrix and a projection matrix, but I've run into an interesting phenomenon in opengl that defies explanation (at least by me). The short description is...

Howto convert transformed coordinates to world coordinates in OpenGL?

Hello, everybody, I have a transformation set up in Opengl like this: glPushMatrix(); glTranslated(pntPos.X(), pntPos.Y(), pntPos.Z()); glRotated(dx, 1, 0, 0); glRotated(dy, 0, 1, 0); glRotated(dz, 0, 0, 1); //I use this to Render a freely placeable textbox in 3d //space which is based on the FTGL-Toolkit [1] (for TTF support). m_F...

Is there a matrix math library that is good to use alongside OpenGL to keep track of primitive co-ordinates for collision detection

Matrix math library that is good to use alongside OpenGL to keep track of primitive co-ordinates. Does such a thing exist? Is this the best way to track my objects for use in collision detection? ...

How to render non trivial particles in OpenGL.

I have a particle system where the positions and various properties are stored in a vertex buffer object. The values are continuously updated by a CUDA kernel. Presently I am just rendering them using GL_POINTS as flat circles. What I am interested in is rendering these particles are more involved things like 3d animated bird models f...

glaux.lib in Visual Studio 2008

I'm porting some code from Visual Studio 2005 to Visual Studio 2008. Can i use the glaux.lib found in Visual Studio 2005 found in \PlatformSDK\Lib folder in Visual Studio 2008 ? I don't want to change my APIs and have the requirement to use glaux.h as said here , does this work looks like glaux.lib is deprecated. Instead link ...

Skybox seams in OpenGL

Can anyone tell me out how remove the seams in the skybox implementation I have here: source code: http://openglviewcontroller.codeplex.com/SourceControl/list/changesets I've been trying GL_CLAMP_TO_EDGE to no avail. ...

How to Draw some sample images on the iPhone?

I just want draw some simples circle on the iPhone, I think it is too complex to using openGL doing this sample job, but I find that the UIB don't have something like canvas, any suggestion on drawing sample images on iPhone? thx a lot. ...

glDeleteTextures, leaking?

Hi I found a rather disguting behaviour of glDeleteTexture, deleteing only parts of the aqcuired memory (GPU side and as Textures get saved back for the sake of speed in RAM), which in my case, is a showstopper bug, my program eating up all memory. I don't want/require you to read all of the code, it's just a demo, I'd rather know how ...

Cubemap from panoramic horizontally wrappable image

I'm trying to write an algorithm to generate the "ceiling panel" from a horiontally wrappable panoramic image like the one above. Images 1 to 4 are a straight cut out for the walls of the cube but the ceiling will be more complicated as I assume it needs to be composited from parts 5a to 5d. Does anyone know the solution in pseudocode?...

3d geometry: how to align an object to a vector

hello, i have an object in 3d space that i want to align according to a vector. i already got the Y-rotation out by doing an atan2 on the x and z component of the vector. but i would also like to have an X-rotation to make the object look downwards or upwards. imagine a plane that does it's pitch yaw roll, just without the roll. i am...

OpenGL Texture Transparency

I'm using C++ and OpenGL to make a basic 2D game, I have a png image with transparent areas for my player. It works perfectly on my laptop and lab computers, but on my desktop the entire image is mostly see through, not just the areas that are meant to be. What could cause/fix this? Here is the code I've used and is the same on all mach...

Problem with method in a class when called from another class

Hi, I'm writing a simple scene graph to hold some objects so I can control the rendering and drawing of these objects in OpenGL. I have two classes, one called GameObject which defines the objects with certain parameters such as position and velocity as well as how to draw the object. It has a method called update() which is used to ca...

Delphi OpenGL Drawing

I'm setting up my window like this: glMatrixMode (GL_PROJECTION); glLoadIdentity (); glOrtho (0, form1.Width, form1.height, 0, 0, 1); glMatrixMode (GL_MODELVIEW); glDisable(GL_DEPTH_TEST); And my drawing routine looks like this: tempdist:=0.3 / distance(i,0,1,2); xunit:=1 div 90; zunit:=1 div 74; glBegin(GL_LINE_LOOP); case players[i...

Limit Speed Of Gameplay On Different Computers

I'm creating a 2D game using OpenGL and C++. I want it so that the game runs at the same speed on different computers, At the moment my game runs faster on my desktop than my laptop (i.e. my player moves faster on my desktop) I was told about QueryPerformanceCounter() but I don't know how to use this. how do I use that or is there a b...

A question about openGL and butons on iPhone

Hi, I'm new to openGL and I have a question, I'd like to make a "video wall" type application, where multiple images are mapped onto a cylinder, I'd like to then enable each of these images as buttons.... Is this possible? I'm not sure if objects in an openGL space can act as buttons.... Thanks ...

How to dynamically construct 3d object by adding paths? (Java; OpenGL)

So I have some path generator which now works like this http://www.openprocessing.org/visuals/?visualID=2615 (There is source; WQRNING - JAVA APPLET) I want to create some 3D object using paths I generated so it locked in one of perspectives similar to what I get now in 2D. So how do I dynamically construct 3D object by adding paths...

How would I make an app that would smudge selected pixels of a UIImage/UIImageView

I have a UIImageView that I want to manipulate within the touchesMoved method that smudges pixels around the UITouch passed in the set. I want it to act like the smudge tool in Photoshop and be fast. (I do know that even the hotoshop one is a little laggy but I want it to be as fast as possible) I have almost no knowledge of CGContext or...

Opengl ES - drawing a plane of multiple vertices

Hi Using Opengl ES for Anroid we’re facing a problem when drawing a square with a texture. They look fine from a distance, but when getting close to the model the texture screws up. We believe this is caused by the fact that the model only consists of four vertices: float[] coords = { -1, 1, 0.0f, 1, 1, 0.0f, -1, -1, 0.0f, 1, -1, ...

Visual C++ 2008 runtime error-- debug vs release exe problem?

Hi everyone, I have a Windows executable (native, not .Net) project that I'm trying to pass along to a new team member. It's a graphics modeling tool that uses the Qt widget library and OpenGL. The project runs fine on my box but when we buld and link it on this new member's machine and he tries deubugging it, here's what he sees (not...