visual3d:documentation:pipeline:expressions:expression_numbers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:expressions:expression_numbers [2024/07/17 15:42] – removed sgranger | visual3d:documentation:pipeline:expressions:expression_numbers [2025/06/20 19:07] (current) – Added headers and cleaned up <code> tags. wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Expression Numbers ====== | ||
+ | |||
+ | There is current a single " | ||
+ | |||
+ | ===== Random ===== | ||
+ | |||
+ | rand(lo_value, | ||
+ | |||
+ | ==== Example: Generate a random number in the range 0 to 1 ==== | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | TEST1 = 0.220525 | ||
+ | </ | ||
+ | |||
+ | The default range for the random number is from 0 to 1. | ||
+ | |||
+ | ==== Example: Generate a random number within a range ==== | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | TEST2 = 2.232995 | ||
+ | </ | ||
+ | |||
+ | The output value occurs in the range from lo_value to hi_value. | ||
+ | |||
+ | ==== Example: Generate a random number in a range to match a signal ==== | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ::TEST3 = 2.808424+2.582592+2.346721+2.697052+2.662510+2.861250+2.843808+...(to number of frames) | ||
+ | </ | ||
+ | |||
+ | Using all three arguments will produce a random number in the range from lo_value to hi_value with the same number of components and frames as the argument signal. | ||
+ | |||
+ | ==== Example: Generate a specific number of random values ==== | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | ::TEST4 = 2.446495 + 2.718410 + 2.201863 | ||
+ | </ | ||
+ | |||
+ | If the signal argument is a number, then that number of random values from the range lo_value to hi_value are returned. | ||
+ | |||
+ | ==== Example: Create a TARGET with random values between 0 and 1 ==== | ||
+ | |||
+ | < | ||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | </ | ||
+ | |||
+ | View the resulting signal in the 3D viewer by turning on the target trail: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Example: create a TARGET with random values between 0 and 1 ==== | ||
+ | |||
+ | < | ||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | Note that all components contain different values | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Example: Create a TARGET where each frame is on a random location on the surface of a sphere of radius 1 ==== | ||
+ | |||
+ | < | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | COS(DERIVED:: | ||
+ | -COS(DERIVED:: | ||
+ | SIN(DERIVED:: | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | {{: | ||
visual3d/documentation/pipeline/expressions/expression_numbers.1721230937.txt.gz · Last modified: 2024/07/17 15:42 by sgranger