Wednesday, June 25, 2008

Per-Face Selection

So after a single nights worth of work, I now have the ability to select individual faces from objects. I haven't implemented it in anything other than the 'BoxTrigger' but the way that it works now is fairly ideal. Each object itself can determine how it will report faces back during intersections. I just have it printing out which faces were hit but I will build a 'Face Shower Object' thingy tomorrow that will have wireframes around all of the faces. The great thing is, I have factored out a bit of the SelectionManager into the concept of a SelectionSet which holds all the information about the objects/faces/vertices that are currently selected which should be fairly reusable for selection groups if I ever decide to go down that route.

I should have the implementation finished up in the next sitting or two which will hopefully be soon. I am going to be using this to finish up the 6th step from my list in the previous posting [June 21, 2008] towards my goal of a simple test room. I will allow you to select a face and then a material can be applied to it. Internally, this will most likely break the object up by adding another child sub mesh on the fly to it (I will combine them when they share the same material) and then you can use the material browser to select a material to apply. This will actually go a long way towards creating the room. The face removal should be fairly straight forward once I get face selection finished. I also plan to add support for vertex selection as well which should also be fairly straight forward since I will provide a 'helper' interface that has things like 'checkVertexForClick' which will take a matrix, a vertex, and a 'vertex size' which will check to see if a box that gets projected into screen space where the vertex is would be hit by a particular mouse coordinate. Then it should simply be a matter of looping over the vertices and feeding them in to this helper class.

Once these two steps are done, the rest of it should be straight forward implementation things which just require me to have my butt in a chair for a while. All in all, things are going well. The editor is actually shaping up to be something useful. I might just get my work to review it [part of my contract with them] before I make an official release sometime. I will probably also end up taking suggestions and contributions from the community and integrating them into the editor when I get a chance. I still want control over this since I am using this for my own personal project but I will definitely integrate items when it makes sense to do so and release that back.

No comments: