From c4287c226cc557056fd332e612784413ada46498 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Wed, 19 Jun 2024 14:55:37 +0200 Subject: [PATCH] add some comments on rendering options --- docs/src/examples/kinematic_loops.md | 2 +- docs/src/rendering.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/src/examples/kinematic_loops.md b/docs/src/examples/kinematic_loops.md index 00a0df9a..3870b929 100644 --- a/docs/src/examples/kinematic_loops.md +++ b/docs/src/examples/kinematic_loops.md @@ -138,7 +138,7 @@ plot(sol, idxs=[j2.s]) # Plot the joint coordinate of the prismatic joint (green ```@example kinloop import CairoMakie -Multibody.render(fourbar2, sol; x=-2, y = 3, z = 5, filename = "fourbar2.gif") # Use "fourbar2.mp4" for a video file +Multibody.render(fourbar2, sol; x=-2, y = 2, z = 3, filename = "fourbar2.gif") # Use "fourbar2.mp4" for a video file nothing # hide ``` diff --git a/docs/src/rendering.md b/docs/src/rendering.md index 966b8599..b9a3b074 100644 --- a/docs/src/rendering.md +++ b/docs/src/rendering.md @@ -18,6 +18,12 @@ After that, the [`render`](@ref) function is the main entry point to create 3D r - `render(model, solution)`: this method creates an animation corresponding to the mechanisms evolution in a simulation trajectory. - `scene, time = render(model, solution, t::Real)`: this method opens an interactive window with the mechanism in the configuration corresponding to the time `t`. Display `scene` to display the interactive window, and change the time by either dragging the slider in the window, or write to the observable `time[] = new_time`. +## Colors +Many components allows the user to select with which color it is rendered. This choice is made by providing a 4-element array with color values in the order (RGBA), where each value is between 0 and 1. The last value is the alpha channel which determines the opacity, i.e., 1 is opaque and 0 is invisible. + +## Rendering the world frame +The display of the world frame can be turned off by setting `world.render => false` in the variable map. + ## Rendering API