: To redraw the particular object inthe jpeg image on the opengl screen

i want to read the content of the jpeg image.
(i.e)
1.I have drawn monochrome wireframe cube on a black

background screen.
2.I have performed the rotation upon the 3D cube.
3.Using the "mkopengljpeg"utilities i have captured the

whole screen as a jpeg file.
4.Now i want to get only the position and value of the

pixels of the rotated cube which is in the jpeg image.(i.e)process

should be only done on the jpeg image which is captured using the

step3.
5.If i get these pixels then i should redraw it again in

the same position of the opengl screen from which it has already

caught and rotate the cube again.

          If i use textures,then the whole image will be bind as a 

texture and rotation will be done upon the the whole image not only on

the cube .

I have done the first three steps.Now my question is

    1.How can i do the step 4?
    2.Is there any possiblities to directly draw the cube from the 

captured image to the screen?.

You mean you need to draw a wireframe 3D cube which should result in the same image as seen on a given jpeg image? Tricky.
This is an image recognition task, not an OpenGL question, however…
First, jpeg is not a suitable format because its packing is not lossless.
Gradient algorithms to find vectors will not work well with it. (PNG recommended).
The resulting cube orientation is not unique.
Search on the internet image processing methods which are able to identify vectors and corners on image data.
You can use gradient algorithms which identify the line vectors, you probably need to do a smoothing of the image first. Intersect vectors you found and look if there’s a cube corner. Match cube corners and apply rotations in three axis until the image matches.
Could be difficult if you don’t know the frustum settings. Much simpler when this is in ortho mode.