金子邦彦研究室3次元,地図3次元グラフィックスのツール(モデラーとレンダラー)RIB ファイルの文法と機能

RIB ファイルの文法と機能

RIB ファイルとは、RenderMan で使用されているシーン記述ファイルである.

このページでは,Pixer RIB ファイルにおけるプリミティブ(球などの要素)の記述,カメラの指定などについて, 基本的な文法と機能を説明している.

準備事項

この Web ページに記載の RIB ファイルは,RenderMan 互換のレンダラーである aqsis で確認済みである.

関連する外部ページ

RIB ファイルの入門

上記の「簡単なRIBファイル」に関係する文法と機能を説明しておく.

レンダリングに関する指定

カメラに関する指定

モデルに関する指定

種々のプリミティブを含む RIB ファイル

Display "sample.tiff" "file" "rgba"
Display "+sample.tiff" "framebuffer" "rgb"
Format 800 600 1
Projection "perspective" "fov" [60]


WorldBegin
    LightSource "ambientlight" 0.2 "intensity" .8

    Translate 0 0 6
    Rotate -90 1 0 0
    
    ## A sphere
    Color 1 0 0
    Translate -2 0 1
    Sphere 0.5 -0.5 0.5 360

    ## A cone
    Color 0 1 0
    Translate 2 0 -1
    Cone 1 0.5 360

    ## A cylinder
    Color 0 0 1
    Translate 2 0 1
    Cylinder 0.5 -0.5 0.5 360

    ## A hyperboloid
    Color 1 1 0
    Translate -4 0 -2
    Hyperboloid 0.4 -0.4 -0.4 0.4 0.4 0.4 360

    ## A paraboloid
    Color 1 0 1
    Translate 2 0 -1
    Paraboloid 0.5 0 0.9 360

    ## A torus
    Color 0 1 1
    Translate 2 0 1
    Torus .4 .15 0 360 360

    ## A disk
    Color 0 1 0
    Translate -2 0 3
    Disk 0 .5 360
WorldEnd

表示は,下記のようになる

[image]