Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/test/mandel.diderot
ViewVC logotype

Diff of /branches/vis12/test/mandel.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1947, Fri Jul 6 20:18:37 2012 UTC revision 1948, Sat Jul 7 04:34:11 2012 UTC
# Line 12  Line 12 
12    
13  // Global definitions  // Global definitions
14  input int reso = 2000;  input int reso = 2000;
15    input real escape = 4.0;
16  input int maxiter = 2000;  input int maxiter = 2000;
17  input vec2 center = [-1.2, -0.3]; // [0.0,0.0] for whole thing  input vec2 center = [-1.2, -0.3]; // [0.0,0.0] for whole thing
18  input real fov = 0.15; // 2.0 for whole thing  input real fov = 0.16; // 2.0 for whole thing
19    
20  // Strand definition  // Strand definition
21  strand mandel(vec2 c) {  strand mandel(vec2 c) {
# Line 24  Line 25 
25     update  {     update  {
26        z = [z[0]^2 - z[1]^2, 2.0*z[0]*z[1]] + c; // z = z^2 + c        z = [z[0]^2 - z[1]^2, 2.0*z[0]*z[1]] + c; // z = z^2 + c
27        iter += 1;        iter += 1;
28        if (z•z > 4.0) {        if (|z| > escape) {
29           // point has escaped; set color based on iteration           // point has escaped; set continuous color from iter and radius
30           real t = 11.0*real(iter)^0.2;           real t = 4.0*log(real(iter) - log(log(|z|)/log(escape))/log(2.0));
31           rgb = [sin(t), sin(t + 2.0*π/3.0), sin(t - 2.0*π/3.0)];           rgb = [sin(-t), cos(t), sin(t)];
32           rgb = ([1.7, 1.7, 1.7] + rgb)/2.7;           rgb = ([1.8, 1.8, 1.8] + rgb)/2.8;
33           stabilize;           stabilize;
34        }        }
35        if (iter > maxiter) {        if (iter > maxiter) {

Legend:
Removed from v.1947  
changed lines
  Added in v.1948

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0