Sunday, November 30. 2008
Today I didn't work a lot on the program. I was busy with other stuff, I created a new image for my mouse pad, assembled the first parts of my new computer (no, I still don't have it, the processors and the mainboard are currently out of supply) which I had to get separately for "logistic" reasons and took some time to practice my Japanese (which is still terrible), but I try to improve it everyday since I discovered anki in October, which helped me to get back to practicing. But I had ran into a bug yesterday when I tried to make the "blossom" a bit nicer. I looked briefly into it and the first thing I found was a missing "assert" in a function. I was telling the geometry that it could use the data from the old face with some slight changes. The problem is, that that is not even possible, the old face was a quadrangle, the new face is a triangle. Something in the change geometry is wrong and it doesn't detect that the face has been changed. But the old function which got called also trusted the parameters, at least in debug mode it shouldn't do that. I found it, when I saw that the new face was supposed to be concave and had three edges. A triangle is always convex, so there was obviously some bug. Now an assert at least warns be before it happens and next time I start looking at a different place from the start. The next thing is to find the real bug. I think I know which function doesn't work right, but haven't looked into it and debugged it.
Saturday, November 29. 2008
I have found and fixed the problem with rendering the object. The problem was hard to find and simple to fix, it was a wrong "-" before the angle to rotate the object being aligned to get a proper bounding box.
Friday, November 28. 2008
 With a lot of debugging and writing new stuff in between I slowly get the parts of a blossom ready. For now I have only created the base object for the sepals. I used the new circular arrangement to put 10 of them together. The final object will use two circles with 5 parts each, the outer being a bit bigger. There are also some problems with my modeling I will solve soon.
