<< 4/8 >>
abnormal program termination
Lightflowを使ってみたいけど、インストールが難しくて、やめてしまうこともあると思います。
インストールについてまとめましたので、参考にしてください。
http://rman.sakura.ne.jp/sb/log/eid74.html
さて、インストールができて、
はじめてLightflowを動かそうとしたら、下記のようなエラーが出て、
あきらめてしまった人もいると思います。いくつかのサイトを検索してみると質問がありました。
Runtime Error!
Program: C:\Program files\python\python.exe
abnormal program termination
Error (LfFault):
LfNoiseInit()
unable to open "noise.dat"
原因は環境変数のPathを正確に書いていないことです。
たとえば、
見たところ問題ないと思われますが、
C:\Lightflowと記入した後ろに半角の空白スペースがあって、上記のエラーが出ていたことがありました。カーソルを持っていって矢印キーを動かしてみると半角スペースがあったりしますから、要注意ですね。半角スペースを削除してOKし、再起動し、C:\Lightflow\PM\Examplesから、
コマンドプロンプトアイコンをダブルクリックして、
>"c:\program files\python\python" ball1.py
と打ち込んでLightflowのサンプルball1.pyがレンダリングできたら、大丈夫です。
たくさん、経験していくことで、原因が見えてきます。
Lightflow質感設定 Standard材質その1
Lightflowの使い方として、微妙な質感を調整することができる。
基本となる反射色kcをそれぞれ、赤、緑、青の色に設定した。
#! /usr/bin/env python
#sphere01.py
from lightflowPM import *
from math import *
s = scene()
s.lightOn( s.newLight( "point", [ "position", vector3( 5.0, -5.0, 4.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
s.lightOn( s.newLight( "ambient", [ "color", vector3( 0.2, 0.2, 0.2 ) ] ) ) #環境光を加える。
plastic = s.newMaterial( "standard",[ "kc", vector3( 1, 0, 0 ) ] ) #赤
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0, 1, 0 )] ) #緑
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0, 0, 1 )] ) #青
check_ground=s.newPattern("check",["color",vector3( 0.2, 0.4, 0.6 ),"scale",0.025])
ground=s.newMaterial( "standard",[ "kc", check_ground,"kc",vector3( 1.0, 1.0, 1.0 ),"ka",check_ground ] )
#ground=s.newMaterial( "standard",[ "kc", vector3( 1, 1, 1 ) ] ) #白
s.materialBegin( plastic )
s.addObject( s.newObject( "sphere", [ "radius",1.4] ) )
s.materialEnd()
s.materialBegin( plastic2 )
s.transformBegin( transform().translation( vector3(-4.0,0,0)))
s.addObject( s.newObject( "sphere", [ "radius",1.4] ) )
s.transformEnd()
s.materialEnd()
s.materialBegin( plastic3 )
s.transformBegin( transform().translation( vector3(4.0,0,0)))
s.addObject( s.newObject( "sphere", [ "radius",1.4] ) )
s.transformEnd()
s.materialEnd()
#地面groundをpatchで作成しています。高さ(z軸)を-1.4にしてぴったり球とあわせています。
s.materialBegin( ground )
s.addObject( s.newObject( "patch", [ "points",vector3( -50, -50, -1.4 ),vector3( -50, 50, -1.4 ),vector3( 50, -50, -1.4 ),vector3( 50, 50, -1.4 )] ) )
s.materialEnd()
saver = s.newImager( "tga-saver", [ "file", "sphere01.tga" ] )
s.imagerBegin( saver )
camera = s.newCamera( "pinhole", [ "eye", vector3( 0, -6, 5 ), "aim", vector3( 0, 0, 0 ) ] )
s.imagerEnd()
s.render( camera, 512, 300 )
Lightflow質感設定 Standard材質その2
"kr",vector3 | pattern kr [レイトレース反射色]
レイトレース反射色です。映り込みをします。
kr 0.2にしました。
#! /usr/bin/env python
#sphere02.py
from lightflowPM import *
from math import *
s = scene()
s.lightOn( s.newLight( "point", [ "position", vector3( 5.0, -5.0, 4.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
s.lightOn( s.newLight( "ambient", [ "color", vector3( 0.2, 0.2, 0.2 ) ] ) ) #環境光を加える。
plastic = s.newMaterial( "standard",[ "kc", vector3( 1, 0, 0 ),"kr",vector3(0.2,0.2,0.2) ] ) #赤, レイトレース反射色kr追加
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0, 1, 0 ),"kr",vector3(0.2,0.2,0.2) ] ) #緑, レイトレース反射色kr追加
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0, 0, 1 ),"kr",vector3(0.2,0.2,0.2) ] ) #青, レイトレース反射色kr追加
check_ground=s.newPattern("check",["color",vector3( 0.2, 0.4, 0.6 ),"scale",0.025])
ground=s.newMaterial( "standard",[ "kc", check_ground,"kc",vector3( 1.0, 1.0, 1.0 ),"ka",check_ground ] )
#ground=s.newMaterial( "standard",[ "kc", vector3( 1, 1, 1 ) ] ) #白
s.materialBegin( plastic )
s.addObject( s.newObject( "sphere", [ "radius",1.4] ) )
s.materialEnd()
s.materialBegin( plastic2 )
s.transformBegin( transform().translation( vector3(-4.0,0,0)))
s.addObject( s.newObject( "sphere", [ "radius",1.4] ) )
s.transformEnd()
s.materialEnd()
s.materialBegin( plastic3 )
s.transformBegin( transform().translation( vector3(4.0,0,0)))
s.addObject( s.newObject( "sphere", [ "radius",1.4] ) )
s.transformEnd()
s.materialEnd()
#地面groundをpatchで作成しています。高さ(z軸)を-1.4にしてぴったり球とあわせています。
s.materialBegin( ground )
s.addObject( s.newObject( "patch", [ "points",vector3( -50, -50, -1.4 ),vector3( -50, 50, -1.4 ),vector3( 50, -50, -1.4 ),vector3( 50, 50, -1.4 )] ) )
s.materialEnd()
saver = s.newImager( "tga-saver", [ "file", "sphere02.tga" ] )
s.imagerBegin( saver )
camera = s.newCamera( "pinhole", [ "eye", vector3( 0, -6, 5 ), "aim", vector3( 0, 0, 0 ) ] )
s.imagerEnd()
s.render( camera, 512, 300 )
Lightflow質感設定その3 レイトレース反射色
レイトレース反射色krを0.95にしてみた。
plastic = s.newMaterial( "standard",[ "kc", vector3( 1, 0, 0 ),"kr",vector3(0.95,0.95,0.95) ] ) #赤
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0, 1, 0 ),"kr",vector3(0.95,0.95,0.95) ] ) #緑
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0, 0, 1 ),"kr",vector3(0.95,0.95,0.95) ] ) #青
Lightflow質感設定その4 レイトレース反射色
"kd",float | pattern kd [拡散量]0.01を追加しておき、レイトレース反射色krを右の球から0.1、0.5、0.95に設定した。
・反射色kc 0.3
plastic = s.newMaterial( "standard",[ "kc", vector3( 0.3, 0.3, 0.3 ),"kd", 0.01
,"kr",vector3(0.5,0.5,0.5) ] )
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0.3, 0.3, 0.3 ),"kd", 0.01
,"kr",vector3(0.95,0.95,0.95) ] )
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0.3, 0.3, 0.3 ),"kd", 0.01
,"kr",vector3(0.1,0.1,0.1) ] )
・反射色kc 0.5
plastic = s.newMaterial( "standard",[ "kc", vector3( 0.5, 0.5, 0.5 ),"kd", 0.01
,"kr",vector3(0.5,0.5,0.5) ] )
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0.5, 0.5, 0.5 ),"kd", 0.01
,"kr",vector3(0.95,0.95,0.95) ] )
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0.5, 0.5, 0.5 ),"kd", 0.01
,"kr",vector3(0.1,0.1,0.1) ] )
・反射色kc 0.95
plastic = s.newMaterial( "standard",[ "kc", vector3( 0.95, 0.95, 0.95 ),"kd", 0.01
,"kr",vector3(0.5,0.5,0.5) ] )
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0.95, 0.95, 0.95 ),"kd", 0.01
,"kr",vector3(0.95,0.95,0.95) ] )
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0.95, 0.95, 0.95 ),"kd", 0.01
,"kr",vector3(0.1,0.1,0.1) ] )
Lightflow質感設定その5 拡散量
"kd",float | pattern kd [拡散量]
どのくらい光が拡散するかを決めます。1に近づくほど拡散します。透明な材質を作りたい場合はおもいきり下げたほうが良いでしょう。通常kdを記入しなければ(省略した場合)、"1.0"になっています(デフォルト)。ちょっと抑えてあげたほうがよいかもしれません。
plastic = s.newMaterial( "standard",[ "kc", vector3( 0.5, 0.5, 0.5 ),"kd", 0.5 ] ) #真ん中の球
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0.5, 0.5, 0.5 ),"kd", 0.01 ] ) #左の球
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0.5, 0.5, 0.5 ) ] ) #右の球,"kd", 1.0と同じです。
Lightflow質感設定その6 拡散量
拡散量がたとえ同じであっても、光源の位置で表情は変わりますね。
kdを0.33としてみた。
plastic = s.newMaterial( "standard",[ "kc", vector3( 0.6, 0.6, 0.6 ),"kd", 0.33 ] )
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0.6, 0.6, 0.6 ),"kd", 0.33 ] )
plastic3 = s.newMaterial( "standard",[ "kc", vector3( 0.6, 0.6, 0.6 ),"kd", 0.33 ] )
Lightflowのカラーサンプル
POV-Rayではcolor.incというカラーサンプルが定義されている。Lightflowで似たようなことができないか使い方を検討やってみた。
まず、Pythonで読めるように、ファイルをEditorを使って整えた。
ファイル名はcolorinc.py
以下のように記述した。
#! /usr/bin/env python
#colorinc.py
from lightflowPM import *
Blue=vector3(0, 0.6, 1)
Red=vector3(1, 0, 0)
Green=vector3(0, 1, 0.5)
Violet=vector3(1, 0.2, 1)
Orange=vector3(1, 0.6, 0.2)
Yellow =vector3(1,1,0)
Cyan =vector3(0, 1, 1)
Magenta =vector3(1, 0, 1)
White =vector3(1, 1, 1)
Black =vector3(0, 0, 0)
DimGray=vector3(0.329412,0.329412,0.329412)
Gray=vector3(0.752941,0.752941,0.752941)
LightGray=vector3(0.658824,0.658824,0.658824)
VLightGray=vector3(0.80,0.80,0.80)
Aquamarine=vector3(0.439216,0.858824,0.576471)
BlueViolet=vector3(0.62352,0.372549,0.623529)
Brown=vector3(0.647059,0.164706,0.164706)
CadetBlue=vector3(0.372549,0.623529,0.623529)
Coral=vector3(1.0,0.498039,0.0)
CornflowerBlue=vector3(0.258824,0.258824,0.435294)
DarkGreen=vector3(0.184314,0.309804,0.184314)
DarkOliveGreen=vector3(0.309804,0.309804,0.184314)
DarkOrchid=vector3(0.6,0.196078,0.8)
DarkSlateBlue=vector3(0.119608,0.137255,0.556863)
DarkSlateGray=vector3(0.184314,0.309804,0.309804)
DarkTurquoise=vector3(0.439216,0.576471,0.858824)
Firebrick=vector3(0.556863,0.137255,0.137255)
ForestGreen=vector3(0.137255,0.556863,0.137255)
Gold=vector3(0.8,0.498039,0.196078)
Goldenrod=vector3(0.858824,0.858824,0.439216)
GreenYellow=vector3(0.576471,0.858824,0.439216)
IndianRed=vector3(0.309804,0.184314,0.184314)
Khaki=vector3(0.623529,0.623529,0.372549)
LightBlue=vector3(0.74902,0.847059,0.847059)
LightSteelBlue=vector3(0.560784,0.560784,0.737255)
LimeGreen=vector3(0.196078,0.8,0.196078)
Maroon=vector3(0.556863,0.137255,0.419608)
MediumAquamarine=vector3(0.196078,0.8,0.6)
MediumBlue=vector3(0.196078,0.196078,0.8)
MediumForestGreen=vector3(0.419608,0.556863,0.137255)
MediumGoldenrod=vector3(0.917647,0.917647,0.678431)
MediumOrchid=vector3(0.576471,0.439216,0.858824)
MediumSeaGreen=vector3(0.258824,0.435294,0.258824)
MediumTurquoise=vector3(0.439216,0.858824,0.858824)
MediumVioletRed=vector3(0.858824,0.439216,0.576471)
MidnightBlue=vector3(0.184314,0.184314,0.309804)
Navy=vector3(0.137255,0.137255,0.556863)
NavyBlue=vector3(0.137255,0.137255,0.556863)
Orange=vector3(1,0.5,0.0)
Orchid=vector3(0.858824,0.439216,0.858824)
PaleGreen=vector3(0.560784,0.737255,0.560784)
Pink=vector3(0.737255,0.560784,0.560784)
Plum=vector3(0.917647,0.678431,0.917647)
Salmon=vector3(0.435294,0.258824,0.258824)
SeaGreen=vector3(0.137255,0.556863,0.419608)
Sienna=vector3(0.556863,0.419608,0.137255)
SkyBlue=vector3(0.196078,0.6,0.8)
SteelBlue=vector3(0.137255,0.419608,0.556863)
Tan=vector3(0.858824,0.576471,0.439216)
Thistle=vector3(0.847059,0.74902,0.847059)
Turquoise=vector3(0.678431,0.917647,0.917647)
Violet=vector3(0.309804,0.184314,0.309804)
VioletRed=vector3(0.8,0.196078,0.6)
Wheat=vector3(0.847059,0.847059,0.74902)
YellowGreen=vector3(0.6,0.8,0.196078)
SummerSky=vector3(0.22,0.69,0.87)
RichBlue=vector3(0.35,0.35,0.67)
Brass=vector3( 0.71,0.65,0.26)
Copper=vector3(0.72,0.45,0.20)
Bronze=vector3(0.55,0.47,0.14)
Bronze2=vector3(0.65,0.49,0.24)
Silver=vector3(0.90,0.91,0.98)
BrightGold=vector3(0.85,0.85,0.10)
OldGold=vector3( 0.81,0.71,0.23)
Feldspar=vector3(0.82,0.57,0.46)
Quartz=vector3(0.85,0.85,0.95)
NeonPink=vector3(1.00,0.43,0.78)
DarkPurple=vector3(0.53,0.12,0.47)
NeonBlue=vector3(0.30,0.30,1.00)
CoolCopper=vector3(0.85,0.53,0.10)
MandarinOrange=vector3(0.89,0.47,0.20)
LightWood=vector3(0.91,0.76,0.65)
MediumWood=vector3(0.65,0.50,0.39)
DarkWood=vector3(0.52,0.37,0.26)
SpicyPink=vector3(1.00,0.11,0.68)
SemiSweetChoc=vector3(0.42,0.26,0.15)
BakersChoc=vector3(0.36,0.20,0.09)
Flesh=vector3(0.96,0.80,0.69)
NewTan=vector3(0.92,0.78,0.62)
NewMidnightBlue=vector3(0.00,0.00,0.61)
VeryDarkBrown=vector3(0.35,0.16,0.14)
DarkBrown=vector3(0.36,0.25,0.20)
DarkTan=vector3(0.59,0.41,0.31)
GreenCopper=vector3(0.32,0.49,0.46)
DkGreenCopper=vector3(0.29,0.46,0.43)
DustyRose=vector3(0.52,0.39,0.39)
HuntersGreen=vector3(0.13,0.37,0.31)
Scarlet=vector3(0.55,0.09,0.09)
Med_Purple=vector3( 0.73,0.16,0.96)
Light_Purple=vector3(0.87,0.58,0.98)
Very_Light_Purple=vector3(0.94,0.81,0.99)
後はLightflowでシーン記述したファイルの中で実際に呼び出すために、
import colorincと記述しておき、色呼び出しの際は、
colorinc.DimGray
colorinc.BlueViolet
と記述してあげると、指定の色が呼び出される。
以下、サンプルを参考にしてください。
#! /usr/bin/env python
#box_colors6.py
from lightflowPM import *
from math import *
import colorinc
s = scene()
s.lightOn( s.newLight( "point", [ "position", vector3( 5.0, -5.0, 4.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
s.lightOn( s.newLight( "ambient", [ "color", vector3( 0.3, 0.3, 0.3 ) ] ) ) #環境光を加える。
plastic = s.newMaterial( "standard",[ "kc", colorinc.DarkTurquoise,"kd",0.66 ] ) #
plastic2 = s.newMaterial( "standard",[ "kc", colorinc.Firebrick,"kd",0.66 ] ) #
plastic3 = s.newMaterial( "standard",[ "kc", colorinc.ForestGreen,"kd",0.66 ] ) #
plastic4 = s.newMaterial( "standard",[ "kc", colorinc.Gold,"kd",0.66 ] ) #
plastic5 = s.newMaterial( "standard",[ "kc", colorinc.Goldenrod,"kd",0.66 ] ) #
plastic6 = s.newMaterial( "standard",[ "kc", colorinc.GreenYellow,"kd",0.66 ] ) #
check_ground=s.newPattern("check",["color",vector3( 0.2, 0.4, 0.6 ),"scale",0.025])
ground=s.newMaterial( "standard",[ "kc", check_ground,"kc",vector3( 1.0, 1.0, 1.0 ),"ka",check_ground ] ) #チェック青と白
#DarkTurquoiseのbox
s.materialBegin( plastic )
s.addObject( s.newObject( "box", [ "position",vector3( -1.0, -1.0, -1.0 ),vector3( 1.0, 1.0, 1.0 )] ) )
s.materialEnd()
#Firebrickのbox
s.materialBegin( plastic2 )
s.transformBegin( transform().translation( vector3(-3.0,0,0)))
s.addObject( s.newObject( "box", [ "position",vector3( -1.0, -1.0, -1.0 ),vector3( 1.0, 1.0, 1.0 )] ) )
s.transformEnd()
s.materialEnd()
#ForestGreenのbox z軸中心に45度回転
s.materialBegin( plastic3 )
s.transformBegin( transform().translation( vector3(3.0,0,0)))
s.transformBegin( transform().rotationAroundZ( pi*45.0/180 ))
s.addObject( s.newObject( "box", [ "position",vector3( -1.0, -1.0, -1.0 ),vector3( 1.0, 1.0, 1.0 )] ) )
s.transformEnd()
s.transformEnd()
s.materialEnd()
#Goldのbox
s.materialBegin( plastic4 )
s.transformBegin( transform().translation( vector3(-3.0,-3,0)))
s.addObject( s.newObject( "box", [ "position",vector3( -1.0, -1.0, -1.0 ),vector3( 1.0, 1.0, 1.0 )] ) )
s.transformEnd()
s.materialEnd()
#Goldenrodのbox
s.materialBegin( plastic5 )
s.transformBegin( transform().translation( vector3(0,-3,0)))
s.addObject( s.newObject( "box", [ "position",vector3( -1.0, -1.0, -1.0 ),vector3( 1.0, 1.0, 1.0 )] ) )
s.transformEnd()
s.materialEnd()
#GreenYellowのbox
s.materialBegin( plastic6 )
s.transformBegin( transform().translation( vector3(3.0,-3,0)))
s.addObject( s.newObject( "box", [ "position",vector3( -1.0, -1.0, -1.0 ),vector3( 1.0, 1.0, 1.0 )] ) )
s.transformEnd()
s.materialEnd()
#check模様の地面groundをpatchで作成しています。高さ(z軸)を-1.0にしてぴったり立方体とあわせています。
s.materialBegin( ground )
s.addObject( s.newObject( "patch", [ "points",vector3( -50, -50, -1.0 ),vector3( -50, 50, -1.0 ),vector3( 50, -50, -1.0 ),vector3( 50, 50, -1.0 )] ) )
s.materialEnd()
saver = s.newImager( "tga-saver", [ "file", "box_colors6.tga" ] )
s.imagerBegin( saver )
camera = s.newCamera( "pinhole", [ "eye", vector3( 0, -10, 5 ), "aim", vector3( 0, 0, 0 ) ] )
s.imagerEnd()
s.render( camera, 512, 300 )
Lightflowでリングをつくる
Lightflowには基本図形としてドーナツ(torus)を持っていない。RenderManやcgkitではtorusを呼び出すことができるので、関数を作ってLightflowでもできると思います。これは後ほど・・・。
ここではメタセコイアmetasequoiaで形状ドーナツ型を生成し、metalightで原点位置に配置し、カメラ位置、ライト位置を決めてPython形式を出力した。
今回作ったドーナツは相当小さいものを作ったので、半径や位置などの数字が小さくなっている。
ドーナツを拡大縮小し、45度回転させ、半径0.1の演習上に18個配置した。
#リストを準備してオブジェクト名を格納し、定義した位置をs.addObject
a=[]
deg=0
r=0.1
for i in range(18):
obj_="Obj"+str(i)
a.append(obj_)
s.materialBegin( Obj1_Mat0 )
s.transformBegin( transform().translation( vector3( r*sin(pi*deg/180.0),r*cos(pi*deg/180.0), 0 ) ) )
s.transformBegin( transform().rotationAroundZ( pi*45/180.0 ))
s.transformBegin( transform().scaling( vector3(1.2,0.8,1.0)))
a[i] = s.newObject( "mesh", [ "file" , "torus1.lfm" , 0 ] )
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.materialEnd()
s.addObject( a[i] )
deg=deg+20
続いて円周上でZ中心に20度ずつ回転させていった。
a=[]
deg=0
r=0.1
for i in range(18):
obj_="Obj"+str(i)
a.append(obj_)
s.materialBegin( Obj1_Mat0 )
#s.transformBegin( transform().rotationAroundY( pi*deg/180.0 ))
s.transformBegin( transform().translation( vector3( r*sin(pi*deg/180.0),r*cos(pi*deg/180.0), 0 ) ) )
s.transformBegin( transform().rotationAroundZ( pi*-1*deg/180.0 ))
s.transformBegin( transform().scaling( vector3(1.2,0.8,1.0)))
a[i] = s.newObject( "mesh", [ "file" , "torus1.lfm" , 0 ] )
s.transformEnd()
s.transformEnd()
s.transformEnd()
#s.transformEnd()
s.materialEnd()
s.addObject( a[i] )
deg=deg+20
次にX軸中心に90度回転させた。
>
a=[]
deg=0
r=0.1
for i in range(18):
obj_="Obj"+str(i)
a.append(obj_)
s.materialBegin( Obj1_Mat0 )
#s.transformBegin( transform().rotationAroundY( pi*deg/180.0 ))
s.transformBegin( transform().translation( vector3( r*sin(pi*deg/180.0),r*cos(pi*deg/180.0), 0 ) ) )
s.transformBegin( transform().rotationAroundZ( pi*-1*deg/180.0 ))
s.transformBegin( transform().rotationAroundX( pi*90/180.0 ))
s.transformBegin( transform().scaling( vector3(1.2,0.8,1.0)))
a[i] = s.newObject( "mesh", [ "file" , "torus1.lfm" , 0 ] )
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
#s.transformEnd()
s.materialEnd()
s.addObject( a[i] )
deg=deg+20
以上の配置の仕方をまとめて鎖のリングを作成した。
a=[]
deg=0
r=0.1
for i in range(18):
obj_="Obj"+str(i)
a.append(obj_)
s.materialBegin( Obj1_Mat0 )
#s.transformBegin( transform().rotationAroundY( pi*deg/180.0 ))
s.transformBegin( transform().translation( vector3( r*sin(pi*deg/180.0),r*cos(pi*deg/180.0), 0 ) ) )
s.transformBegin( transform().rotationAroundZ( pi*-1*deg/180.0 ))
s.transformBegin( transform().rotationAroundX( pi*90/180.0 ))
s.transformBegin( transform().scaling( vector3(1.4,0.85,1.0)))
a[i] = s.newObject( "mesh", [ "file" , "torus1.lfm" , 0 ] )
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
#s.transformEnd()
s.materialEnd()
s.addObject( a[i] )
deg=deg+20
b=[]
deg2=10
for k in range(18):
obj2_="Obj2"+str(k)
b.append(obj2_)
s.materialBegin( Obj1_Mat2 )
#s.transformBegin( transform().rotationAroundY( pi*deg/180.0 ))
s.transformBegin( transform().translation( vector3( r*sin(pi*deg2/180.0),r*cos(pi*deg2/180.0), 0 ) ) )
s.transformBegin( transform().rotationAroundZ( pi*-1*deg2/180.0 ))
s.transformBegin( transform().scaling( vector3(1.6,0.85,1.0)))
b[k] = s.newObject( "mesh", [ "file" , "torus1.lfm" , 0 ] )
s.transformEnd()
s.transformEnd()
s.transformEnd()
#s.transformEnd()
s.materialEnd()
s.addObject( b[k] )
deg2=deg2+20
Lightflowでレンダリング中エラー
abnormal program termination
Lightflowでレンダリング中、以下のようなエラーが出た。
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\Program Files(x86)\python\python.exe
abnormal program termination
Rendering 720 x 400 pixels
00:00:42 - 73.2%
Error (LfFault):
LfSaveTGABlock()
error writing "to2_8f.tga"
続行するには何かキーを押してください . . .
tmp_ve_a03400などテンポラリーファイルが残ってしまう。
気になるので削除した。
ViX.exe を終了してから、Lightflowを起動するとうまく走ります。
59秒かかった。
使い方としては面倒だけど、いろいろと実験できて面白い。
<< 4/8 >>