16
ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman [email protected]

ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman [email protected]

Embed Size (px)

Citation preview

Page 1: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

ES305Virtual Tools

in Engineering Design

Importing Objects

11-16-2009Prof. Searleman

[email protected]

Page 2: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Overview■ Virtools

■ 3D frames■ Hierarchy Manager■ 2D Frames & Displaying Text■ Mouse Waiter & 2D Picking■ Parameter Ops

Homework:■ Virtools Exercise 4: due 11/18

Quiz in class on Monday, 11/23

Page 3: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

On/Off Details

1.BB is inactive. 2.The user presses the 1 key. On is activated, the

BB performs an action and activates the Out On output (violet link). The BB is now active and will call itself every frame and perform an action until the Off input is activated.

3.The user presses the 2 key. Off is activated, the BB performs an action and activates the Out Off output (pink link). The BB is now inactive. Go back to 1.

Page 4: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

A few caveats

■ Note that Switch-On-Key, once activated, will react to holding down a key as several inputs■ Example: hit an F to go forwards 1 unit, hit B

to go backwards 1 unit

■ Solution:■ Deactivate the Switch-on-key when a key is

hit■ Run the script associated with that key■ Reactivate Switch-on-key (possibly with a

small delay)

Page 5: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Logics | Streaming | Parameter Selector

■ If In k is activated, “selected” parameter will be pIn k

■ Variable number of inputs (v)

Note: The default datatype of the selected parameter is float. To change this, right click on the triangle for the parameter output “Selected” and change its datatype. The pIns will change to the new datatype.

Page 6: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

BBs in Andy’s Tutorial

■ Controller | Mouse Waiter■ Interface | 2D Picking■ Logics | Calculator | Op

■ Parameters & ParamOp

■ Logics | Text | 2D Text■ Controller | Keyboard Controller

Page 7: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Selecting an Object

Detects mouse actions:• Mouse Position is in screen coords• delete unused pOuts, bOuts• Note the “S” (can edit settings)• also see Mouse Controller

Also note – can see the object that was picked using a shortcut in trace mode

Page 8: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Controller|Mouse Waiter

detects mouse actionsnote: - Mouse Position

is in screen coords

- delete unused pOuts, bOuts, …0

Page 9: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Interface|2DPicking

returns the 3D entity, the normal and the exact position of the 2D mouse pick

Page 10: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Displaying Text

2D Frame used to display text

Create Font BB typically in Level Script

Use copy/paste-as-shortcut to use the font in another script

Page 11: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

ParamOp

■ Parameter operations are used to perform a computation

■ ParamOps have 2 input parameters & 1 output parameter (no target)

ParamOp is ParamOp is part of the data part of the data flow (blue), not flow (blue), not the behavior flow the behavior flow (red)(red)

Page 12: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Create ParamOp

■ Right-click on script■ Select “Add Parameter Operation”

Page 13: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Logics\Calculator|Op BB

■ Encapsulates a ParamOp in a BB

■ Use to perform an operation once at a given time

Page 14: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Parameters

■ Input parameters, in blue■ Output parameters, in green■ Local parameters, in red

Parameter shortcuts(copy; paste as shortcut)

Page 15: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Interface | Text | 2D Text

Page 16: ES305 Virtual Tools in Engineering Design Importing Objects 11-16-2009 Prof. Searleman jets@clarkson.edu

Controllers | Keyboard

Emulates a joystick

Maps keys to Joystick messages, as follows:Num 8 -> Joy_UpNum 2 -> Joy_DownNum 4 -> Joy_LeftNum 6 -> Joy_RightInsert -> Button 1Home -> Button 2Prior -> Button 3Delete -> Button 4End -> Button 5Next -> Button 6