Sticky Postings
June already, how time passes. Ok, so here comes the review of May. It seems I had forgotten to make the last todo sticky so it stays at the top of the entries. Strange that I didn't notice all month long.
Continue reading "To Do in June"
Friday, July 3. 2009
Today I continued with the rotational constructor. I gave modifiers the ability to also draw lines and vertices. Normally only objects can draw, but some time ago I added a facility to allow the modifiers to draw simple objects (and evaluate the selections). To that facility I added more functions. So now the rotational constructor can draw the profile line. The next step is to implement the selection function so the program knows which vertex was selected and then to add the ability to move the vertices. Then I will have to change the representation again so each line segment can be selected separately. That will be needed to allow adding vertices as many of my modifiers do it, by clicking an edge to split it into two parts. I hope to soon have a working first version. I will see if I need to extend it when I use it for the first few objects.
Thursday, July 2. 2009
I am nearly done with constraining the car. There were two functions missing to get the closest point to a line segment and a ray I implemented and I also added code to find the track segment closest to a supplied ray. Then I used the data to calculate a new point where the car is supposed to be and the down direction for the car (moves with the track). Only one small issue is left, I don't check if the car left the track yet. It isn't necessary to test the rest, the track would just seem to be infinitely wide. I even call that function already, but the results are thrown away. But for the first time in many weeks I saw my "game" running again. It still looks as ugly as ever and also behaved like it did before. But the new code didn't seem to slow down the car noticeably and it also didn't throw any exceptions which is good considering all the stuff I had to add in the meantime. So next week I will try to actually use the now available information and see what happens. If all goes well (as if that ever would happen) I will implement the last bit (the check if the car left the track) and then I can finally call this part finished.
Wednesday, July 1. 2009
I only looked briefly into the problem I had when changing the model. I even found the reason it didn't work. In the process to locate the problem I checked the color component, as this was not exhibiting the same kind of problems. I found out that the reason is, that the color shaders are never destroyed, whereas the shader model is always deleted. The second is wrong (I need the objects around for undo/redo), so the reason it stopped was only an indication of something else being wrong. I fixed the root cause for the assert which fired (so the GL-representation can now be deleted successfully when the object is no longer needed), but the code still has a bug (it deletes the object too early).
Tuesday, June 30. 2009
I was a bit lazy again today, but at least the OpenGL-part now handles the Ward BRDFs (by creating a Phong representation with 0.1 ambient, 0.7 diffuse and 0.3 specular). But because there was only one shader model I still have problems when switching the models. I will solve that and then start with the raytracer implementation.
Monday, June 29. 2009
Yesterday I have started to add the Ward BRDF as a shader model. I have finished the part I have to do in the model and even found a stupid bug which didn't occur until now as I only had one model and so didn't notice that I couldn't switch models. The next thing to do is to add a simple representation to the OpenGL part. Currently the program stops with an assert when I try to switch to the model as the OpenGL part has no clue of how to handle it. I intend to write a version for the GPU later, but first I will just use a simple Phong variant. For now it has to be enough to define it, I first want to see it in the raytracer. The results should be interesting, as this model has some advantages compared to Phong I am currently using. The first is, that it is a true BRDF(Bidirectional reflectance distribution function), that means it is physically plausible (I am careful to call something physically correct) as it is easy to make sure it never returns more light than is reached at a point. It also means that it is symmetric, a very important property for lighting (if you switch the light and the camera the material appears the same). The second is, that it contains glossy reflection and calculates those properties from the parameters it gets (diffuse and specular reflection and two factors for the distribution of normal). So I hope the results look much better than Phong I have been using to date.
Sunday, June 28. 2009
Today I didn't get much further on the rotational constructor as such as I had to change some support structures to make it possible to continue. The rotational constructor is the first modifier of the polyhedrons which uses its own selection object. All the others use one selection and it was sufficient. But the rotational constructor has a very special need, it is not interested in the regular selection of vertices, edges or faces. Instead it has to handle selection of the points and lines of the profile curve. To make that possible I had to break up some very old code. And that always takes a bit of time to think through and implement. Most of it should be working now, I think I am only missing one bit, the rendering should not show the vertices and edges. It currently does, but it shouldn't be hard to change.
Saturday, June 27. 2009
 Today I finished the implementation of the layered materials. Finally, this took a whole lot longer than anticipated due to a lot of bugs I have found. I hope the code is now better and I will never again have to do such a number fixes in elementary parts which were supposed to be correct. In the process of getting this stuff working I had to make some more changes. The UI of texture rectangle was not usable in the way I wanted to use it and so I changed it a bit. The current way is much better. Also there were still some bugs left in the layered materials as such. Even the UI still had a stupid bug. But now I think all is working and I can finally turn to a new feature.
