GeeXLab 0.3.3
0 Members and 1 Guest are viewing this topic.
HYP_Debug.Trace("creating materials...")mat={}local ifor i=1,256 do mat[i]= HYP_Material.Create( "mat"..i ); HYP_Material.SetAmbient( mat[i], i/256, i/256, i/256, i/256 );endHYP_Debug.Trace("loading files...")local v=read_slice(HYP_GetBaseDir().."/MRbrain/MRbrain.1")HYP_Debug.Trace("creating voxels...")local x,yfor y=1,n do for x=1,n do local c=math.floor(v[y][x]/256)+1 local box=HYP_Primitive.CreateBox() HYP_Primitive.SetBoxVertexPosition( box, 0, x, y, 0 ); HYP_Primitive.SetBoxSize( box, 1,1,1 ); HYP_Object.SetMaterial( box, mat[c]); --HYP_Object.SetActiveState(box,1); endend