Wednesday, March 18, 2009

Mathematica

I switched from Maple to Mathematica last week. One of my small little projects is to store all the graphics algorithms I liked to visualize in the last few years in one file. A kind of condensed memory of the things I worked on. Here is an example for a simple Depth of Field effect (as already covered in my GDC 2007 talk):

Distance runs on the axis called Z value. So 0 is close to the camera and 1.0 is far away. You can see how the near and far blur plane fade in and out with increasing of the value called Range. The equation to plot this in mathematica is rather simple. In practice it is a quite efficient approach to achieve the effect.

Plot3D[R*Abs[0.5 - z], {z, 1, 0}, {R, 0, 1},
PlotStyle -> Directive[Pink, Specularity[White, 50], Opacity[0.8]],
PlotLabel -> "Depth of Field", AxesLabel -> {"Z value", "Range"}]

My plan is to develop a few new algorithms and show the results here. It will be an exercise in thinking about new things for me. If you have any suggestions on what I should cover, please do not hesitate to post them in the comment line.

5 comments:

Sam Martin said...

Hi Wolf - you should check out Maxima if you haven't seen before. Apart from being free, I actually prefer it to Mathematica and Maple. wxMaxima is a decent gui for it, and can handle interactive 3d plots and so on. Cheers, Sam

Unknown said...

Another free open source alternative to Magma, Maple, Mathematica, and Matlab to check out is Sage. www.sagemath.org

Anonymous said...

Hi Wolfgang,

Great to see you have been using Mathematica. I stumbled upon your example here and was wondering if you would be open to submitting it to the Wolfram Demonstrations site. I am a Wolfram sales rep in the Seattle area and am always interested in short examples I can point people to, especially game developers. If you're open to submitting or having us use your example please let me know. BTW, if you were at SIGGRAPH maybe you saw our booth. Thanks.

Doug McClintic
dougm@wolfram.com
206-718-7140

Royi said...

Any reason for the move?
What didn't you like on Maple and found on Mathematica?

Thanks.

Wolfgang Engel said...

I use this stuff on a Mac. Somehow I couldn't get my Maple license to run anymore on my MAC and the try out versions also didn't work. So I switched.