PDA

View Full Version : problem with my program



queef
09-24-2011, 12:17 PM
Hello everybody,
I wrote a program using openGL and openCV - the program takes image from webcam an uses it as a texture to display it as a background in an opengl window. When done, I draw a 3D cube in foreground of the same window, and translate and rotate it around -> everything works fine, except when I move the cube towards and away from the camera. When moving away, the cube just disappears into the texture, when moving forward, it just becomes transparent at some point.. Its very strange, I tried to remove the texture and its still the same.. I believe its a very simple thing to fix the problem, but I am not so experienced with opengl, so I'll be more than happy to get some good advices to try to solve the situation. If somebody is willing to help I can also paste the code..

Thank you in advance fellow humans :D Your kindness shall be known to all forum members

V-man
09-25-2011, 07:41 AM
Sounds like you need to check out your near and far plane values for your projection matrix.

queef
09-27-2011, 04:01 AM
hey.. thanks for the answer - I already found the solution. I rewrote my program, made some changes and now it works just fine :)