How To ... Access the Z-Depth channel
How To ... Access the Z-Depth channel
delete $VoxelBox*
rbmp = render outputsize:[32,32] channels:#(#zdepth) vfb: off
z_d = getchannelasmask rbmp #zdepth
progressstart "Rendering Voxels..."
for y = 1 to rbmp.height do
(
progressupdate (100.0 * y / rbmp.height)
pixel_line = getpixels rbmp [0,y-1] rbmp.width
z_line = getpixels z_d [0,y-1] rbmp.width
for x = 1 to rbmp.width do
(
b = box width:10 length:10 height:(z_line[x].value/2)
b.pos = [x*10,-y*10,0]
b.wirecolor = pixel_line[x]
b.name = uniquename "VoxelBox"
) --end x loop
) --end y loop
progressend ()
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/5486827
- 点赞
- 收藏
- 关注作者
评论(0)