opengl

what is the actual difference between gluortho2d and glViewport

I made a window sized 800x600. I called gluOrtho2D(-400,400,-300,300); glViewport(400,300,400,300); and I drew a line from (-100,-100) to (100,100). I think I should see a line from (0,0) to (100,100), but I am getting the whole line. Why is this? ...

Delphi OpenGL test

i was reading the book Delphi Developer's Guide to OpenGL and this code should set the background color of the window, but it does not work, can anyone tell me what is wrong?? type TForm1 = class(TForm) procedure Form_Create(Sender: TObject); procedure Form_Destroy(Sender: TObject); procedure FormPaint(Sender: TObject);...

Loading PNGs into OpenGL performance issues - Java & JOGL much slower than C# & Tao.OpenGL

I am noticing a large performance difference between Java & JOGL and C# & Tao.OpenGL when both loading PNGs from storage into memory, and when loading that BufferedImage (java) or Bitmap (C# - both are PNGs on hard drive) 'into' OpenGL. This difference is quite large, so I assumed I was doing something wrong, however after quite a lot o...

How many 1024*1024 pngs can be load in openGL for iphone without having the app crash in the device ? ?

Approximately what's the maximum number of 1024x1024 32 bit .pngs which can be loaded at the same time with openGL in iphone ?, without risk of the app crashing. And .pvr ? a much higher number ? If I need a huge amount of textures in my game, is healthy to keep loading and calling dealloc to not overload the memory with all the text...

OpenGL ES as a 2D Platform

I've seen a lot of bandying about what's better, Quartz or OpenGL ES for 2D gaming. Neverminding libraries like Cocos2D, I'm curious if anyone can point to resources that teach using OpenGL ES as a 2D platform. I mean, are we really stating that learning 3D programming is worth a slight speed increase...or can it be learned from a 2D p...

Seamless Transitions of Scale over large distances (3D rendering)

What is the best mechanism for handling large scale structures and scenes? Examples being a continent with scale cities and geography, or infinity universe style planetary transitions. ...

OpenGL books are driving me crazy

I am starting to study OpenGL. But I cannot get started. I started with the superbible, but I could not even successfully compile even 1 program correctly. The examples I just copy paste and still they won't work. They just include things without saying what they are. and they say they will be covered later so how can I even test it? T...

Finding a point on a line

I know the start and end points on a line segment. For this example say that the line segment has a distance of 5. Now I want to know the point that has a distance of three away from the end point. Any idea how to do this with math? Start Point (0,0) End Point (0,5) Point I want to find (0,2) ...

OpenGL, remove sections from a shape

In OpenGL, how can one cut a triangle shaped hole from a square? making the hole transparent. I'm also using SDL, maybe it can be achieved with an SDL surface? ...

turn a line into a rectangle

I have a method that draws a line between two points. This works pretty well, but now I want to make this line into a rectangle. How can I get the points on the left and right side of each of the line points to make it into a rectangle that I can draw? It is almost as though I need to somehow figure out how to get perpendicular lines ...

Help with remote debugging under linux

Hey Guys At present we are developing a graphic app on a linux box using opengl. We have had a bit of trouble getting a decent debugger working. At present we use GDB via a ssh connection, but that is a tad painful. Next we have tried running DDD on the target platform, but we run out of space on screen. Next we have tried running a...

dealing with different coordinate systems

So I am doing a lot of math and I am running into different things where the coordinate plane starts at zero at the bottom and goes up higher on the y axis. However in my program it is the reverse. Zero is at the top of the screen and goes up and you go down the y axis. I have been dealing with this by updating my math equations to co...

Unable to link compiled shaders (GLSL)

I have a small class that allows me to load shaders and use them in my program. I am able to compile the shaders, but when it's time to link them, they just don't want to. Using glGetProgramInfoLog I got the following error log. I don't understand why it tells me that there are no program defined since the compilation worked fine... Ver...

How to Wrap a Commad Line Executable In a .app Package?

I wrote an OpenGL+GLUT game for Mac OS X that's currently launched through the command line. I'd like to make opening the game more user-friendly by putting it into a .app package, so regular users would be able to open the game like any other program. What's the best way to do this? ...

Modeling by example: by Thomas Funkhouser

Hi, currently Im working on a portion on this research paper "modeling by example" Have tonnes of problems now.So if anyone has knowledge on this paper, help is badly needed here. I am using java opengl for the programming. first of is that I am trying to draw a stroke. eg: 5*100 pixels stroke. How do I draw that using the mouse.Curre...

Merging multiple line segments

Hi, My program uses PyOpenGL (so it's Python) with psyco. I have around 21,000 line segments which I need to render in each frame of my render (unless the user zooms in, in which case line segments are culled and not sent to the card at all). This is currently taking around 1.5 seconds each frame to complete. That's just not good enoug...

How to create multiple context in openGL and how to give different mode to drawGL in iphone

Hi, I need to create cartoon image from original image, so i searched about it and i got GLImageProcessing source code. But it could do one thing at a time like brightness, hue, saturation etc. I think i need to apply different mode to single draw only then i could get cartoon image. Does anyone know that how to do this?. Or else any...

Which IDE should I use for this art project?

I have an art project that will require processing a live video feed to use as the basis of a particle system, which will be rendered using OpenGL and projected on a stage. I have a CUDA enabled graphics card, and I was thinking it would be nice to be able to use that for the image and particle system processing. This project only needs...

Reading 32-bit RGBA float values in GLSL

I'm trying send some 32 bit float data to a shader, but the results are erratic. If I test with full white (1,1,1,1) the values are all zero. This is my code for creating the texture: gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA32F_ARB, 512, 512, 0, GL.GL_RGBA, GL.GL_FLOAT, data); and reading from it in GLSL: uniform sampler2D u_t...

Rotation of camera used for perspective projection

I've just started playing with OpenGl to render a number of structure each comprising a number of polygon. Basically I want to perform the equivalent of setting a camera at (0,0,z) in the world (structure) coordinates and rotate it about the x,y and z-axes of the world axes (in that order!) to render a view of each structure (as I under...