Upload
regina-parker
View
212
Download
0
Embed Size (px)
Citation preview
ES305Virtual Tools
in Engineering Design
Importing Objects
11-16-2009Prof. Searleman
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
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.
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)
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.
BBs in Andy’s Tutorial
■ Controller | Mouse Waiter■ Interface | 2D Picking■ Logics | Calculator | Op
■ Parameters & ParamOp
■ Logics | Text | 2D Text■ Controller | Keyboard Controller
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
Controller|Mouse Waiter
detects mouse actionsnote: - Mouse Position
is in screen coords
- delete unused pOuts, bOuts, …0
Interface|2DPicking
returns the 3D entity, the normal and the exact position of the 2D mouse pick
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
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)
Create ParamOp
■ Right-click on script■ Select “Add Parameter Operation”
Logics\Calculator|Op BB
■ Encapsulates a ParamOp in a BB
■ Use to perform an operation once at a given time
Parameters
■ Input parameters, in blue■ Output parameters, in green■ Local parameters, in red
Parameter shortcuts(copy; paste as shortcut)
Interface | Text | 2D Text
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