Show in Contents
Add to Favorites
Home: Autodesk Maya Online Help
Make boats float
Open water effects
Create Ponds
Create an Interactive boat simulation
You
can create an interactive motor boat simulation by combining an
ocean, a motor boat, and some hotkeys to drive the boat.
- Select
Fluid Effects > Ocean > Create Ocean > .
The Create Ocean options
window appears.
- Turn
on Attach to Camera and Create
Preview Plane, and then click Create Ocean.
- Select
the boat geometry.
- Select
Fluid Effects > Ocean > Make Motor Boats.
Maya attaches a locator to the boat with built-in
expressions to simulate buoyancy effects.
- Select
the perspective camera (persp) and select
Edit > Group.
This creates a group and puts the perspective camera in it.
- In
the Connection Editor(Windows
> General Editors > Connection Editor), do the
following:
- Connect
the boat locator (created in step #4) Translate x and Translate
z attributes to the transform (ocean height field) Translate x and
Translate z attributes respectively.
- Connect
the locator Translate x and Translate z attributes to the camera group
(created in step #5) Translate x and Translate z attributes.
This connects the movement of the boat along
the ocean plane to the ocean and to the movement of the camera.
- Select
the boat locator and in the Attribute Editor open
the Extra Attributes section.
- Switch
to shaded mode.
- Playback
the scene and adjust the throttle and rudder settings.
To speed up the simulation, you can make the Wave
Turbulence zero on the ocean shader and instead increase Num
Frequencies. Increasing the Wave Height also
makes the simulation more dramatic.
Hotkeys
Create hotkeys for the following commands and
use them to drive the boat.
Stop Boat Key
setAttr locator1.throttle 0 setAttr locator1.rudder 0
Increase Throttle
float $t = `getAttr locator1.throttle`; setAttr locator1.throttle ($t + 0.5);
Decrease Throttle
float $t = `getAttr locator1.throttle`; $t -= 0.5; if( $t < 0 ) $t = 0.0; setAttr locator1.throttle $t;
rudder Left
float $t = `getAttr locator1.rudder`; $t += 2.0; if( $t > 20 ) $t = 20; setAttr locator1.rudder $t;
rudder Right
float $t = `getAttr locator1.rudder`; $t -= 2.0; if( $t < -20 ) $t = -20; setAttr locator1.rudder $t;