opengl

Geometry -> OpenGL

Please help! =) I can't get the correct transformation in OpleGL. I have point3D - P(X,Y,Z), and projection matrix M, which equal to K*(R|T) where K - camera calibration matrix (R|T) - point (object) coordinate system transformation (R - rotation matrix, T - translation vector) As a result we have projected point as p = M*P I kno...

How do we get Indices for glDrawElements()?

I'm trying to use the Assimp library to import models to a rudimentary OpenGL application with VBO use. If I understand it correctly glDrawElements is one of the ideal modern ways to draw things. But how do we get that information from a generic import library? If you have specific Assimp library knowledge it's appreciated. -- What...

Transforming verticies with center point and scale factor?

My application is a vector drawing application. It works with OpenGL. I will be modifying it to instead use the Cairo 2D graphics library. The issue is with zooming. With openGL camera and scale factor sort of work like this: float scalediv = Current_Scene().camera.ScaleFactor / 2.0f; float cameraX = GetCameraX(); float cameraY = Get...

GLSL 3D Noise Implementation on ATI Graphics Cards

I have tried so many different strategies to get a usable noise function and none of them work. So, how do you implement perlin noise on an ATI graphics card in GLSL? Here are the methods I have tried: I have tried putting the permutation and gradient data into a GL_RGBA 1D texture and calling the texture1D function. However, one call t...

Using OpenGL glutDisplayFunc within class

I've created a C++ class (myPixmap) to encapsulate the work performed by the OpenGL GLUT toolkit. The display() member function of the class contains most of the code required to set up GLUT. void myPixmap::display() { // open an OpenGL window if it hasn't already been opened if (!openedWindow) { // command-line ar...

Cairo Matrix equivillant of GlOrtho Matrix?

Given that I do something like this: void glOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal); and the result is: http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xmlw could I achieve a matrix like this: http://cairographics.org/manual...

Billboarding a vertex array with GLSL?

I have a vector array of triangles which basically consist of a bunch of squares that need to be billboarded. Something that looks like GLfloat vertexpositions[60 * 3]; // [x,y,z] * 6 for each square, and there are 10 squares And after that, calling glDrawArray with the appropriate arguments to draw a total of 10 squares. Is it poss...

Displaying pixmap with glDrawPixels

I've written a small example program using OpenGL and GLUT to display a 2-by-2 grid of four colored squares using the glDrawPixels function. Unfortunately, I've found that: The colors in the grid are not being displayed properly; and When the glPixelZoom function is passed negative arguments to rotate the pixmap, nothing is displayed...

OpenGL - Using texture's alpha channel AND a "global" opacity level

I'm trying to get a fairly simple effect; I'd like my sprites to be able to have their alpha channels used by GL (that is, translucent across parts of the image, but not all of it) as well as the entire sprite to have an "opacity" level that affects the entire sprite. I've got the latter part, that was a simple enough matter of using GL...

OpenGL newbie question: what is back face culling?

What exactly is back face culling in OpenGL? Can you give mi a specific example with e.g. one triangle? ...

GCC C++ Linker section on FC13

I am trying to get OpenGL and Glut running on Eclipse Linux FC13. After spending two days on it, I admit that help is needed. On FC13 Eclipse, I see /usr/include/GL and /usr/include/SDL -- so the libs are there. I started Eclipse, and then tried to run a simple program on it, just like suggested here. However, two things were missing in...

Rotate object about 3 axes in OpenGL

I'm trying to achieve an object rotation about 3 axes by incrementing values of rotation angles for axes, and displaying those axes to make next rotation direction predictable for the viewer. But after a few rotations, only rotation about Z-axis is performed in accord with displayed axis. Is there a chance it can be done simply, without ...

how to upgrade openGL in visual studio?

I tried to set up glew and then devIL/openIL in visual studio but still have runtime and link error . I want to know it can be from openGL version of my visual studio or what? what should i do for upgrading my openGL? Thanks. ...

So I want to create a browser-based interactive realtime animation of the Earth and the other planets going around the Sun...where do I start?

Hello. I would like to create a browser based, interactive, realtime animation, showing the Earth as it goes around the sun, depending on the time of day and time of year. This animation should also (eventually) show the other planets in the solar system and the user should be able to pan around the solar system and see it from differen...

OpenGL - what does glDeleteTextures actually do?

Hi all, (Mac OS X, iOS apps) Q. What does glDeleteTextures actually do, on the above platforms? (The official documentation is... sparse, at best.) In terms of mem management, do the textures actually get removed from the video card? (Or at least their space set to reusable?) Cheers. ...

How to enable depth testing for the GL_SELECT buffer?

I am using the GL selection buffer to implement mouse picking. Unfortunately, OpenGL is returning hits in the selection buffer even for objects that are entirely occluded. For example, if there is a man hidden behind a wall, the selection buffer will include a hit record for the man even though he is not visible. Selection is implemente...

Peculiar behavior in OpenGL concerning Vertex Shaders and input vertices on core profile 330

using '#version 330 core' on NVIDIA, By using glBindAttribLocation(program, 0, "in_Vertex"); the input vertex works with an "in vec4 in_Vertex;". However, I noticed without the OGL function call in the client app, it still works. It appears to be 'the default first input variable'. Why? Should it be omitted or be explicitly connected to...

OpenGL: Selecting all dots from the current view area

Im using gluUnProject() to get the screen 2d coordinate in 3d world coordinate. I take 4 positions from each corner of the screen to get the area of visible objects. How to check which points are inside that "rectangle" ?, i have no idea about the terms or anything. The image below shows what that "rectangle" looks like: ...

How can i perform back projection in OpenGL?

How can i perform backprojection in OpenGL? Or how translate back projection model to forward projection model? ...

OpenGL - ortho Projection matrix, glViewport

I'm having trouble wrapping my head around how these work. First, in a 2d game the projection matrix should be set up as ortho with left, right, top, bottom matching the window, right? But when the window resizes, should I just change glViewport, not the projection matrix? And how do I keep the aspect ratio? Could someone explain the pu...