opengl

OpenGL: Is it acceptable to work with textures like 2500*2500 pixels?

Hi, The title says it all. Of course the texture will not be completely visible on the screen. And I can make it always draw just the visible part (With glTexCoord2f and then glVertex2f). (It is the big "level"-image, which I have to move around for a sliding camera). Notice this rendering has to be real-time in my game (game is written...

Opengl - How to draw smooth line with antialias

Hello all, I need to draw a smooth line in openGl and here is what I have done. glEnable( GL_LINE_SMOOTH ); glEnable( GL_POLYGON_SMOOTH ); glHint( GL_LINE_SMOOTH_HINT, GL_NICEST ); glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST ); glBegin( GL_LINE_STRIP ); for( UINT uiPoint = 0; uiPoint < iNumPoints; ++uiPoint ) { ...

OpenGL design practices for manipulating quads in 3 dimensions

I'm basically looking to see if I have the design of the following system correct in my mind, since I was handed a prototype as a starting point - but it approached the problem in a separate way than I would. The Application Very simple OpenGL application (will be written in Java) where we will have a window that contains a number of q...

3D text on QGLWidget in Qt 4.6.3

Hello. I'm looking for a simple way to draw 3D text on QGLWidget without using FTGL, FreeType, "render to texture" or framebuffer objects, i.e. using documented Qt 4 functions only, no additional libraries. Ideas? P.S. "3D text" means that letters are flat and have zero thickness, but can be rotated in 3D space. Think about "Star war...

Playing Card "3D" rotation in OpenGL - perspective?

Hi all, (Mac OS X, Cocoa, C/C++, OpenGL, somewhat mathematically challenged.) Project is a real-time (30fps) poker game, with a 2D view. The OpenGL view is set up for Orthographic projection using glOrtho; the camera is always looking directly down at the cards/table. To date, it's essentially been a 2D image composition engine. My pl...

OpenGL: Looking for resource for understanding the use of the vertex transformation sequence.

I'm looking into learning the basics of OpenGL only with v.3.0 methods onwards. I've reached the point of needing to use the equivalent of a "camera" [the basic goal is to 'look around with the mouse' in first person]. I did ask a specific question about it but it's probably further into what I should be learning (because I can't easily...

OpenGL render transmission in real time

Hi, I'm experimenting with developing a tool for remote OpenGL rendering, in C++. The basic idea is: The client issues OpenGL commands like it's a normal app Those commands are actually sent over the network to an external server The server performs the rendering using some off-screen technique Once done, the server transmits a singl...

How can I expose a uniform interface to a template class ?

Hi everyone, I have implemented a templated buffer class like this: template <class T, class Impl> class base_hardware_buffer : Impl { public: typedef const T& const_reference; typedef T* pointer; void push_back(reference r) { // Do some generic operation, call impl when needed // ... } pointer...

What's wrong with my project and unproject functions?

I'm using OpenTK for a game in C#, and it doesn't come with the project and unproject functions, which convert between world and screen coordinates. Well, it does, but they're deprecated and I couldn't get them to work. I took a shot at implementing them myself based on the opengl spec (see left hand menu, gluProject and gluUnProject, an...

pyglet silent exit with multiprocessing?

Pyglet exits unexpectedly and silently if I do this: from multiprocessing import Process import pyglet from pyglet.gl import * def myProcess(): w = pyglet.window.Window() pyglet.app.run() p = Process(target = myProcess) p.start() while p.is_alive(): pass It works as expected (opens an empty window and sits there) if I ch...

Algorithm to convert vertices of a triangular strip to polygon

I have an array with vertices representing a triangular strip. I need to convert it into polygon. There are many solution to do the reverse, but I failed to find one for the above problem. Or it could be too easy and I just cannot see it. Please help. OpenGL=compatible, see http://en.wikipedia.org/wiki/Triangle_strip Example: for thi...

OpenGL rotation vector from matrix

Ok, so here is what I have: -an abstract "Object" class which I made in a framework to use it as a base class for all 3D objects. -a Matrix4 member of this class which has the sole purpose of storing rotation info for the object. -some functions that multiply the matrix: for each of the yaw, pitch & roll rotations (both global and loc...

Help understanding this?

I have this algorithm that I found here, just one thing puzzles me about it: Clear the stencil buffer to 1. Pick an arbitrary vertex v0, probably somewhere near the polygon to reduce floating-point errors. For each vertex v[i] of the polygon in clockwise order: let s be the segment v[i]->v[i+1] (where i+1 will wrap t...

Fractal mountains using Sierpinski gasket in OpenGL

Hi, I'm reading a book on OpenGL, "Interactive Computer Graphics" by Edward Angel. In it, he asks you to modify a Sierpinski gasket algorithm to yield fractal mountains. To do so, it says to find the midpoint of each side, then perturb this location before subdivision. He doesn't explain at all how to "perturb" the location, and looking...

How to use glDrawVertex() function in ANSI C

Hello :) I'm learning OpenGL, and now usage of function glDrawArrays() but I always get Segmntation fault on glDrawArrays call, i'm doing something wrong? /*MESH*/ struct Mesh { GLsizei numVertices; GLfloat vertices[48]; } m; static void meshCreate(struct Mesh *mesh) { mesh->vertices[0] = 0.000000f; mesh->vertices[1] = -0.000000f;...

Avoid Flickering with LWJGL

In the context of a Java Rubik's Cube application I am trying to animate the cube actions performed by the end user. To do that I am just using rotations and many redraws as following: GL11.glRotatef(zRotate, 0.0f, 0.0f, 1.0f); the zRotate variable is icremented from 0 to 90 and I am performing redraws every 20 miliseconds. It works...

Installing OpenGL for Qt

Hi I just have installed Qt 4 on windows 7. I am now in a bit of a confusion How do I get to install OpenGL so that it works with QT? Is there an installer for OpenGL? Qt docs. say it has support for OpenGL, but when I include QTOpenGL and build, the compiler issues an error of "No such file or directory" Thanks for the reply in advan...

GLSL - Why are bitwise operators reserved? What is a good alternative to using bitwise ops (floating point ops that emulate bitwise)

I'm running some experiments in WebGL, one of them being an XOR effect fragment shader. For some reason all the bitwise operators are reserved in GLSL and cause a compiler error when used. Why are these operators illegal? What can I use instead of | in this case? ...

3DS Material -> OpenGL

Hello, How these fields in 3ds (not max) file translated to OpenGL material? MAT_SHIN2PCT MAT_SHIN3PCT MAT_TRANSPARENCY MAT_XPFALL MAT_REFBLUR MAT_SELF_ILPCT MAT_SHADING ...

What do I need to do to get this OpenGL superbible vertex shader to compile on OS X?

The OpenGL Superbible 5th Edition was recently released, and it documents OpenGL 3.3. Unfortunately, OS X only supports OpenGL 2.1 and GLSL version 1.20. The very first non-trivial vertex shader they give you fails to compile with the error message: ERROR: 0:5: '' : Version number not supported by GL2 ERROR: 0:8: 'in' : syntax error...