In one of my project I need to handle a 3d array of 3d points and I'm using boost multi array to store it. The problem is that when I allocate a large array, say 1000x500x500 a bad_alloc exception is thrown. With smaller array all goes ok. Here's the declaration:
I'm trying to optimize my raytracer, so I started to measure the execution time of my methods. I've noticed that there's a big difference in execution time depending on where do I declare the variables. Take a look:
I'm trying to implement deformations in my sphere tracer. For some reason they dont work very well for me, so I looked for some code that implement them and I found this haskell program, which I intend to experiment with. Trying to compile it gives the following error:
rt.hs:18:24: Couldn't match expected type `Eval b' against inferred type `()' In the first argument of `parMap', namely `rnf' In the expression: parMap rnf (map (maybe (0, 0, 0) toRGB24 . rayTrace scene 100)) rays In the definition of `colors': colors = parMap rnf (map (maybe (0, 0, 0) toRGB24 . rayTrace scene 100)) rays
The problem is I dont know nothing about haskell (nothing about functional programming), so can anybody help me make this program compile?
I'm trying to do something like a curved wall, made off of bricks (some OBBB's). I managed to put them in an arc of a circle path, but I fail to determine the angle by which I should rotate them to make them look at the center of the circle.
I'd appreciate any help.