POVファイルを作る
ご注意
別途外部アプリケーション等必要です。
参考 http://www.povray.org/
LET N=51 LET XS=-5 LET XE=5 LET YS=-5 LET YE=5 LET ZS=-5 LET ZE=5 LET MODE=0 INPUT PROMPT "SAVE FILENAME(.POV)=":F$ IF POS(F$,".")=0 THEN LET F$=F$ & ".POV" OPEN #1:NAME F$ PRINT #1:"#include ";CHR$(34);"colors.inc";CHR$(34) !'ヘッダー部はコピペ PRINT #1:"camera {" PRINT #1:" sky <0,1,0>" PRINT #1:" location <0,8,-8>" PRINT #1:" look_at <0,0,0>" PRINT #1:"}" PRINT #1:"light_source {y*5 color 1}" PRINT #1:"background { color White }" PRINT #1 PRINT #1:"#declare Default = texture {" PRINT #1:" pigment { color rgb <0,0.5,1> }" PRINT #1:" finish { ambient 0.2 specular 0.7 roughness 0.05 }" PRINT #1:"}" PRINT #1 PRINT #1:"mesh2 {" PRINT #1:" vertex_vectors {" PRINT #1:" ";N*N;"," FOR J=0 TO N-1 LET Z=ZS+(ZE-ZS)/(N-1)*J FOR I=0 TO N-1 LET X=XS+(XE-XS)/(N-1)*I LET Y=FUNC(MODE,X,Z) LET Y=MIN(YE,MAX(Y,YS)) PRINT #1:"<";FORM$(X);",";FORM$(Y);",";FORM$(Z);">"; IF I=N-1 AND J=N-1 THEN PRINT #1 PRINT #1:" }" ELSE PRINT #1:","; IF MOD(I+J*N+1,3)=0 THEN PRINT #1 END IF NEXT I NEXT J PRINT #1 PRINT #1:" face_indices {" PRINT #1:" ";2*(N-1)^2;"," FOR I=0 TO N-2 FOR J=0 TO N-2 PRINT #1:"<";STR$(J+N*I);",";STR$(J+1+N*I);",";STR$(J+1+N*(I+1));">,"; PRINT #1:"<";STR$(J+N*I);",";STR$(J+1+N*(I+1));",";STR$(J+N*(I+1));">"; IF I=N-2 AND J=N-2 THEN PRINT #1 ELSE PRINT #1:"," NEXT J NEXT I PRINT #1:" }" PRINT #1:" texture { Default }" PRINT #1:"}" CLOSE #1 END
EXTERNAL FUNCTION FORM$(X) LET FORM$=LTRIM$(USING$("---%.######",X)) END FUNCTION
EXTERNAL FUNCTION FUNC(MODE,X,Y) SELECT CASE MODE CASE 0 LET FUNC=COS(5*SQR(X*X+Y*Y)) CASE 1 LET FUNC=X*Y*(X^2-Y^2) CASE 2 LET FUNC=(X^2-Y^2)/2 CASE 3 LET FUNC=EXP(-X^2-Y^2)*(X^2+Y^2) CASE 4 IF (X^2-1)*(X^2-9)*(Y^2-1)*(Y^2-9)>0 THEN LET FUNC=2 ELSE LET FUNC=0 END IF CASE 5 LET Z=4-X^2-Y^2 IF Z>0 THEN LET FUNC=SQR(Z) ELSE LET FUNC=0 END SELECT END FUNCTION
|