Question about OpenGL camera; view blocked at (0, 0, 0)
I've been building a small scene with my students consisting of a bungalow made of scaled cubes with a large opening in the front. My aim was to "walk" into the bungalow and watch movies projected to three walls by moving the camera inside the bungalow (center at (0, 0, 8)). To my great surprise the camera's view was blocked at (0,0,0) and lower z values. Obviously, I was missing something in my assumption that a camera could simply be placed inside a scene.
Similarly, the way lighting works defies my intuition. First off, I couldn't place a light source inside the bungalow hoping that it would illuminate the inner walls, and second, when placed outside, light was shining thru the cubes as if they were transparent. Yet they clearly (npi) aren't when you point the camera at them.
Any help is greatly appreciated.
Georg
I would always recommend using jit.gl.camera instead of an attrui into jit.gl.render, it works a lot better as it has all the normal GL attributes to use.
hi georg.
the problem you are experiencing results from the fact that you are telling the camera view to position itself at the same point as it's lookat value (the default lookat value is 0 0 0). this breaks the camera view.
you can either update the @lookat values at the same time you update the @camera values, or a better solution (as mentioned above), use the new jit.gl.camera object. this object allows you to position/orient the camera view the same way you would any other gl object in a scene.
you can also try out the new jit.gl.light object, instead of the gl.render light attributes. you probably want to tryout a @type point light for the situation you are describing.
Thanks for the replies. That was very helpful!!