I have a struct called Point (which happens to be a Python Extension) that looks like this:
struct Point {
PyObject_HEAD // Macro that expands to include a few more members
double x;
double y;
};
And I have another struct that will hold a bunch of these in two arrays:
struct Polygon {
int length;
Point **vertex...
Hi,
I have a QGLWidget which draws both 3D and 2D graphics (just like in Qt's overpainting example).
The thing is after I added drawing 2D graphics (moved code from paintGL() to paintEvent(), etc.), the widget stopped redrawing most of the times. It didn't redraw after resiging, after loading, and so on. So I put repaint() calls, it he...
I need to have a hemisphere in opengl. I found a drawSphere function which I modified to draw half the lats (which ends up drawing half of the sphere) which is what I wanted. It does this correctly.
However, I don't know what i should do with glTexCoordf to get the textures to map properly onto this half sphere. I'm really not great w...
My apologies for the long code sample. Here is my sample code:
#include <iostream>
#include <cstdlib>
#include <GL/glut.h>
using namespace std;
//#include "glutint.h"
/* Rim, body, lid, and bottom data must be reflected in x and
y; handle and spout data across the y axis only. */
static int patchdata[][16] =
{
/* rim */
{1...
I was going to use both JOGL and NetBeans platform. I have trouble embedding JOGL native libs. Maybe there is a simple way to reuse .nbms from NetBeans OpenGL Plugin? Or any other way to do this?
...
I'm having a difficult time figuring out the set of packages I need to get Haskell OpenGL working on Ubuntu 10.04.
Could someone please provide me with the list of APT packages and the list of CABAL packages I need to get to successfully start the OpenGL tutorial here?
...
Here is my issue, I have a scale point, which is the unprojected mouse position. I also have a "camera which basically translates all objects by X and Y. What I want to do is achieve zooming into mouse position.
I'v tried this:
1. Find the mouse's x and y coordinates
2. Translate by (x,y,0) to put the origin at those coordinates...
Hi All.
My question has a general nature. I would like to ask to you to share some ideas about how do you implement an animation support in your OpenGL application.
For example, if we would like in case of the some event fired from the user input, animate a Ball particle on the screen, how do we need organize our code ? :
Set Animati...
Hi All,
I'm writing a drawing program. I'm trying to take an ordered list mouse positions, and approximate a smooth Quadratic BSpline Curve. Does anyone know how to accomplish this?
Thanks!
...
Is there any way to calculate how much updates should be made to reach desired frame rate, NOT system specific? I found that for windows, but I would like to know if something like this exists in openGL itself. It should be some sort of timer.
Or how else can I prevent FPS to drop or raise dramatically? For this time I'm testing it on ...
Can I expect users to be able to run software that uses OpenGL 3.x?
Can Linux users who have open-source graphics drviers run OpenGL 3.x? I know that Mesa3D 7.8 only supports OpenGL 2.1.
I also know that OS X Snow Leopard supports some but not all OpenGL 3.0 features. I don't know the situation on Leopard.
I don't know the situation ...
I want to use matrix palette API(Like OpenGLES1.1 extension API GL_OES_matrix_palette) on mac(XCode), linux(CDT) and windows(VC++).
But, those API was not able to be found.
And I do not want to use shader. (Only fixed functions)
...
Hi,
I've been working on cross-platform 3D engine but atm I have version running natively on OSX and iPhone/iPad ( which in Simulator uses system GL library ). The problem I'm experiencing is that each texture is slightly shifted in both directions ( looks like just about one texel shift ) and I would look more in my code if I didn't se...
I'm interested to simulate the response of a structural building ( such as WTC before 911) under earthquake load. Actually I have all the Finite element things work out, and I have already calculated the displacement, velocity and acceleration response of the building under that particular earthquake load.
The one thing that I have prob...
I'm looking for simple beginner's tutorial for CUDA with OpenGL, and how to set the CUDA environment on Ubuntu.
Thanks in advance.
...
I'm trying to make a multi instance engine in C++ with a wrapper for C#.
In made the engine in such way that there is a function like CreateEngine that takes as a parameter the handle to the window or control on which I want the engine to be initialized.
In C# I made a custom control that initializes opengl for drawing and has a render e...
I want to draw car in my world.
but i have problem with lighting when my car rotate ,it seems light position change when car is rotating;
but when i draw simple cube with glut function it work correctly.
void mydisplay(){
glLoadIdentity()
glDisable(GL_LIGHT0);
glColorMaterial ( GL_FRONT_AND_BACK, GL_DIFFUSE) ;
glColor3f(1.0,1.0,1.0);
g...
Almost every game use keyboard as input. I have been searching for 2 days on this topic and found quite much about it. Keyboards have many disadvantages, but main problems I found are different layouts and second that if you are pressing 3 keys at time, it can lead to corruption (row-column error). If you don't know what I'm talking abou...
Hi all,
I hope someone can see what I've done wrong here. I'm trying to draw text using openGL. I have set up the 2D projection as follows, but the problem is that the text only appears when I draw to raster position (0,0) and the text appears in the centre of the window instead of at the bottom left.
All other raster positions are re...
What are some good graphics programming interview questions? These could be math questions, OpenGL questions, DirectX questions, shader questions, etc.
...