Why the hell is it not displaying?

Hi everyone,
I don’t know whether i am blind or what but i have twice the same code to initialise a rendering in one class it works and in the other my Canvas desperately keeps being black.
I have spend nearly two days reading my code letter by letter but i really can not figure it out !!

Here is the one that works.

http://www.ccp4.ac.uk/fr45/jogl/HegeScene.java

and here the one that do not

http://www.ccp4.ac.uk/fr45/jogl/HegeArch.java

If anyone see something obvious please give me a shout, this is driving me nuts. I have the feeling it is something basic but I seem to be blind to it

Got it ! ;D

I found the reason, but i am not really understanding why it does so. The fact is i place my “eye” at coordinate (x,y+20,z) and my look point at (x,y,z). Meaning that i look vertically downwards to my scene.

It seems that gluLookAt is suddenly very unhappy with it since my screen directly get black?

Even if i am thinking about how does the view Volume is built i do not know why it is behaving like that. Is it normal?

What are you using as up vector? If you’re simply using (0, 1, 0), that’s the reason why things stop working. gluLookAt calculates the cross product of (center - eye) and up. If these two are parallel, the cross product is undefined resulting in a bogus modelview transformation matrix…

Well sounds like you pointed out how blind I can be sometimes :stuck_out_tongue:

Thanks to point it out :wink: