Hy everybody (i’m italian, sorry in advance for my english!). I’ve got 2 problems:
- the italian prime minister (but i don’t think you can solve this problem).
- something wrong in my OpenGL application that i have to give my teacher next monday.
Well: i start saying that i’m using double buffering. i’ve got a simple cube inside a scene and several cameras from wich i look at this cube from different positions. I’ve got 2 positional lights focused on the cube. Here’s the question: when i change from one camera to another the position of lights changes without any order or reason. then i press again the button associated with this new camera and lights work well.
For example, let’s assume i have the following:
if(key == 1)
update camera 1 position
if(key == 2)
update camera 2 position
if(key == n)
update camera n position
In this code by pressing button “2” i change to camera 2 sight, then i call Display to draw the cube from that new viewpoint and then lights are added according the their fixed direction.
Unfortunately it doesn’t happen this way!
In fact when i press button “2” the cube is correctly redrawn with the new viewpoint but with wrong direction of the spotlight :mad: then i press again the same “2” button and everything is correct
Someone told me it could be a matter of refreshing of the image, someother a problem of double buffering…I only know that this is a problem that surely will arise at the exam next monday, so if you can help me i would appreciate it very much. If you need more details ask to me.
Thanks in advance ,