Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -1,13 +1,4 @@
|
|||
T Colour
|
||||
Byte r, g, b
|
||||
|
||||
F (r, g, b)
|
||||
.r = r
|
||||
.g = g
|
||||
.b = b
|
||||
|
||||
F ==(other)
|
||||
R .r == other.r & .g == other.g & .b == other.b
|
||||
T Colour = BVec3
|
||||
|
||||
V black = Colour(0, 0, 0)
|
||||
V white = Colour(255, 255, 255)
|
||||
|
|
|
|||
74
Task/Bitmap/POV-Ray/bitmap.povray
Normal file
74
Task/Bitmap/POV-Ray/bitmap.povray
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
//cmd: +w300 +h300 +am2 +a0.01
|
||||
|
||||
#version 3.7;
|
||||
|
||||
#global_settings {assumed_gamma 1}
|
||||
#default{ finish{ ambient 0.1 diffuse 0.9 }}
|
||||
background {rgb 0}
|
||||
|
||||
|
||||
#macro mapInit(DimX, DimY)
|
||||
#local Map = array[DimX][DimY];
|
||||
mapFillSolid(Map, rgb<0,0,0>)
|
||||
Map
|
||||
#end
|
||||
|
||||
|
||||
#macro mapFillSolid(Map, Colour)
|
||||
mapFillRect(Map,<0,0>,<dimension_size(Map,1),dimension_size(Map,2)>, Colour)
|
||||
#end
|
||||
|
||||
|
||||
#macro mapFillRect(Map, RectLowerLeft, RectUpperRight, Colour)
|
||||
#for (X, RectLowerLeft.x, RectUpperRight.x - 1)
|
||||
#for (Y, RectLowerLeft.y, RectUpperRight.y - 1)
|
||||
#local Map[X][Y] = Colour;
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
|
||||
#macro mapSetPixel(Map, Pixel, Colour)
|
||||
#local Map[Pixel.x][Pixel.y] = Colour;
|
||||
#end
|
||||
|
||||
|
||||
#macro mapGetPixel(Map, Pixel)
|
||||
Map[Pixel.x][Pixel.y]
|
||||
#end
|
||||
|
||||
|
||||
#macro mapObject(Map)
|
||||
// to visualize the map, each pixel is rendered as a sphere
|
||||
#for (X,0,dimension_size(Map,1)-1)
|
||||
#for (Y,0,dimension_size(Map,2)-1)
|
||||
sphere{
|
||||
<X, Y, 0>, 0.5
|
||||
pigment{colour Map[X][Y]}
|
||||
}
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
//== Scene
|
||||
|
||||
#declare DimX = 100;
|
||||
#declare DimY = 100;
|
||||
#declare ImgMap = mapInit(DimX, DimY);
|
||||
mapFillSolid(ImgMap, rgb<1, 0, 0>)
|
||||
mapSetPixel(ImgMap, <25,25>, rgb<1,1,1>)
|
||||
mapFillRect(ImgMap, <50,50>, <75,75>, rgb<0,0,1>)
|
||||
|
||||
#debug concat("Colour at: <", vstr(2,<25,25>,", ",0,0),"> is: <", vstr(3, mapGetPixel(ImgMap, <25,25>),", ",0,0),">\n")
|
||||
|
||||
mapObject(ImgMap)
|
||||
|
||||
camera{
|
||||
location <DimX/2, DimY/2, -110>
|
||||
look_at <DimX/2, DimY/2, 0>
|
||||
right x*image_width/image_height
|
||||
}
|
||||
light_source{
|
||||
<DimX/2, DimY/2, -3000>
|
||||
rgb 1
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue