<< Procedural "RunProgram" その1 戻る displacementbound >>

Procedural "RunProgram" その2

RIBの出力:


#sp_rect2.py
import sys
import random

while sys.stdin.readline():

dist = 1
x = 0.0
distx = 10.0
disty = 10.0
distz = 10.0
while x <= distx:
z = 0.0
while z <= distz:
y = 0.0
while y <= disty:
r = random.random() * .5
sys.stdout.write("TransformBegin\n")
sys.stdout.write("Translate " + str(x - 5.0) + " " + str(y - 5.0) + " " + str(z - 5.0) + "\n")
sys.stdout.write('Sphere [' + str(r) + ' -1 1 360]\n')
sys.stdout.write("TransformEnd\n")
y += dist
z += dist
x += dist
sys.stdout.write('\377')
sys.stdout.flush()



いろいろと調整してみる。実行RIB:

Display "untitled" "framebuffer" "rgb"
Format 640 480 1
Projection "perspective" "fov" 30
ShadingRate 5

LightSource "distantlight" 1 "intensity" 1.5 "from" [0 0 0] "to" [0 0 1]

Translate 0 0 30
Rotate -30 1 0 0
Rotate 20 0 1 0
Scale 1 1 -1

WorldBegin
TransformBegin
Surface "plastic" "Ks" 0.6
Procedural "RunProgram" ["python sp_rect2.py" ""] [-9.91912 9.91912 -9.91912 9.91912 -9.91912 9.91912]
TransformEnd
WorldEnd


sp_rect2_2.jpg
CGkitも勉強。面白いところです。(2008.8/4記事)
別ブログが転居するので転載しました。ありがとうございます。感謝しています。
  • -
  • -

<< Procedural "RunProgram" その1 戻る displacementbound >>