User Tools

Site Tools


visual3d:documentation:pipeline:expressions:expression_numbers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:expressions:expression_numbers [2024/09/05 18:32] – [Random] wikisysopvisual3d: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 ====== ====== Expression Numbers ======
  
-==== Random ====+There is current a single "numbers"-related expression function. 
 + 
 +===== Random =====
  
 rand(lo_value,hi_value,signal) - random number in the range (lo_value,hi_value) rand(lo_value,hi_value,signal) - random number in the range (lo_value,hi_value)
  
-<code> +==== ExampleGenerate a random number in the range 0 to 1 ====
-Example rand() will generate a random number in the range 0 to 1+
  
 +<code>
 Set_Pipeline_Parameter_From_Expression Set_Pipeline_Parameter_From_Expression
 /PARAMETER_NAME=TEST1 /PARAMETER_NAME=TEST1
Line 15: Line 17:
  
  TEST1 = 0.220525  TEST1 = 0.220525
 +</code>
  
-Example : rand(lo_value,hi_value) will generate a random number in the range lo_value to hi_value+The default range for the random number is from 0 to 1.
  
 +==== Example: Generate a random number within a range ==== 
 +
 +<code>
 Set_Pipeline_Parameter_From_Expression Set_Pipeline_Parameter_From_Expression
 /PARAMETER_NAME=TEST2 /PARAMETER_NAME=TEST2
Line 25: Line 31:
  
  TEST2 = 2.232995  TEST2 = 2.232995
 +</code>
  
-Example : rand(lo_value,hi_value,signal) will generate a random number in the range lo_value to hi_value with the same number of components and frames as signal.+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 ==== 
 +
 +<code>
 Set_Pipeline_Parameter_From_Expression Set_Pipeline_Parameter_From_Expression
 /PARAMETER_NAME=TEST3 /PARAMETER_NAME=TEST3
Line 35: Line 45:
  
 ::TEST3 = 2.808424+2.582592+2.346721+2.697052+2.662510+2.861250+2.843808+...(to number of frames) ::TEST3 = 2.808424+2.582592+2.346721+2.697052+2.662510+2.861250+2.843808+...(to number of frames)
 +</code>
  
-Example : rand(lo_value,hi_value,signal). If signal is a number, that number of values are returned.+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 ==== 
 +
 +<code>
 Set_Pipeline_Parameter_From_Expression Set_Pipeline_Parameter_From_Expression
 /PARAMETER_NAME=TEST4 /PARAMETER_NAME=TEST4
Line 45: Line 59:
  
 ::TEST4 = 2.446495 + 2.718410 + 2.201863 ::TEST4 = 2.446495 + 2.718410 + 2.201863
 +</code>
  
-Example : Create TARGET with random values between 0 and 1+If the signal argument is 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 ====
 +
 +<code>
 Create_Target Create_Target
 /SIGNAL_NAMES=TEST5 /SIGNAL_NAMES=TEST5
Line 55: Line 73:
 ; ;
  
-View the resulting signal in the 3D viewer by turning on the target trail 
 </code> </code>
 +
 +View the resulting signal in the 3D viewer by turning on the target trail:
  
 {{:random_target.jpg}} {{:random_target.jpg}}
  
-<code>Example: create a TARGET with random values between 0 and 1.+==== Example: create a TARGET with random values between 0 and 1 ====
  
 +<code>
 Create_Target Create_Target
 /SIGNAL_NAMES=TEST6 /SIGNAL_NAMES=TEST6
Line 68: Line 88:
 ! /INCLUDE_CALFILE=FALSE ! /INCLUDE_CALFILE=FALSE
 ; ;
 +</code>
  
 Note that all components contain different values Note that all components contain different values
-</code> 
  
-{{:Random7.jpg}}{{:random7view.jpg}}+{{:Random7.jpg}} {{:random7view.jpg}}
  
-<code> +==== Example: Create a TARGET where each frame is on a random location on the surface of a sphere of radius 1 ====
-Example : Create a TARGET where each frame is on a random location on the surface of a sphere of radius 1+
  
 +<code>
 Evaluate_Expression Evaluate_Expression
 /EXPRESSION=RAND(-PI(),PI(),FRAME_NUMBERS::ORIGINAL::FRAMES) /EXPRESSION=RAND(-PI(),PI(),FRAME_NUMBERS::ORIGINAL::FRAMES)
visual3d/documentation/pipeline/expressions/expression_numbers.1725561135.txt.gz · Last modified: 2024/09/05 18:32 by wikisysop