opengl

How can I control my L-System pattern with my code?

I am working on a project to display and animate a tree growing. I am using C++ and OpenGL on this project. The tree grows to a certain number of branches, stops, and then the tree's leaves fall to the ground. I have decided to use Lidenmayer systems to graphically depict this because it seemed an easier alternative to creating a structu...

Android - Black screen while loading Activity with GLSurface.

With normal activities (and I define normal as activities as not using a GLSurfaceView for their drawing), when a new activity loads the old activity remains on screen while the loading occurs. However, when I load an activity that uses GLSurfaceView, the screen goes black while loading occurs. Loading is less than three seconds, so ...

Moving Shapes With Mouse using GLUT

Hello, We are new to OpenGL and GLUT programming and our teacher gave us a homework. The task is, there are 3 rectangles and 1 triangle. Each object have a different color (for easy selection) With these objects, we are suppose to do a home building. I drew the objects but I have big problems with moving. The first method and the easies...

how to draw a spiral using opengl

Hey guys I was starting to study OpenGL, and i wanted to know how to draw a spiral. I wrote this code: void RenderScene(void) { glClear(GL_COLOR_BUFFER_BIT); GLfloat x,y,z = -50,angle; glBegin(GL_POINTS); for(angle = 0; angle < 360; angle += 1) { x = 50 * cos(angle); y = 50 * sin(angle); ...

How to declare gluPerspective in OpenGL?

How can I actually declare gluPerspective? I mean I am drawing a spiral and I am setting z = -50 in the beginning and looping until the circle is complete. So what will be the declaration of gluPerspective? ...

how to see the 3d image in an opengl output

Hey, i was reading opengl superbible, they were telling i can use the arrow keys to rotate the output and get a 3d view of the whole image but i dont seem to get it........ Any new functions needed to be invoked? Thanks in advance ...

OpenGL + gtkglextmm + glade

Hello, when I am programming with "gtkmm", there is a widget "Gtk::DrawingArea". I can program that widget "by hand" (so write the code) or more elegant way is to use "glade" user interface designer, where I can do the same "graphically". Now I am trying to connect OpenGL with gtkmm through "gtkglextmm" library. In that library, there i...

Can Core Animations supports a 20 frames per second enlargement from 32 x 32 px to 120 x 170 px?

my background.jpg has 52 32x32 mini poker cards.png and when user touch on 1 card, it will enlarge to 120x 170 px. At any point in time, there is only 1 card being chosen (i.e, being animated) with at most 19 entire cards overlapped (120x170 / 32x32). Should i use Core Animation or do i have to learn OpenGL or use a library such as coc...

Getting started with OpenGL programming

Can anyone tell me how to start learning OpenGL? I have small knowledge of C++. Can I write OpenGL programs in C++? If yes, what are the required things to do? Please tell the steps to follow, as if you are saying to a kid. I'm very new to this concept :( ...

DirectX and WPF

Hi, I am trying to develop an application where the UI part is designed by WPF and the engine is developed using C++. I am trying to render a scene using DirectX in native code by getting the window's handle from WPF using WindowsFormsHost method. Though i do not get any error, no image renders on the screen. As far as the handle is c...

How to study opengl for beginners?

Hey guys, I was hoping to study opengl and infact i started studying from superbible. But their examples are too vague and they use functions without explaining some terms and functions and it is pretty hard to figure out............. Ne suggestions? ...

How to make an unboxed array of floats I can get a Ptr to

I am trying to do some work with HopenGL and I need a Ptr that points to a array of floats. From what I have read uarray and storableArray seem to be the way to go, in some combination some way. ...

Qt Jambi vs JOGL for java OpenGL development?

I'm planning on writing a simple application in Java which has a basic UI with a section of OpenGL graphics. In addition to this some kind of network access is required. Which one of these libraries should I use? What are the drawbacks and benefits of each option? I'd like the OpenGL coding be as genuine as possible, so that I could fee...

Mac OpenGL : No sound volume overlay in fullscreen

I have an OpenGL-based app that can run windowed or fullscreen in OS X 10.5. While in windowed mode, pressing the volume keys in the keyboard changes the volume setting (mute/unmute for example) and the OSX-drawn speaker icon overlay is drawn, as it happens with every other application. However, in full screen mode, pressing the keys d...

OpenGL texture loading issue

This is a very vague problem, so please feel free to clarify anything about this project. I'm working on a very large application, and recently a very perplexing bug has cropped up regarding the texturing. Some of the textures that we are loading are being loaded - I've stepped through the code, and it runs - but all OpenGL renders for ...

OpenGL lighting problem when rotating the camera

I draw buildings in my game world, i shade them with the following code: GLfloat light_ambient[] = {0.0f, 0.0f, 0.0f, 1.0f}; GLfloat light_position[] = {135.66f, 129.83f, 4.7f, 1.0f}; glShadeModel(GL_SMOOTH); glEnable(GL_LIGHT0); glEnable(GL_COLOR_MATERIAL); glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); glLightfv(GL_LIGHT0, GL_POS...

iPhone/OpenGL ES: How do I save the changes made to the texture?

I'm new to OpenGL and it is overwhelming. I'm playing with GLImageProcessing sample from Apple. It has few image processing filters like brightness, contrast and hue etc. Each time when I apply a filter, it starts all over instead of starting from previously applied filter. Any ideas? How do I save the modified texture or framebuff...

Display image in opengl.

I am fairly new to openGL. I have a 3d game that I have running, and it seems to go fairly well. What I would like to do is display an image straight onto the screen, and I am not sure the easiest way to do that. My only idea is to draw a rectangle right in front of the screen and use the image as the texture. It seems like there should ...

How to create fisheye lens effect by openGL?

Hello, I am trying to create lomo fisheye effect on an image using openGL. I am new to openGL, should I use cube mapping and fisheye projection? Is there any open source that I can refer to? Thanks. ...

What is required to compile and run GLSL programs?

I'm trying to run a GLSL example, but I can't. The error is in the line glGetShaderiv(vShader, GL_COMPILE_STATUS, &status); where the program exits. vShader is the file vPhong.glsl. The error returned is: 0(18) : error C0000: syntax error, unexpected $undefined at token "<undefined>" 0(18) : error C0501: type name expected at token "<...