As I said in my previous post, I wanted to model the components. This is still a work in progress but I proudly present you the *new* lens and detector design. To construct them I wrote a class which take advantage of the pyglet batch system. God I love those batches... The two models are in fact made out of three new primitive forms (plus my old cube) which are cylinder, disk and hollow disk. I simply create them with appropriate dimensions and position and add them to the component's batch. That allows me to render the component in a single call !
This is especially interesting as I can therefore use the batch position when building the vertices, allowing me simple and fast manipulation of objects from my scene. This works by building the model each time that a position is altered, either by a call from the GUI or by user manipulation (through picking), the others batches aren't altered.
There is no lighting here it is just different coloring of the primitives. I will soon implement a GLSL lighting, I am currently testing it.
I also have a little color picking script that kinda work but that will wait a bit as I am not really happy with this solution. I think I will look more deeply into the ray picking technique maybe with bounding boxes to speed it up.
There is no lighting here it is just different coloring of the primitives. I will soon implement a GLSL lighting, I am currently testing it.
I also have a little color picking script that kinda work but that will wait a bit as I am not really happy with this solution. I think I will look more deeply into the ray picking technique maybe with bounding boxes to speed it up.
If I don't have too much work this week I will also design the source and I would like to include a mirror component into my project (I still have to figure out how to cut one end of the beam according to the angle of the mirror). Also still a long way to go...
Aucun commentaire:
Enregistrer un commentaire