Maritime Tutorial 6 : Adding an Animated Buoy
In marine scenarios, you might want to add navigation buoys that follow the movements of the water's surface without using dynamics computations, in order to maintain an acceptable level of performance. To avoid these extra computations, make sure you do not add parts or collision geometries to the buoy.
If you need the buoy to collide with other objects in the scene, you will need to create a full mechanism with buoyancy rather than use this extension.
To add an animated buoy:
- Create a new scene.
- Add an ocean by double-clicking Marine >Â Ocean in the Toolbox.
- This example requires a mechanism with a buoy graphical asset. Double-click Basics >Â Empty Mechanism.
- Rename the mechanism to "Buoy Mechanism" in its Properties panel.
- Right-click the mechanism and select Open Mechanism....
- In the resulting dialog box, you will be prompted to save changes. Click Save All.
- In the mechanism, double-click Graphics >Â Galleries From Files....
- In the resulting dialog box, use the Browse button to select the
buoy.vxgraphicgallery
file found in your Vortex Studio Sample folder.
- Switch back to the scene.
- Double-click Marine >Â Buoy in the Toolbox to add a buoy extension.
- Rename the Buoy to "Buoy Extension" in its Properties panel.
- Double-click Basic >Â Connection Container in the Toolbox.
- Click the buoy extension in the Explorer panel.
- From the buoy extension's properties, click and drag its World Transform into the Connection Editor window.
- Click the buoy mechanism in the Explorer panel.
- From the buoy mechanism's properties, click and drag its Parent Transform into the Connection Editor window.
- Connect the World Transform output to the Parent Transform input.
- Switch to the 3DÂ View window and play the scene. The buoy will now follow the movement of the waves.
You can also add multiple buoys to a scene and have them all follow the ocean waves. To avoid having to create multiple connections for every mechanism in your scene, you should add the extension and connection directly in the buoy mechanism, then add instances of that mechanism directly to the scene.
To add multiple buoys:
- Open the buoy mechanism you created above.
- Double-click Marine >Â Buoy in the Toolbox to add a buoy extension.
- Double-click Basics >Â Connection Container in the Toolbox.
- Click the buoy extension in the Explorer panel.
- Rename the buoy to "Buoy Extension" in its Properties panel.
- From the buoy extension's Properties panel, click and drag its World Transform into the Connection Editor window.
- Click the buoy Graphics Gallery in the Explorer panel.
- From the buoy Graphics Gallery's Properties panel, click and drag its Parent Transform into the Connection Editor window.
- Connect the World Transform output to the Parent Transform input.
- Create a new scene.
- Add an ocean by double-clicking Marine >Â Ocean in the Toolbox.
- Double-click Basics >Â Mechanism From Files.
- In the resulting dialog box, use the Browse button to select your buoy mechanism file.
- Copy and paste the buoy and place the copies around the scene using the Transform Toolbar.
- Play the scene and all the buoys will follow the movements of the ocean waves.