For the blossom I will need to align parts in circles. I could have done it manually, but I didn't want to, so I wrote a specialization of an existing object. The "linear arrangement"-object I have could already arrange objects in arbitrary forms, the only limitation was, that the position of an object can be defined by a matrix from the one immediately preceding it. But especially in plants and also in buildings it is not a rare thing, that the same kind of object is put together multiple times in a circle. As it is not exactly easy to calculate the matrix needed to get to a desired result, so I created the new object which directly gets a radius and a count and does the rest. I still have a bug somewhere. The raytracer cuts the object slightly, that happens, when the extents are not calculated correctly. That I will have to search for that tomorrow.
Thursday, November 27. 2008
Now that I finally have correct movement data (see last weeks entry) I can use that to find out, why the matrix didn't work. What I already know is, that the heading of the car is correct and that the incremental movement is also correct. So it seems, that the way I combined the matrices was wrong. I will have to look into it and then hopefully see, where the problem is exactly. Even if I have a valid way for the movements, I still want to get the matrix expressions to work. They are the right way and only if I understand, how Java 3D uses its matrices I will be able to use it fully. Also the more information I have to combine the more important the matrix expressions will become.
Wednesday, November 26. 2008
As I wrote yesterday I had a problem to store the models I had changed with the Free Edit Modifier. I had to look for it for some time and finally found the problem. It seems that I was sloppy with the signature for a function of my streambuffer-class which compresses the files transparently for the rest of the program. Why it worked at all I am not certain, but at least when storing very long strings it didn't work correctly. While looking for that I also found a small problem which made storing polyhedra slow. When storing I have to build an internal list of all objects to write an object-catalog at the beginning of the file. That is done by running through the storing-functions twice, the first pass just collects the objects. The storing-functions have a parameter which shows if it is called for the first or the second pass. The geometry objects of the polyhedra didn't use that hint and build the strings to store the vertex-, the edge- and the face-list. That is a complete waste of time and so I deactivated that for the first pass.
Tuesday, November 25. 2008
I have added the rectangle selection to the Free Edit Modifier. It again was a bit harder than anticipated, as I first had to look for a bug as the rectangle was not drawn. It wasn't a big problem, but it still took some time to find. After that I continued at the blossom and I think it looked promising. Then I ran into a bug when storing the file. I have fixed that now, but there is still a problem, it seems I can't store the model correctly, it just stops in the middle when exporting the geometry object. So tomorrow I will first have to find out, why it won't work and then continue modeling.
Monday, November 24. 2008
So I did indeed pick up modeling the blossom again. I post no image as there is nothing much to see yet. I experimented a bit with the free edit modifier to rotate some vertices and it works quite well for that purpose. But I missed a feature badly I choose to ignore, I haven't implemented rectangle selection and I fear I need to add it. It shouldn't be a big issue, but it will help me quite a bit. When bending the leaf which will form the bottom of the blossom I saw, that I needed to split the quadrangles I have created to get a better form. So I threw away the changes I made with the new modifier and first used the edge loop modifier. It works like a charm, not to compare with the tedious way I had to do it in the past using the add edge modifier adding individual edges. I also found a ridiculous bug. I added a camera so I can use my main view to select what to change and to judge the results of operations and tried to use an orthogonal view looking from the side at the leaf so I can properly bend it. As I need an orthogonal view I thought I should create an orthogonal camera (as opposed to my regular perspective cameras). As I found out, I can't open an orthogonal view for an orthogonal camera. A regular view would be orthogonal as it uses the camera settings to look at the model, but I still think it is stupid to not being able to do what I tried. I will have to look into the code to see, why I had to add that limitation and if I can remove it.
Sunday, November 23. 2008
I have finally implemented all the details for the free edit modifier. In the process I created some new facilities which will probably see uses later on. I also developed some more ideas to extend the free edit modifier, for example I would like to be able to also delete parts and I would like to be able to define a grid for the plane I work in. Deleting parts would be a cool feature and I can already see that I will miss it when I use the modifier. But the problem is, that it would be considerable work in the geometry change helper class I used to implement the modifier. Most of its operations are tuned to adding elements and the two split operations, one for edges, one for faces are the only real changes to the existing structure. Moving of vertices was rather easy to implement as it hardly changes the structure, the only special case to watch out for is when two vertices are fused. But removing elements would probably mean a lot of changes. I will implement that, but not now. The second thing would be easier to implement. Limiting the angles new lines can have, so I could draw exactly orthogonal would be quite easy. The second part, to make vertices snap to a grid would be much harder. The problem lies in the definition of the grid. As I am not bound to only use planes with normals parallel to the coordinate systems axis, I don't see a good way to define the grid. Perhaps I will find one in the future. But for both features, not now, this thing took nearly the whole month already and I really don't want to continue to work at it for now. Next is testing it, first with the blossom it all started with and then I will try to model a cat.
Saturday, November 22. 2008
Now the free edit modifier also knows how to handle the transformations which can be applied to an object. As often once you sort out your coordinate systems it is not hard. Now only the manipulation of the camera is missing. I have started to add some code to evaluate the selection to find the new plane I want the camera to show and to calculate the center of the image the camera will show. Also I had to make quite some changes to old abstractions to make it possible that an editor can evaluate key strokes. I never really needed it, but I guess now that it is possible I will use it for other editors as well. And finally I had to create a facility where I can query the current camera. That last bit is not finished yet, I have a context object I can use to query camera related information. But this time I have to be able to change the camera and that is not allowed in all views. Some have a fixed direction and then I won't allow changing the camera at all. The problem is, that the context object knows a lot about the current state of the UI and has access to the OpenGL renderer which knows which camera is active, but it doesn't know if it can allow to change the camera. For a small feature, that are a lot of changes to old abstractions. I haven't checked, but I think today I changed about 5 classes which were unchanged for a considerable amount of time (two or three years would be my guess, some even longer). So a lot of new abilities and I hope to finish this thing any day now.
Friday, November 21. 2008
I started to add the missing transformations. There are still problems, as I have to define which of the stored points are in object- and which are in world-coordinates. The problem is, that you end up destroying things you just fixed when you change a value from one coordinate system to the other. So it takes time to make the changes. I hope to finish them tomorrow and start on the final part of this modifier.
Thursday, November 20. 2008
Today I finally did what I didn't want to do, I dropped the matrix stuff and went to the simpler way to control where the car is by using the combination of position and relative angle. That can be set together to form the matrix I need to position the car-object. And after trying forever to get something working, this solution indeed does work. The car moves as intended, top speed is too slow and the turn radius is also too small, though. So now I hope I can finally find out, where I went wrong with the matrix code I created before as I can now compare the two matrices when they start to develop in different directions. Then I can look into where I limited top speed and limit the turn radius to sensible values.
Wednesday, November 19. 2008
I have finally finished the selection mode as well. Now only one big area is remaining, the ability to reposition the camera so that the work plane is aligned to some structure or selection of the model. But first I have to fix another problem I knew about for some days but have chosen to ignore. Currently the editor for the Free Edit Modifier only works when the object is at the origin of world space. I have ignored the matrices which can be in use for the element. I have done that, as it is hard enough to get this editing stuff right without getting confused by the matrices all the time. Additionally in my experience it is easier to get matrix stuff right when you have a working program where only some transformations are wrong.
Tuesday, November 18. 2008
I continued with the selection mode. The new functions in the mouse handlers are added and should be called now. The selection of vertices, edges and faces with the ability to toggle or deselect should also work now. I just couldn't test it, if you used VS 2008 you probably know of the problems it sometimes has with its PDB-files. It seems to be rather good in damaging them. Well, it refused to attach the debugger as something was wrong with the PDB, so I need a rebuild to test the new stuff. The program also should be able to discern, if any existing object was clicked and branch into a special handler if nothing was found. This branch will then set the plane origin which I also use as the center of rotation. So that should soon also work. The last thing to add is handling rectangle selection. That shouldn't be hard either. So I hope to finish this thing soon.
Monday, November 17. 2008
Today I have a good excuse for not having done much, I ordered parts for my new system. And had troubles with a stupid shopping system. The new box will be a quad core Opteron with two processors and 8GB RAM. So I will have to do a lot of parallelization to get my raytracer to take advantage of it. I will also try to make the editor take advantage of that power. I have some ideas already, but I have to see, how much they get me and if the necessary code makes the program harder to debug or use. Most ideas should also benefit me on my single core laptop, I plan to e.g. move the creation of the structure needed to render polyhedron to a helper thread. That should make the program quite a bit more responsive at the cost of not seeing the result in real time but at a short delay. Apart of that I also started on the mode switch. Not much, but at least I started. I hope to get the selection stuff into the program tomorrow. They only thing a bit more complex is the selection of an arbitrary point as the plane origin.
|