<< UVをリストにする その2 戻る No module named pygame >>

metasequoiaからUVマップ

メタセコイアのPythonを使ってUVマップ座標を算出、RIBのst座標として記述した。また3Delightでレンダリングするので、テクスチャを変換。

MakeTexture "grade.tif" "grade.tdl" "periodic" "periodic" "gaussian" 1 1

menuv.jpg
以下、サンプルRIBです。ライトが明るすぎてテクスチャが白くなりすぎていました。


##Renderman RIB-Structure 1.0
Display "men.tif" "file" "rgba"
Display "+men.tif" "framebuffer" "rgba"

Format 640 480 1
PixelSamples 4 4
PixelFilter "catmull-rom" 3 3
ShadingRate 1

Imager "background" "background" [0.500 0.500 0.600]

Sides 1
Orientation "lh"
Projection "perspective" "fov" [9.52728338145235]
Rotate -40.8862682605356 1 0 0 # pich
Rotate 52.9183819582828 0 1 0 # head
Translate -90.469199 -98.183947 68.375702
Scale 0.1 0.1 0.1
WorldBegin
Attribute "visibility" "trace" [1]
Attribute "visibility" "transmission" ["Os"]
Attribute "visibility" "transmission" "opaque"
Attribute "light" "shadows" "on"
Attribute "trace" "displacements" [1]
LightSource "ambientlight" 0 "intensity" [ 0.1 ] "lightcolor" [ 1 1 1 ]
LightSource "distantlight" 1 "intensity" [ 3 ] "lightcolor" [ 1 1 1 ] "from" [ -1 1 -1 ] "to" [ 0 0 0 ]
LightSource "distantlight" 2 "intensity" [ 3 ] "lightcolor" [ 1 1 1 ] "from" [ 1 1 2.5 ] "to" [ 0 0 0 ]
ReadArchive "men_mdl.rib"
WorldEnd





##Renderman RIB-Structure 1.0
## filename: men_mdl.rib

MakeTexture "grade.tif" "grade.tdl" "periodic" "periodic" "gaussian" 1 1
AttributeBegin
Attribute "identifier" "name" ["obj1"]
Declare "st" "facevarying float[2]"
### MaterialName: Default
Surface "supertexmap" "string Csmapname" "grade.tdl"
#Surface "paintedplastic" "uniform float Ks" 0.5 "uniform float Kd" 0.5
#"uniform float Ka" 1 "uniform float roughness" 0.1 "uniform color specularcolor" [1 1 1] "uniform string texturename" "grade.tdl"
PointsPolygons
[3 3 3 3]
[0 1 2 0 2 3 4 5 2 4 2 1]
"P" [50.000000 0.000000 100.000000
50.000000 20.000000 0.000000
-50.000000 20.000000 0.000000
-50.000000 0.000000 100.000000
50.000000 0.000000 -100.000000
-50.000000 0.000000 -100.000000]
"N" [0.000000 0.980581 0.196116
0.000000 1.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.980581 0.196116
0.000000 0.980581 -0.196116
0.000000 0.980581 -0.196116]
"st" [0.9982 -0.0019
0.9982 0.4789
0.5174 0.4789
0.9965 -0.0001
0.4965 0.4905
0.4965 -0.0001
0.9916 0.9968
0.4916 0.9968
0.4916 0.4905
0.9965 0.9968
0.4965 0.4905
0.9949 0.4889]
AttributeEnd




何とかなりそう。面白いです。ありがとうございます。
  • -
  • -

<< UVをリストにする その2 戻る No module named pygame >>