ProtoFlux:Random Point In Cone: Difference between revisions

From Resonite Wiki
Created a page for the Random Point In Cone node.
 
touchup
Line 14: Line 14:
|}}
|}}


The '''Random Point In Cone''' node takes in a height and a base radius, then returns a random [[Type:float3|float3]] value of a point in a cone (taking into account the height and the base radius provided, exclusive).
The '''Random Point In Cone''' node returns a random point within the bounds of a [https://en.wikipedia.org/wiki/Cone cone] with the given <code>Height</code> and <code>BaseRadius</code> centered at <code>[0; 0; 0]</code>.


{{Note|This node constantly changes its value every frame, if you want to use this value, make sure to either [[ProtoFlux:Write|Write]] to a [[ProtoFlux:Data Model Store|Variable]] or use it within that frame.|warning}}
{{ProtoFluxRandomNodeWarning}}


== Inputs ==
== Inputs ==


=== Height ([[Type:float|float]]) ===  
=== Height ([[Type:float|float]]) ===


The height of the cone (tip side).
The height of the cone.


=== BaseRadius ([[Type:float|float]]) ===
=== BaseRadius ([[Type:float|float]]) ===


The size of the circle base of the cone.
The radius of the circle base of the cone.


== Outputs ==
== Outputs ==
Line 32: Line 32:
=== * ([[Type:float3|float3]]) ===
=== * ([[Type:float3|float3]]) ===


The random result.
The random result. The center of the cone is at <code>[0; 0; 0]</code>, making the <code>y</code> field anywhere between <code>-BaseHeight/2</code> and <code>+BaseHeight/2</code>, where the former is the circle side and the latter is the tip side.


[[Category:ProtoFlux:Math:Random:Point]]
[[Category:ProtoFlux:Math:Random:Point]]

Revision as of 19:25, 15 April 2025

Random Point In Cone
Height
*
BaseRadius
Point

The Random Point In Cone node returns a random point within the bounds of a cone with the given Height and BaseRadius centered at [0; 0; 0].

This node is a random node. Random nodes generate a new output every time they are accessed during an impulse chain, even if during the same frame. To reuse the same value for multiple impulse nodes, you must write the value to a Local, Store, or Data Model Store before operating on it.

Inputs

Height (float)

The height of the cone.

BaseRadius (float)

The radius of the circle base of the cone.

Outputs

* (float3)

The random result. The center of the cone is at [0; 0; 0], making the y field anywhere between -BaseHeight/2 and +BaseHeight/2, where the former is the circle side and the latter is the tip side.