If for example I create an array of pixels, like so:
int *getPixels()
{
int *pixels = new int[10];
pixels[0] = 1;
pixels[1] = 0;
pixels[1] = 1;
// etc...
}
glTexImage2D(..., getPixels());
Does glTexImage2D use that reference or copy the pixels into it's own memory?
If the answer is the former, then should I do th...
I can't find a clear answer to this question with all my googling.
If I want a web applet, is there a library in Java that takes advantage of the hardware accelerated graphics drivers on the client's machine, as in OpenGL and directx? I'm picturing writing some driver detection code before the applet launches to detect 3D graphics capa...
Hi,
I'm using a 3rd party DLL which uses OpenGL. Right now that 3rd party does not work correctly as the display does not refresh correctly. I came to suspect that the OpenGL library isn't correctly installed or may be outdated.
Is there a way to update the OpenGL library on windows? Is there like an official site which will hold the c...
Hi everyone!
I use OpenGL+GLUT for simple application, but I can't handle a "Tab" key press. Does anybody knows how to handle pressing of Tab key ?
thanx
P.S.:Mac OS 10.5.6, GCC 4.0
Solution
void processNormalKeys(unsigned char key, int x, int y){
if ((int)key == 9) {
//tab pressed
....
}
....
}
....
int ma...
Currently I am loading an image in to memory on a 2nd thread, and then during the display loop (if there is a texture load required), load the texture.
I discovered that I could not load the texture on the 2nd thread because OpenGL didn't like that; perhaps this is possible but I did something wrong - so please correct me if this is act...
i currently writing a program to implement Marching Cube using C++ and Opengl.
However, my best reference is only from http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/
in the web, the provided codes are written in C.
my problem here is that i don't understand the triTable and edgeTable
and how they are related.
can anyone h...
Hi,
I'm working on an assignment which is to simulate the beginning of the universe using C and OpenGL/GLFW.
I'm pretty new to C and also to Xcode, which is not helping at all. I've overcome my silly compilation problems and the code is finding GL/glfw.h ok. When I compile and run I receive a "Visualisation [name of the project] has ...
I'm having a problem getting accurate primitive colours when I'm using multi-texturing elsewhere in the scene. Basically, I have some lines and polygons that I am trying render over a video texture (I'm using 3 stage multitexturing to create the video texture)... Anyhow, I know the problem is not alpha related... In fact, I know that in ...
I need to draw 3d projections and i am using opengl wrapper for JAVA.
Problem:
- how to set view point in java opengl (for examle i want to my program to draw object on screen like i am looking at that object from (0,0,0) )
- how to set perspective point(point in 3d where look is heading to, for example i want may progra...
From My last question: Marching Cube Question
AndreasT has explained to me how the triTable and edgeTable works.
I really can't thank him enough.
However, i am still unclear as in:
how to create imaginary cube/voxel to check if a vertex is below the isosurface?
how do i know which vertex is below the isosurface?
how does each cube/vo...
I have a UIImageView that can be dragged around with a finger. It is sized to an image in it, such as a ball or square. If the user accelerates very quicker, I'd like to trail the object with a blur of itself to give the appearance of going fast. Like what happens with warp speed. I also have a swoosh sound. I'd like the sound to l...
I've created this basic 3D Demo using OpenGL/SDL. I handled the keyboard callback so I can "strafe" left and right using 'a' and 's' and move forward and backward using 's' and 'w'.
However, I would like to now make it so I can control the direction my camera is "looking" based off my mouse movements. Just like in a FPS shooter when...
I'm writing a simple game and I'm going to have the mouse control the camera (using GlutPassiveMotionFunc).
I'm going to pitch and yaw based off the mouse difference between callbacks, however I think it would be a good idea to "force" the mouse back to the center of the screen every time they tried to move it. This way their cursor wo...
I'm coding a basic OpenGL game and I've got some code that handles the mouse in terms of moving the camera.
I'm using the following method:
int windowWidth = 640;
int windowHeight = 480;
int oldMouseX = -1;
int oldMouseY = -1;
void mousePassiveHandler(int x, int y)
{
int snapThreshold = 50;
if (oldMouseX != -1 && oldMouseY !...
Hi,
I'm wanting to rotate a gluSphere around a fixed point in a circular motion, like a planet going around the sun.
Would it be best to use glRotatef or glTranslate?
Cheers!
...
Yesterday I asked: How could simply calling Pitch and Yaw cause the camera to roll?
Basically, I found out because of "Gimbal Lock" that if you pitch + yaw you will inevitably produce a rolling effect. For more information you can read that question.
I'm trying to stop this from happening. When you look around in a normal FPS shooter ...
How do I get the OpenGL color matrix transforms working?
I've modified a sample program that just draws a triangle, and added some color matrix code to see if I can change the colors of the triangle but it doesn't seem to work.
static float theta = 0.0f;
glClearColor( 1.0f, 1.0f, 1.0f, 1.0f );
glClearDepth(1.0);
glClear( GL_COLOR_B...
I'm sure that there is nothing wrong with my project. Because I have tried it on my ex computer with visual studio 2005 and windows xp pro, and it works error-free.
I can compile my project. There is no errors on build phase.But when I try to run my project it says "*.exe has stopped working".
Then I runned it on debugger mode. I saw t...
My jogl applet screen is blank. I have this for my paint code:
public void paint(Graphics g){
canvas.update(g);
}
if I add g.fillRect(0,0,50,50); to it it'll draw the filled rect, but still not the jogl stuff.
...
Hi,
I have a simple OpenGL application where I have 2 objects displayed on screen:
1) particle system, where each particle is texture mapped with glTexImage2D() call. In the drawEvent function, I draw it as a GL_TRIANGLE_STRIP with 4 glVertex3f.
2) a 3D text loaded from an object file, where each point is loaded using glNewList/glGenLi...