RIBの出力:
import sys
args = sys.stdin.readline()
while args:
values = args.split()
pixels = float(values[0])
rad = float(values[1])
print 'TransformBegin'
print 'Sphere %s %s %s 360' % (rad, -rad, rad)
print 'TransformEnd'
sys.stdout.write('\377')
sys.stdout.flush()
# read the next set of inputs
args = sys.stdin.readline()
RunProgram例:
Display "untitled" "framebuffer" "rgb"
Format 400 400 1
Projection "perspective" "fov" 30
ShadingRate 5
LightSource "distantlight" 1 "intensity" 1.5 "from" [0 0 0] "to" [0 0 1]
Translate 0 0 5
Rotate -30 1 0 0
Rotate 20 0 1 0
Scale 1 1 -1
WorldBegin
TransformBegin
Surface "plastic" "Ks" 0.6
Procedural "RunProgram" ["python pytest.py" "1.0"] [-1 1 -1 1 -1 1]
TransformEnd
WorldEnd
ケッソン先生のサイト参考になります。ありがとうございます。
- -
- -