Category : Printer + Display Graphics
Archive   : PLYDAT16.ZIP
Filename : ROBARM.PI

 
Output of file : ROBARM.PI contained in archive : PLYDAT16.ZIP
//
// Animation of a robot arm solving the "Towers of Hanoi" problem.
// Author: Alexander Enzmann
//
viewpoint {
from <-4,14,-30>
at <4,2,0>
up <0,1,0>
angle 13
resolution 320, 160
aspect 2
}

background midnight_blue
light <10, 20, -20>

include "..\colors.inc"
include "robtex.inc"

// How many steps will be taken between moves? They are divided
// between three sub-steps: up, over, down. Each of these will
// be assumed to take 10 frames, with 30 frames for the move.
define frames_per_submove 6
define submoves_per_move 6
define frames_per_move submoves_per_move * frames_per_submove
define total_moves 7

// Define the number of frames in the animation
start_frame 0
end_frame total_moves * frames_per_submove * submoves_per_move - 1

define move floor(frame / frames_per_move)
define submove floor(fmod(frame, frames_per_move) / frames_per_submove)
define submove_increment fmod(frame, frames_per_submove) / (frames_per_submove - 1)

// Build the pegs
include "pegs.inc"
pegs { translate }

// Build and position the wafers
include "robwafer.inc"
wafer0 { translate }
wafer1 { translate }
wafer2 { translate }

// Build and align the robot arm
define robot_arm_alpha -atan(moving_wafer_offset / peg_distance)
define robot_arm_theta -asin(0.5 * (wafer_width - 0.1))

define hand_length 0.3 + 1.5 + 2 * cos(robot_arm_theta)
define distancexy sqrt(peg_distance * peg_distance +
moving_wafer_offset * moving_wafer_offset) -
hand_length
define distancez (moving_wafer_height + 0.4) - 3
define wafer_distance sqrt(distancez * distancez + distancexy * distancexy)

define robot_arm_beta -asin(distancez / distancexy)
define section2_offset wafer_distance - 4

include "robarm.inc"
robot_arm

// Add a floor underneath the arm & the pegs
object {
disc <4, -0.0001, 0>, <0, 1, 0>, 10
texture { checker matte_brown, matte_orange }
}
// Here's how we play:
//
// Stage 1:
//
// | | |
// *** | |
// ***** | |
// ******* | |
// --------- --------- ---------
//
// Stage 2:
//
// | | |
// | | |
// ***** | |
// ******* *** |
// --------- --------- ---------
//
// Stage 3:
//
// | | |
// | | |
// | | |
// ******* *** *****
// --------- --------- ---------
//
// Stage 4:
//
// | | |
// | | |
// | | ***
// ******* | *****
// --------- --------- ---------
//
// Stage 5:
//
// | | |
// | | |
// | | ***
// | ******* *****
// --------- --------- ---------
//
// Stage 6:
//
// | | |
// | | |
// | | |
// *** ******* *****
// --------- --------- ---------
//
// Stage 7:
//
// | | |
// | | |
// | ***** |
// *** ******* |
// --------- --------- ---------
//
// Stage 8:
//
// | | |
// | *** |
// | ***** |
// | ******* |
// --------- --------- ---------


  3 Responses to “Category : Printer + Display Graphics
Archive   : PLYDAT16.ZIP
Filename : ROBARM.PI

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/