RIB ファイルの文法と機能

概要

RIB ファイルとは,RenderMan で使われるシーン記述ファイルである.このページでは,RIB ファイルにおけるプリミティブ(球などの要素)の記述やカメラの指定などについて,基本的な文法と機能を説明する.記載の RIB ファイルは,RenderMan 互換のレンダラーである aqsis で確認済みである.

目次

関連する外部ページ

簡単な RIB ファイルの作成とテスト

RIB ファイルを作成する.ファイル名は何でもよいが,以下の説明では sample.rib とする.

  1. sample.rib の作成
    Display "sample.tiff" "file" "rgba"
    Display "+sample.tiff" "framebuffer" "rgb"
    Format 800 600 1
    Projection "perspective" "fov" [60]
    
    WorldBegin
        Translate 0 0 2
        Color 0.2 0.4 1
        Sphere 1 -1 1 360
    WorldEnd
    
  2. 描画(レンダリング)の実行

    コマンドプロンプト(またはコンソール)で aqsis を実行し,sample.rib を描画する.

    aqsis -progress sample.rib
    
  3. 実行結果の確認

    下記のように表示されるので確認する.

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

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