ということで、MayaのデフォルトのNurbsサーフェイスをrib exportしてみた。まず、注意しなければならないのは、そのままではつかえないこと。
WorldBegin〜EndやObjectBeginステートメント、Perspectiveなどはすべて削除。オブジェクトのみ。Nupatchだけにした。当然、原点で作成している。たとえば、円錐Coneは、次のようになる。
ファイル名はcone.ribとした。なお、gelatoでribを読み込むには
RMRからlibをダウンロードする必要がある。
NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 2.23607 2.23607 2.23607 2.23607] 0 2.23607 "Pw" [0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1
0.783612 -1 0.783612 1 3.21127e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 2.72688e-016 1 -0.783612 -1 -0.783612 1 -5.95213e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1 0.783612 -1 0.783612 1
0.522408 -0.333333 -0.522408 1 0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1
2.14085e-016 -0.333333 0.738796 1 -0.522408 -0.333333 0.522408 1 -0.738796 -0.333333 2.02203e-016 1
-0.522408 -0.333333 -0.522408 1 -3.96809e-016 -0.333333 -0.738796 1 0.522408 -0.333333 -0.522408 1
0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1 0.261204 0.333333 -0.261204 1
0.369398 0.333333 6.25547e-017 1 0.261204 0.333333 0.261204 1 1.07042e-016 0.333333 0.369398 1
-0.261204 0.333333 0.261204 1 -0.369398 0.333333 1.31718e-016 1 -0.261204 0.333333 -0.261204 1
-1.98404e-016 0.333333 -0.369398 1 0.261204 0.333333 -0.261204 1 0.369398 0.333333 6.25547e-017 1
0.261204 0.333333 0.261204 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1]
NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 2.23607 2.23607 2.23607 2.23607] 0 2.23607 "Pw" [0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1
0.783612 -1 0.783612 1 3.21127e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 2.72688e-016 1 -0.783612 -1 -0.783612 1 -5.95213e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1 0.783612 -1 0.783612 1
0.522408 -0.333333 -0.522408 1 0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1
2.14085e-016 -0.333333 0.738796 1 -0.522408 -0.333333 0.522408 1 -0.738796 -0.333333 2.02203e-016 1
-0.522408 -0.333333 -0.522408 1 -3.96809e-016 -0.333333 -0.738796 1 0.522408 -0.333333 -0.522408 1
0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1 0.261204 0.333333 -0.261204 1
0.369398 0.333333 6.25547e-017 1 0.261204 0.333333 0.261204 1 1.07042e-016 0.333333 0.369398 1
-0.261204 0.333333 0.261204 1 -0.369398 0.333333 1.31718e-016 1 -0.261204 0.333333 -0.261204 1
-1.98404e-016 0.333333 -0.369398 1 0.261204 0.333333 -0.261204 1 0.369398 0.333333 6.25547e-017 1
0.261204 0.333333 0.261204 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1]
NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 1 1 1 1] 0 1 "Pw" [0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0.261204 -1 -0.261204 1 0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1
1.58307e-016 -1 0.369398 1 -0.261204 -1 0.261204 1 -0.369398 -1 1.62571e-016 1
-0.261204 -1 -0.261204 1 -2.49669e-016 -1 -0.369398 1 0.261204 -1 -0.261204 1
0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1 0.522408 -1 -0.522408 1
0.738796 -1 -1.82408e-017 1 0.522408 -1 0.522408 1 3.16613e-016 -1 0.738796 1
-0.522408 -1 0.522408 1 -0.738796 -1 3.25142e-016 1 -0.522408 -1 -0.522408 1
-4.99337e-016 -1 -0.738796 1 0.522408 -1 -0.522408 1 0.738796 -1 -1.82408e-017 1
0.522408 -1 0.522408 1 0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1
0.783612 -1 0.783612 1 4.7492e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 4.87713e-016 1 -0.783612 -1 -0.783612 1 -7.49006e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1 0.783612 -1 0.783612 1]
NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 1 1 1 1] 0 1 "Pw" [0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0.261204 -1 -0.261204 1 0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1
1.58307e-016 -1 0.369398 1 -0.261204 -1 0.261204 1 -0.369398 -1 1.62571e-016 1
-0.261204 -1 -0.261204 1 -2.49669e-016 -1 -0.369398 1 0.261204 -1 -0.261204 1
0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1 0.522408 -1 -0.522408 1
0.738796 -1 -1.82408e-017 1 0.522408 -1 0.522408 1 3.16613e-016 -1 0.738796 1
-0.522408 -1 0.522408 1 -0.738796 -1 3.25142e-016 1 -0.522408 -1 -0.522408 1
-4.99337e-016 -1 -0.738796 1 0.522408 -1 -0.522408 1 0.738796 -1 -1.82408e-017 1
0.522408 -1 0.522408 1 0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1
0.783612 -1 0.783612 1 4.7492e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 4.87713e-016 1 -0.783612 -1 -0.783612 1 -7.49006e-016 -1 -1.10819 1
以下は、上記の画像をつくるために配置したpygです。
#primitive.pyg
Output ("primitive.tif", "tiff", "rgb", "camera", "float gain", 1, "float gamma",
1, "string filter", "gaussian", "float[2] filterwidth", (2, 2))
Attribute ("string projection", "perspective")
Attribute ("float fov", 20)
Attribute ("int[2] resolution", (640, 480))
#placecam 10 5 -10 0 0 0
Rotate (-19.47, 1.00, 0.00, 0.00)
Rotate (45.00, 0.00, 1.00, 0.00)
Translate (-10.00, -5.00, 10.00)
Attribute ("string geometryset", "+shadows")
World ()
Light ("light1", "pointlight", "float intensity", 350, "point from", (-10, 10, -10),"string shadowname", "shadows")
Light ("light2", "pointlight", "float intensity", 350, "point from", (10, 10, -10),"string shadowname", "shadows")
Attribute ("color C", (0.8, 1, 0.8))
Input("backplane.pyg")
PushTransform ()
Attribute ("color C", (0.2, 0.9, 0.2))
Shader ("surface", "clay")
Translate ( 2, 1.1, 0)
Input ("cone.rib")
PopTransform ()
PushTransform ()
Attribute ("color C", (0.9, 0.9, 0.9))
Shader ("surface", "veinedmarble")
Translate ( -2, 1.1, 0)
Input ("cyl.rib")
PopTransform ()
PushTransform ()
Attribute ("color C", (0.9, 0.5, 0.5))
Shader ("surface", "plastic")
Translate ( 1, 0.5, -3)
Input ("torus.rib")
PopTransform ()
Scale (2,2,2)
#Rotate (90.00, 0.00, 1.00, 0.00)
Rotate (90.00, 1.00, 0.00, 0.00)
Attribute ("color C", (1, 1, 1))
Shader ("surface", "oakplank","float Km", 1)
Input("PlaneGeom.rib")
Render()
- -
- -