Friday, June 26. 2009
I started to add a new constructor some days ago. This one will get a 2d curve and then rotate it around an axis creating a solid of revolution. I called it "rotational constructor" as I didn't find a better term (and checking what other 3D apps call it seems to prove the absence of a good name). The constructor is showing first results. I hard coded a default curve (a simple rectangle) and have started to implement the function which takes the curve and creates the surface. Currently the vertices are created and the edges are also there. So I only have to add the faces (and then the uv-coordinates) and this part should already be finished. The biggest issue will be to create the editor for the curve. But overall I hope it doesn't end like some of my other stuff in an endless series of changes.
Thursday, June 25. 2009
Still not finished with the constraining of the car to the track. I have continued with the geometry stuff and sure hope I slowly have all the necessary functions in the program. I am using my raytracer as a reference for those functions, as I am rather confident that they are correct. Today I added a class for line segments (bounded lines) and added the function to get the closest point on a line to a given point. The general case is implemented, the specializations for the ray and the line segment still need to be done.
Wednesday, June 24. 2009
I have also finished the second group of functions. And I think I am finished now, the other two groups don't need that modification. So now I could pull out the common code but I guess I will just leave it in and concentrate on testing the code. So I will try to actually use more than a layer for something useful.
Tuesday, June 23. 2009
And so here we go again. The first of the four functions now has been changed so refractions should work correctly with layered materials. I will also change the other three sets of functions. And I might make another change, as far as I see I can remove common code from all shaders which can be transparent and move it into one common function. I think it might be worth it.
Monday, June 22. 2009
I am still working on the cats paw. I need to move around quite a number of vertices. This is the thing I still need to work on, I need way too many time consuming small changes. I have missed some problems while I still had only a few vertices. The later you change those general problems the longer it will take to do so. But at least I have the impression I am on the right way. So even if it takes long I hope to create a nice cat.
Sunday, June 21. 2009
 I have today tested the refraction with a test image. You can see it to the left. The change I have made was to specify the filter color resulting from passing a length of the material which can be specified. To check the code and also if it is a useful interface I created six glass bars. In the top row I kept the thickness of the bars constant at 1cm, in the bottom row the thickness increases from 1cm to 2cm to 5cm. All six materials have the same design color, but in the first column the color results after passing 1cm of the material, the second after 2cm and the final column after passing 5cm. The results look ok, the first row shows how the filter color desaturates when the material is thinner than the construction depth. The second row shows, that the color actually is the same when the thickness and the construction depths match. So I am now rather certain that the refractions work correctly again. But I have also found a new little problem with the layered material. Again with the refractions, the direction of the ray leaving the material will not be correct when more than one layer is being used. I have an idea how to fix that problem and will try to implement it tomorrow to finally finish that stuff.
Saturday, June 20. 2009
I was quite lazy today, I modeled a bit on the cat (and crashed the program again), managed to move a camera in a way that I can't find the model (I will add a button to reset the camera to something sane) and then choose to not work on it any longer. But I did something else, I took some reference images. Nothing exciting, everyday stuff, like a drinking glass, a toothbrush, a vase and some bottles. But I hope that I soon find time to turn these images into models. Something I learned is, that modeling without a reference is really hard. And that finding good reference images is quite hard, as the useful ones are not interesting and so hardly anybody will upload them. I haven't decided yet if I should. If it turns out well, I will probably take more images in the future. I hope that using the images gives me more insight of how to take the images to be useful. And having a library of everyday objects ought to be useful.
|