1/1

Guile RMan #3 RiPolygon and RiPoints

guile-rmanでのRiPolygonの表記がわかりました。RiPointsもわかりましたが"width"設定がわからないところ。
rect.jpg
以下はサンプルです。points.scmで保存しました。

#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "points.rib")
(RiDisplay "points.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 3)
; (RiProgressHandler progress)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2 ))
(RiAttributeBegin)
(RiColor (Color 1 0 0))
(RiSurface "plastic")
(RiTransformBegin)
(RiTranslate -0.5 -0.5 0)
;;(RiRotate -90 1 0 0)
;;(RiDisk 0 0.5 270)
;;(RiCone 1 0.5 150)
;;(RiCone 1.5 0.5 360)
(RiPolygon 4 (list "P" #f32(0 0 0 0 1 0 1 1 0 1 0 0)))
;;(RiPoints 4 (list "P" #f32(0 0 0 0 1 0 1 1 0 1 0 0) "width" 0.25)) ;;"Cs" #f32(1 0 0 0 1 0 0 0 1 1 1 0) "width" #f32(0.25 0.25 0.25 0.25)
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)


(RiPoints 1 (list "P" #f32(0 0 0)))
で原点に点を表示します。
points.jpg
  • -
  • -

Guile RMan #4 RiPoints

guile-rmanでのRiPointsでは"constantwidth"を使う。ありがとうございます。
points4.jpg

#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "points4.rib")
(RiDisplay "points4.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 3)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2 ))
(RiAttributeBegin)
(RiColor (Color 1 0 0))
(RiSurface "plastic")
(RiTransformBegin)
(RiTranslate -0.5 -0.5 0)
(RiPoints 4 (list "P" #f32(0 0 0 0 1 0 1 1 0 1 0 0) "constantwidth" 0.4))
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)

  • -
  • -

Guile RMan #5 RtLightHandle

やっと、わかりました。PixarのRenderMan C Bindingにヒントがありました。bulb.cを参考にしました。ありがとうございます。
guile-rmanでのRtLightHandleの記述例:

(define light2 (RiLightSource "distantlight" (list "intensity" 1.2 )))
(RiIlluminate light2 0 )

LightID、"light2"をRiIlluminateでオフ(0)にしています。
以下は、サンプルilluminate.scm
ambientlightのみの灯りになっています。

#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "illum.rib")
(RiDisplay "illum.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 5)
; (RiProgressHandler progress)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(display (RiLightSource "ambientlight" (list "intensity" 0.2)))
(newline)
(define light2 (RiLightSource "distantlight" (list "intensity" 1.2 )))
(newline)
(RiIlluminate light2 0 )
(RiAttributeBegin)
(RiColor (Color 1.0 0.6 0.0))
(RiSurface "plastic")
(RiTransformBegin)
(RiRotate 90 1 0 0)
(RiSphere 1 -1 1 360)
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)

  • -
  • -

1/1