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 … ?
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).]
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.