Day 5 - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Day 5

Description:

3 '' This shows a simple dynamic graphics output using SimAnimation. ... Approach to Runway. C:Program FilesSimscript3modelsHeathrow. Heathrow Airport Reprise ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 17
Provided by: jeffryge
Category:
Tags: day

less

Transcript and Presenter's Notes

Title: Day 5


1
Day 5
  • Section 9 - Contiuous Simulation
  • Exercise 9
  • Section 10 - Animation
  • Demonstration of SIMANIMATION
  • Exercise 10

F
2
Section 10 - Animation
  • Part 1 - Demonstration of SIMANIMATION

3
SimAnimation's Concept - Toward Object Oriented
Programming
  • Define an object with a process routine - say an
    airplane
  • Give it some characteristics - location, velocity
  • Attach routines for specific procedures - move to
    new location
  • Invoke routine by waiting

4
Use Processes to Control Motion
  • Initial velocity, location
  • Wait some time to let object move
  • Change something, say velocity
  • Wait some more time for object to move again
  • Dynamic graphic process is a temporary entity
    with motion attributes added (i.e.
    Dynamic Graphic Entity)

5
Some Definitions
6
Some Definitions (continued)
  • The universe is the space you're working in
    (miles)
  • A world view is that part of the universe you
    want to see on the screen at any given time
  • -100 miles to 100 miles horizontally
  • 25 miles to 75 miles vertically
  • A view port is that part of the screen containing
    the world view
  • 0 to 20,000 NDC units horizontally
  • 0 to 5,000 NDC units vertically

7
Viewing Transformation
  • Let vxform.v 2
  • Call setworld.r (-100,100,25,75)
  • Call setview.r (0,20000,0,5000)

8
  • 1 Preamble
  • 2
  • 3 '' This shows a simple dynamic graphics
    output using SimAnimation.
  • 4 '' It draws a shape and moves it around
    the screen.
  • 5 '' CACI Products Company
  • 6
  • 7 Normally mode is undefined
  • 8
  • 9 Processes include
  • 10 SHAPE
  • 11
  • 12 Dynamic graphic entities include
  • 13 SHAPE
  • 14
  • 15 Define minutes to mean units
  • 16
  • 17 Define ..END.OF.PROGRAM to mean Call
    messagebox.r ("Click to end program!","End of
    Program")
  • 18
  • 19 End ''Preamble

9
  • 1 Process SHAPE
  • 2
  • 3 Define .I as an integer variable
  • 4
  • 5 Let location.a(SHAPE)
    location.f(0.0, 0.0)
  • 6
  • 7 Let velocity.a(SHAPE)
    velocity.f(200.0, pi.c/4)
  • 8 Let orientation.a(SHAPE) pi.c/4
  • 9 Wait 16 minutes
  • 10
  • 11 Let velocity.a(SHAPE)
    velocity.f(200.0, - pi.c / 2)
  • 12 Let orientation.a(SHAPE) - pi.c /2
  • 13 Wait 11.6 minutes
  • 14
  • 15 Let velocity.a(SHAPE)
    velocity.f(200.0, 0.8 pi.c)
  • 16 For .I 1 to 100 do
  • 17 Add (pi.c / 10) to
    orientation.a(SHAPE)
  • 18 Wait 0.1 minutes
  • 19 Loop ''I 1 to 100 do

10
  • 1 Routine SET.GRAPHICS
  • 2
  • 3 '' Set maximum speed to 1 second of real
    time per unit of simulated time
  • 4
  • 5 Let timescale.v 100
  • 6
  • 7 '' Open a viewport
  • 8
  • 9 Let vxform.v 5
  • 10 Call setworld.r(0, 3277, 0, 2276)
  • 11 Call setview.r (0, 32767, 0, 32755)
  • 12
  • 13 End ''SET.GRAPHICS

11
Exercise 10
  • Approach to Runway
  • C\Program Files\Simscript3\models\Heathrow

12
Heathrow Airport Reprise
  • As a final exercise in simulation and modeling,
    write a SIMSCRIPT II.5 program to animate the
    flight of an airplane on its approach to Heathrow
    airport. The checkpoints through which the
    airplane must pass are listed below.
  • HEATHROW APPROACH CHECKPOINTS
  • X Y
  • -10 -1 (initial
    location)
  • - 5 0
  • 3 0
  • 6 4
  • 10 4

13
  • Preamble
  • '' Heathrow Airpot Animation Problem - CACI
    Products Company
  • '' Preliminary Code for Student Problem
  • '' The user must create an icon representing an
    airplane and
  • '' write a process to make the airplane move.
  • '' files HEATHROW.SRC, graphics.sg2 with
    lhw.icn (user).icn
  • Normally mode is undefined
  • Temporary entities include
  • MAP
  • Graphic entities include
  • MAP
  • Define ..DISPLAY.VIEW.PORT to mean 2
  • Define minute to mean units

14
  • Routine VECTOR
  • Given
  • .X1, ''Coordinates of first
    point
  • .Y1,
  • .X2, ''Coordinates of second
    point
  • .Y2,
  • .SPEED ''Speed of object
  • Yielding
  • .TIME, ''Time to go from first
    to second point
  • .DIRECTION ''Direction from first to
    second point (radians)
  • Define .X1,
  • .Y1,
  • .X2,
  • .Y2,
  • .SPEED,
  • .TIME,

15
  • Routine SET.GRAPHICS
  • Let timescale.v 100
  • '' Set up a display view port
  • Let vxform.v ..DISPLAY.VIEW.PORT
  • Call setworld.r (-11, 11, -11, 11)
  • Call setview.r (1000, 32000, 1000, 32000)
  • End ''SET.GRAPHICS

16
This page is intentionally blank
Write a Comment
User Comments (0)
About PowerShow.com