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

SCM Repository

[diderot] View of /branches/vis12/test/vr.diderot
ViewVC logotype

View of /branches/vis12/test/vr.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 39 - (download) (annotate)
Thu Feb 11 16:58:32 2010 UTC (9 years, 6 months ago) by jhr
Original Path: trunk/test/vr.diderot
File size: 634 byte(s)
  Parser hacking
// vr.diderot
//
// volume rendering example in Diderot
//

input string dataFile;		// name of dataset
input real stepSz;		// size of steps
input vec<3> light;
input int wid = 640;
input int ht = 480;

image[3] img = load (dataFile);

field#1[3] F = convolve (bspln3, img);
 
actor RayCast (int row, int col)
{
    vec<3>	dir = (real(row), real(col), 0.0);
    vec<3>	pos = (0.0, 0.0, 0.0);
    real	t = 0.0;
    real[4]	color = (0.0, 0.0, 0.0, 0.0);	

    update
    {
	vec<3> pt = pos + t*dir;
	t = t + stepSz;
	vec<3> g = (D F)@pt;
	color = over(color, phong(light, g, txf(F@pt)));
	if (color[3] >= 0.999)
	    stabilize;
    }

}

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