Movie using opengl

Hello everybody ,

I want to make a movie using opengl . I mean a very simple one . What I’m thinkning of is a series of images that change in some details so it will look like a animation. Am I right … ? . What other things that I can do … ?

Thanks in advance

No problem, just glTexSubImage every frame & map it on a quad. Of course, you must have movie data…

Thank you very much for your quick responce M/\dm/
but could u pls explain it more to me ?

When you say make a movie, do you mean like playing a AVI file with openGL or do you mean creating animated objects with openGL to act out a movie?

Texture is just an array of (chars), so you can take your movie frame & create texture from it, (that’s slow, so better create texture & then just call TexSubImage for every fram to update part of it). More details at http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg2.htm
Render To Texture tutorial. The rest is how you’ll get your frame data & pow of 2 restriction, you’ll have to use TEX_RECT extension or account that yo’ll have to map texture coordinates from 0 to framewidth/texwidth on x & similary for y

Originally posted by nexusone:
When you say make a movie, do you mean like playing a AVI file with openGL or do you mean creating animated objects with openGL to act out a movie?

Hi nexusone,

I mean creating animated objects with openGL to act out a movie .

Frankly, OpenGL is probably a bit heavy for that. You might wanna try a 3d modeller such as 3d Max, or my favourite, Cinema 4D.

But, sticking to what you asked:
Yes OpenGL can do animation (Heck, Quake III is animation isn’t it? That uses OpenGL)
OpenGL just provides a set of commands for rendering textured, lit, and transformed polygons etc.

Of course what OpenGL can’t do is load models etc. Thats not to say you can’t draw models with it, but you have to store them in a way OpenGL can render.

How complex do you want your objects to be?
You may want to look at using a 3D CAD type program to create the objects then load them into openGL and move them around.

Just like in any movie you need a script in which directs how the objects should move.

The script will say at when, where and what object sould move during the movie.

This has been a common request, sometime need to sit down and write a simple example of doing scripted animation.

[This message has been edited by nexusone (edited 02-04-2004).]

Originally posted by nexusone:

Just like in any movie you need a script in which directs how the objects should move.

Hi nexusone,

The script is shown by the following illustration image

and the result I aim to have is something similar to

I wonder how can I save the five images and then display them one after another ?

Thanks in advance
for any help

THAT sort of movie is quite easy to do with OpenGL.
Madman posts are correct (but a bit cryptic for beginners maybe ).

If you have a very limited number of different frames like the example you showed, you can set up a texture for each, bind them at the correct times, and draw a textured quad on the screen.
See http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/015411.html for texturing, especially my post at the end.

If you have a LOT of frames to display, you probably can not set up a texture for each, it will eat up too much memory in the graphic card. So you set up only one texture, and then you use glTexSubImage2D to replace the actual texture data each time you need it. It can be fast enough for divx-like movie resolution and framerate.

I hope it will help you.

If I understand you, you what to know how to save five images, so I think you want to create the images with openGL?

Then to play them back in another openGL program?