Today no more images or videos as my program is once again under massive changes...
Anyway I implemented a GLSL Phong lighting using the wrapper from Tristam Macdonald [1] but I wasn't really happy about the "plastic effect" that was generated so at the end I used a simple diffuse shader to light my scene and will use the Phong one only for the shinny parts (glass from lenses, metal from mirrors or for crystals such as beam splitters...)
I played a bit with the color picking module to move the lenses but it is rather slow and imprecise at the moment so I think I will just change the pyglet variable button to allow a constant change at a definite rate when the GUI button is pressed for now and will come back at the picking module in a bit to interact with slicing planes.
I also fixed the bugs in my ABCD script and made it modular, depending from a dictionary of dictionaries containing all the parameters from the set-up, in which one can add or remove components. This modularity must now be implemented at the GUI level.
I finally managed to "cut" one edge from the beam, as it was my problem for me to implement mirrors. It was at the end really simple when using the clipping plane from OpenGL, it consists of the following procedure :
Push a matrix so that everything remains untouched
glPushMatrix()
Declare the clip plane, 4 is the number of points determining the plan, 0.0 and 1.0 directions of cut (can be -1 for inverse direction), here it is a 45° plan that can be moved using the d parameter
glClipPlane(GL_CLIP_PLANE0, (GLdouble*4)(1.0, 0.0, 1.0, d))
Enable it
glEnable (GL_CLIP_PLANE0)
Draw the model to be cut
batch.draw()
batch.draw()
Disable it and pop the matrix to not cut the others elements
glDisable (GL_CLIP_PLANE0)
glPopMatrix()
So now I have to finish to code all those changes and I will come next time with some images to show you how the project evolves.
[1] http://swiftcoder.wordpress.com/2008/12/19/simple-glsl-wrapper-for-pyglet/