Metropoli BBS
VIEWER: pv3d_val.bas MODE: TEXT (ASCII)
CLS
'========================================================================
PRINT "PV3D value animation file generator V1.00"
PRINT "By L Lecointe Copyright 1993"
PRINT
PRINT "Sample program to generate a *.VAL file for the PV3D Modeler software"
PRINT
'========================================================================

'flag parameter
sx% = 1               'PV3D X scale (not POV scale)      float
sy% = 2               'PV3D Y scale (not POV scale)      float
sz% = 4               'PV3D Z scale (not POV scale)      float
tx% = 8               'X axis translation                float
ty% = 16              'Y axis translation                float
tz% = 32              'Z axis translation                float
rx% = 64              'X rotation in degre 0->360        int
ry% = 128             'Y rotation in degre 0->360        int
rz% = 256             'Z rotation in degre 0->360        int
cr% = 512             'Red   colors 0.0->1.0             float
cg% = 1024            'Green colors 0.0->1.0             float
cb% = 2048            'Blue  colors 0.0->1.0             float
ca% = 4096            'Alpha colors 0.0->1.0             float
'Constant
control$ = "PV3D_VALUE"
nbframe% = 0
noused% = 0
noused2 = 0
flag% = &HFFFF
degre.to.rad = 3.14116 / 180


CLS
INPUT "Input the file name      : ", name$
INPUT "Imput the description file :", descrip$
INPUT "Input the number of step : ", nbframe%
INPUT "Input the start value    : ", startvalue
INPUT "Input the end value      : ", endvalue

'flag construction
'in this case all parameter are available  with this formula in PV3D

flag% = sx% + sy% + sz% + tx% + ty% + tz% + rx% + ry% + rz% + cr% + cg% + cb% + ca%

'if only translation  and alpha
'flag% = tx% + ty% + tz%  + ca%

OPEN name$ FOR OUTPUT AS #1
PRINT #1, control$
PRINT #1, descrip$
PRINT #1, nbframe%, noused%, flag%, noused2
stepvalue = (endvalue - startvalue) / nbframe%
FOR i = 1 TO nbframe%
'put the formula here
'sample formula
'
' y=sin (startvalue)
' y=cos (startvalue)
' y=startvalue^2
' y=a*(startvalue)+b

y = SIN(startvalue * degre.to.rad)
PRINT y
PRINT #1, y
startvalue = startvalue + stepvalue
NEXT i
CLOSE #1




[ RETURN TO DIRECTORY ]