home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 3
/
Meeting_Pearls_III.iso
/
Pearls
/
gfx
/
Real3D-Tools
/
Particle
/
crepart.rpl
next >
Wrap
Text File
|
1993-11-23
|
3KB
|
126 lines
?& CREPART NOT ?IF
1 CONSTANT CREPART
FVARIABLE Xvel
FVARIABLE Yvel
FVARIABLE Zvel
FVARIABLE Xvel2
FVARIABLE Yvel2
FVARIABLE Zvel2
FVARIABLE Spin
FVARIABLE Quantity
VARIABLE aPARTICLE
: GetRand
Xvel F@ RANDOM F* Xvel2 F@ RANDOM F* F-
Yvel F@ RANDOM F* Yvel2 F@ RANDOM F* F-
Zvel F@ RANDOM F* Zvel2 F@ RANDOM F* F-
;
: GetRand2
Spin F@ RANDOM F* Spin F@ RANDOM F* F-
Spin F@ RANDOM F* Spin F@ RANDOM F* F-
Spin F@ RANDOM F* Spin F@ RANDOM F* F-
;
: .crepart
O_GETSEL
"VVEL" O_FINDTAG DUP ( check VVEL tag isn't already there )
IF
"OK" "Please Remove existing VVEL TAG"
GET_KEY DROP
EXIT
ELSE
DROP
ENDIF
O_GETSEL
"VSPI" O_FINDTAG DUP ( check VVEL tag isn't already there )
IF
"OK" "Please Remove existing VSPI TAG"
GET_KEY DROP
EXIT
ELSE
DROP
ENDIF
O_GETSEL
0 = IF ( check for no items selected )
"OK" "No objects selected" GET_KEY DROP
EXIT
ELSE
DROP
ENDIF
O_GETSEL
2 DEPTH > IF ( check only one object selected )
"Continue" "More than one object selected - Aborted"
GET_KEY DROP
EXIT
ELSE
DROP
ENDIF
1.00 Xvel F!
Xvel "1st X Velocity?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
1.00 Xvel2 F!
Xvel2 "2nd X Velocity?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
1.00 Yvel F!
Yvel "1st Y Velocity?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
1.00 Yvel2 F!
Yvel2 "2nd Y Velocity?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
1.00 Zvel F!
Zvel "1st Z Velocity?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
1.00 Zvel2 F!
Zvel2 "2nd Z Velocity?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
10.00 Spin F!
Spin "Enter Spin Factor" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
50.00 Quantity F!
Quantity "How many particles?" GET_FLT
NOT IF
EXIT ( user aborted )
ENDIF
Quantity F@ 1 F+ Quantity F!
O_GETSEL
aPARTICLE !
iLOCK_EXCL O_LOCK
Quantity F@ 1 DO ( Start loop from 1 to Quantity )
0 aPARTICLE @
O_GETCURR
0
M_DUPLICATE ( Duplicate object )
O_GETSEL
"CEND" ( define TAG )
GetRand "VVEL" O_CREATAG DROP
DROP
O_GETSEL
"CEND" ( define TAG )
GetRand2 "VSPI" O_CREATAG DROP
DROP
LOOP
0 aPARTICLE @
O_DELETE
iLOCK_REMOVE O_LOCK
DROP
DROP
DROP
lWR_ALL
;
?ENDIF