Depth of field
I was a bit frustrated that the depth-of-field was not so visible on the rendering of yesterday. So, here is an other rendering with an obvious depth of field.

You like the blog? Subscribe to the feed
I was a bit frustrated that the depth-of-field was not so visible on the rendering of yesterday. So, here is an other rendering with an obvious depth of field.

I just discovered a really cool tips about the registers in Vim. First of all, everybody knows and use differents registers when he code with Vim. You can copy in this register using
"ay
where a is the name of the register. You can cut and put the content in the register with
"ad
and paste it with
"ap
But one major drawback is that when you copy a new section to the register, the content is erased. To rearrange your code, it is not efficient at all. If you wan't to rearrange a text by appending section of text in the same register you can use an uppercase letter for the name of the register. So
"Ad
will cute the selected lines and append them to the register a.
For instance, let's consider the following text:
line1 line3 line2
You select the first line, and type "ad (the register a contains line1. Now you select the third line (well, the second one since the first was deleted) and type "Ad (the register contains line1\nline2) and you can past it at the begining of the line using "aP. Great, no?
Edit Sorry for the confusion between register and buffer
After two days of intensive rewriting of my raycasting engine, I'm quite proud of the results but this is definitly not the end, just a milestone in my development. The time to fix the documentation and the unit tests. I attached a rendering with 35 spheres, one light point, ambient occlusion and a camera with depth of field (this is not obvious on this rendering). I shoot 767 rays per pixels, so, in total 161 070 000 rays on this image (in ~17 minutes on a single-core 1.2Ghz laptop)

My new code is heavily based on the excellent book ray tracing from the ground up by K. Suffern. I also have plenty of cool stuff like fisheye camera. Next steps? Soft shadows and area lighting.
In the past weeks, I you followed me on twitter you probably a lot of news about a teapot as well as rasterization and raytracing algorithms. It was one of my last project I had to do for my courses at university.
It was a very interresting project, one of the project I enjoyed the most since 4 years. The fact you see or you can show something is also probably one of the major factor in this subjective opinion. Here are some rendering I achieved with the first release of the code (I continued to work on the code and the rendering is now a bit different and a lot faster)

I'll release my code as soon as my project is finished (so end of may or june) with the documentation and the unit tests. Obviously the code is not to use for any real rendering but can be, I think, a good entry point for anybody that wanna learn such algorithms.
Why does Java ignore the String class parameter in the Test class if I do not give the generic type in the instanciation !
package misc; import java.util.ArrayList; public class Dummy { private static class Test<E> { public ArrayList<String> mylist; } private static class Test2 { public ArrayList<String> mylist; } public static void main(String[] args) { Test mytest = new Test(); for(String str : mytest.mylist) { System.out.println(str); } Test2 mytest2 = new Test2(); for(String str : mytest2.mylist) { System.out.println(str); } } }
The line that do not work is
for(String str : mytest.mylist) {
and the error is
Type mismatch: cannot convert from element type Object to String
« previous entries - page 1 of 7