home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
Japan
/
CSK
/
obj
/
sol25.tcl
< prev
next >
Wrap
Text File
|
2017-09-21
|
1KB
|
49 lines
# NOTE: we have to add 'vs_H_Init_' prefix for initialize
# you must not CHANGE function name!!.
proc vs_H_Init_MoveOnZ001 { obj event userData } {
vsNewVariable $obj m_CountZ000 0
vsNewVariable $obj m_DirectionZ000 1
}
# NOTE: we have to add 'vs_H_Periodic_' prefix for periodic task
# you must not CHANGE function name!!.
proc vs_H_Periodic_MoveOnZ001 { obj event userData } {
global vsCSLocal
global vsTclScript
global vsRelative
global vsContinue
# copy to local variables.
set count [vsGetVariable $obj m_CountZ000]
set direction [vsGetVariable $obj m_DirectionZ000]
if {$direction == 1} {
# Z positive direction.
vsTranslate $obj 0.0 0.0 -0.1 $vsCSLocal $vsRelative
} else {
# Z negative direction.
vsTranslate $obj 0.0 -0.001 -0.1 $vsCSLocal $vsRelative
}
set count [expr $count+1]
if {$count > 210} {
if {$direction == -1} {
vsTranslate $obj 0.0 0.21 0.0 $vsCSLocal $vsRelative
}
# turn around.
vsRotateAngle $obj 0.0 180.0 0.0 $vsCSLocal $vsRelative
set direction [expr $direction*-1]
# reset counter.
set count 0
}
vsSetVariable $obj m_CountZ000 $count
vsSetVariable $obj m_DirectionZ000 $direction
return $vsContinue
}