opengl

normalized viewport

How do you write a function for a normalized viewport using openGL ...

How to use OpenGL and GLUT in Cygwin

I've attempted to follow the instructions from various places [1][2][3], but I keep getting link errors when attempting to use GLUT and OpenGL in Cygwin. Everything I try gives me a link error similar to: $g++ -Wall -pedantic -c -o triangle.o triangle.cpp $g++ -o triangle *.o -lglut32 -lglu32 -lopengl32 -o triangle triangle.o:triangle....

OpenGl surface&texture

I have: 3d pointset, wich calculated from 3d reconstruction process from N frame. sample frame snapthot (for example first frame when camera in (0,0,0)) 3d to 2d corresponds I want: create triangulation of point set and put texture (frame snaphot) on it. How can i create this triangulation + texture via OpenGL? I can't find any g...

Cuda Runtime API and driver API questions

I am new to cuda and graphics. I had several questions about cuda, hope someone will have proper answers: These are for driver API: -- What is the meaning of a cuda context? when i was reading cuda c book (3.1) i've learned that it is analogous to a process in CPU. I don't understand this, the actual host c code becomes a process in cp...

Core graphics or opengl for paint app?

Hello folks, I've just started to sketch the features of an app containing a paint module. Such module will work like most painting apps, like Brushes or Colors; you'll have a brush, a pencil and a rubber, plus a numbers of colors. I am wondering whether I should use OpenGL or CoreGraphics for the drawing routines. I am quite inexperienc...

OpenGL Shaders?

I'm writing a game in Java, LJGWL (OpenGL). I'm using a library that handles a lot of messy details for me, but need to find a lot faster way to do this. Basically I want to set every pixel on the screen to say a random color as fast a possible. The "random colors" is just an Array [][] that gets updated every 2-3 seconds. I've trie...

How can I scale at an anchor point using CGAffineTransform?

Edited to better explain my problem I am trying to perform a zoom operation using my custom view (not UIView). The view has translation, scale, rotate values. I use these as follows, between calls to glPushMatrix() and glPopMatrix(). - (void)transform { glTranslatef(translation.x + anchor.x, translation.y + anchor.y, 0.0f); //g...

HDR Rendering Pipeline DIfferences

What's the difference between a typical HDR rendering pipeline and a normal rendering pipeline? (i.e. bpp differences? Some additional post processing step?) ...

Preserving rotations in OpenGL

I'm drawing an object (say, a cube) in OpenGL that a user can rotate by clicking / dragging the mouse across the window. The cube is drawn like so: void CubeDrawingArea::redraw() { Glib::RefPtr gl_drawable = get_gl_drawable(); gl_drawable->gl_begin(get_gl_context()); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); ...

Finding the points of a triangle after rotation

I'm working on a (rather) simple 2D project in OpenGL. It's some sort of asteroids clone. The ship is basically an isosceles triangle of height H, with the base have a length of H/2. The way I've been doing it so far is simply storing the center point (CP) of the triangle and then calculating the final vertex positions on the fly. The ...

setting up opengl and glut on windows 7

I am new in opengl and glut. i have cygwin and netbeans installed on my computer working compatibly. I want to set up opengl and glur and bind those to my c/c++ projects in Netbeans? However, I couldn't find a way how to set up opengl and glut on w7. Any help ? ...

Splitting Selection algorithm

Hi all. I got a problem of selecting triangles in a model with a particular way. The problem is simple enough : User have a model (made from triangles) , on that model define some margine line (cutting line if you wish), and after based on array of the verticies of the margin line I would like to select one part of the model or another...

OpenGL: glLogicOp() color filling trick with different coloring?

I am currently using glLogicOp() with a cube, which i render twice: with glFrontFace(GL_CW) and then with glFrontFace(GL_CCW). This allows me to see which area of the other 3d object my cube is overlapping with. But i want to change the negative color to something else, lets say 0.5f transparent blue color. How this can be done? Sorry ...

How to disable blur effect on textures with OpenGL ?

I am using Texture-Mapped fonts in my OpenGL program. I have drawn very basic fonts in a bitmap (each letter is 5x7 pixels, white on black background). When displayed on a quad that makes more than a few pixels large, OpenGL is making some work to make the image smooth. Is there an easy way to temporarily get rid of that blur effect ? ...

What am I doing wrong that I can't render an image/texture properly in OpenGL?

I'm trying to render an image to the window. Super simple (or so I thought). No matter what I do, I always get this purple square. Some tidbits of my code: // load image from file, called one time on load: glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT); glEnable(GL_DEPTH_TEST); RgbImage theTexMap( filename ); glGenTexture...

glDrawElements drawing all objects connected

I can't figure out how to get glDrawElements to not connect everything it draws... //Draw Reds glEnableVertexAttribArray(vLoc); glEnableVertexAttribArray(cLoc); glBindBuffer(GL_ARRAY_BUFFER,positionBufferRed); glVertexAttribPointer(vLoc,3,GL_FLOAT,GL_FALSE,0,0); glBindBuffer(GL_ARRAY_BUFFER,redBuffer); glVertexAttribPointer(cLo...

Changing Resolution in OpenTK

I've been searching around for this, I've managed to find out out to change the size of our window, and how to change the resolution of the monitor. But I can't seem to find how to tell OpenGL where and how big my viewport is. Example: the game starts up in 400x300, and I expand the window to 800x600. I now have a 800x600 window, but o...

subclassing CCNode, blitzing image with glTexImage2D

I've subclassed CCNode and would like to blitz an image stored in a member GLubyte* buffer on each draw call. This results in a black square being drawn, and a sibling CCLabel node is now also completely black. So there are two issues: Why isn't the square white? I'm memset-ing the buffer to 0xffffffff. There must be something wrong w...

glDrawElements connecting all vertices...

I can't figure out how to get glDrawElements to not connect everything it draws... //Draw Reds glEnableVertexAttribArray(vLoc); glEnableVertexAttribArray(cLoc); glBindBuffer(GL_ARRAY_BUFFER,positionBufferRed); glVertexAttribPointer(vLoc,3,GL_FLOAT,GL_FALSE,0,0); glBindBuffer(GL_ARRAY_BUFFER,redBuffer); glVertexAttribPointer(cLoc...

4 Element Vector (3D Math)

Why is there a W term in a lot of 3D API's Vector class (i.e. Vector4(x, y, z, w) ) ? Are there math operations that absolutely require the W term? ...