#version unofficial megapov 0.7; #declare HighLOD=yes; #declare LowLOD=no; #macro display_project(Object,Margin,Grid,Lights,Color) #local Dim=(max_extent(Object)-min_extent(Object))/2; #local Size=Dim+2*(Margin+Dim.z); #local Size=; #local Z0=2*Size.z; #local Local=object{Object translate Dim-min_extent(Object)} #local ToOrigin=transform{translate -(Dim+min_extent(Object))} global_settings{ assumed_gamma 1.0 #local Width=image_width; #local Height=Width*Size.y/Size.x; #if (Height>image_height) #local Height=image_height; #local Width=Height*Size.x/Size.y; #end ini_option concat("+W",str(Width,0,0)) ini_option concat("+H",str(Width*Size.y/Size.x,0,0)) } background{color Color} camera{ orthographic location -1000*z direction z right 2*Size.x*x up 2*Size.x*y*image_height/image_width look_at -900*z } #local Max=max(Size.x,Size.y); light_source{ <0,0,-10*Z0> color rgb 1 #if (Lights>0) area_light 2*Max*x,2*Max*y,Lights,Lights #else parallel point_at 0 #end groups "front,top,bottom,left,right" } object{Object transform{transform ToOrigin}light_group"front"} object{Object transform{transform ToOrigin rotate 90*y translate (Dim.x+Margin+Dim.z)*x}light_group"right"} object{Object transform{transform ToOrigin rotate -90*y translate -(Dim.x+Margin+Dim.z)*x}light_group"left"} object{Object transform{transform ToOrigin rotate -90*x translate (Dim.y+Margin+Dim.z)*y}light_group"top"} object{Object transform{transform ToOrigin rotate 90*x translate -(Dim.y+Margin+Dim.z)*y}light_group"bottom"} #if (Grid<0) #local Z0=-Z0; #local Grid=-Grid; #end #if (Grid>0) #local GridTexture=texture{pigment{color rgb <1-Color.red,1-Color.green,1-Color.blue>}} #local GridSize=Size.x/image_width; #local Y0=Size.y; #local c=Grid/2; // counter #while (cGridSize texture{GridTexture}no_shadow no_reflection} cylinder{<-c,-Y0,Z0><-c,Y0,Z0>GridSize texture{GridTexture}no_shadow no_reflection} #local c=c+Grid; #end #local X0=Size.x; #local c=Grid/2; // counter #while (cGridSize texture{GridTexture}no_shadow no_reflection} cylinder{<-X0,-c,Z0>GridSize texture{GridTexture}no_shadow no_reflection} #local c=c+Grid; #end #local X0=Dim.x+Margin; #local Y0=Dim.y+Margin+Dim.z; #local c=Grid/2; // counter #while (cGridSize texture{GridTexture}no_shadow no_reflection} cylinder{<-X0,Y0-c,Z0>GridSize texture{GridTexture}no_shadow no_reflection} cylinder{<-X0,c-Y0,Z0>GridSize texture{GridTexture}no_shadow no_reflection} cylinder{<-X0,-(c+Y0),Z0>GridSize texture{GridTexture}no_shadow no_reflection} #local c=c+Grid; #end #local X0=Dim.x+Margin+Dim.z; #local Y0=Dim.y+Margin; #local c=Grid/2; // counter #while (cGridSize texture{GridTexture}no_shadow no_reflection} cylinder{GridSize texture{GridTexture}no_shadow no_reflection} cylinder{GridSize texture{GridTexture}no_shadow no_reflection} cylinder{<-(c+X0),-Y0,Z0><-(c+X0),Y0,Z0>GridSize texture{GridTexture}no_shadow no_reflection} #local c=c+Grid; #end #local Round=intersection{ union{ #local c=Grid/2; // counter #while (c<2*(Dim.z+GridSize),2*(Dim.z+GridSize),2*GridSize>} texture{GridTexture} light_group "grid" no_shadow no_reflection } #local ToOrigin=transform{translate(Dim.x+Margin)*x translate(Dim.y+Margin)*y} object{Round transform{ToOrigin}} object{Round transform{ToOrigin scale<-1,1,1>}} object{Round transform{ToOrigin scale<1,-1,1>}} object{Round transform{ToOrigin scale<-1,-1,1>}} #end #end