Functions and Visual Effects - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Functions and Visual Effects

Description:

Functions and Visual Effects Chapter 6 Part 3 Built-in Functions We have been using built-in functions so far * How a Function Works A function Receives value(s) as ... – PowerPoint PPT presentation

Number of Views:143
Avg rating:3.0/5.0
Slides: 19
Provided by: Anthon237
Category:

less

Transcript and Presenter's Notes

Title: Functions and Visual Effects


1
Functions and Visual Effects
  • Chapter 6 Part 3

2
Built-in Functions
  • We have been using built-in functions so far

3
How a Function Works
  • A function
  • Receives value(s) as arguments in parameters
  • Performs computations on the value(s)
  • Returns (sends back) a value

4
Types of Functions
  • The function type depends on the type of value it
    returns
  • Examples
  • Number
  • Specific object
  • Boolean (true or false)
  • Color
  • Other property values

5
Create Function
  • Click on create new function in class or world
    you want it to be in
  • Name function and choose type of function
  • A blank function will be created with return
    statement
  • Value will be returned when function is done
  • Place value you want returned in return statement

6
Function Window
  • Since no action is performed in a function all
    instructions will be performed in sequential
    order
  • No need for Do in order and Do together
  • All will be Do in order
  • Notice that you can place
  • return elsewhere in function

7
Calorie Example
  • A high school jock wants to know how many
    calories a cookie has
  • He asks a lunch lady
  • She consults the newly created calorie function
  • 1 meter wide cookie 1000 calories

Number Function calories Parameter food Local
Number variable numCalories If food
cookie numCalories cookies width
1000 Return numCalories
8
Algorithm Translated to Alice
  • My first method has jock ask lunch lady for the
    calories in the cookie
  • The lunch lady checks how many calories with the
    calorie function and answers with the amount of
    calories

9
Visual Effects and Animation
  • Billboards
  • Fog
  • Vehicles
  • Pose
  • Programming the Camera
  • Creating Dummy Objects

10
Billboards
  • Graphical images that have been inserted into the
    world
  • Can insert images that are JPEG, GIF, TIF
  • Known as Billboard
  • Images are flat, 2D with height and widthno
    depth
  • Can be used as backgrounds or scenery or used to
    giveinfo to the viewer!

11
Information Billboard
  • Can be used as sign for instructions

12
Creating Billboard
  • Can import images using Make Billboard
  • In File menu

13
Fog
  • Alice can give a look of mist to the world
  • The entire world becomes less visible

14
Vehicle Property
  • To have two objects move as one
  • One object will be carried by another object
  • Ex person on horse
  • Horse is vehicle for person
  • Choose properties tab
  • In property of object being carried
  • In vehicle choose object doing carrying

15
Pose
  • Once an object has been put into a position or
    pose, the pose can be restored during an
    animation
  • Pose is a property of an object
  • setPose is a method of an object

16
Programming the Camera
  • Camera can be programmed just like other objects
  • All the same primitive methods and functions are
    available for it
  • Point at, Move, Turn, etc.
  • Camera can also be a vehicle for other objects

17
Creating Dummy Objects
  • Dummy objects are invisible objects that are
    placed in the world
  • Camera then moves to the invisible object toget
    different perspectives

18
Homework
  • Read chapter 6 sections 6, 8, 9
  • Do tutorial 6 and 7
  • Do lab exercises
  • Answer questions in handout
  • Due one week after assigned with 1 week grace
Write a Comment
User Comments (0)
About PowerShow.com