Difference between revisions of "API Panel.PCloud.Create"

From Flowcode Help
Jump to navigationJump to search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
<sidebar>API contents</sidebar>
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Creates a new point cloud tied to a position handle
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Create'''
 
+
|-
<div style="width:25%; float:right" class="toc">
+
| colspan="2" | Creates a new point cloud tied to a position handle&nbsp;
====Class hierarchy====
+
|-
[[API Panel|Panel]]
+
|-
:[[API Panel.PCloud|PCloud]]
+
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
::[[API Panel.PCloud|Create]]
+
| width="90%" | Pos
</div>
+
|-
__TOC__
+
| colspan="2" | The position to display the cloud at&nbsp;
 
+
|-
==Parameters==
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
[[Variable Types|HANDLE]] ''Pos''
+
| width="90%" | DrawMode
:The position to display the cloud at
 
 
 
[[Variable Types|UINT]] ''DrawMode''
 
:The appearance of the points
 
:''Typical values for this parameter:''
 
::{| class="wikitable" width="65%"
 
 
|-
 
|-
! width="30%" |Name
+
| colspan="2" | The appearance of the points&nbsp;
! width="55%" |Description
 
 
|-
 
|-
|Mode_Point
+
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
|Displays cloud as points
+
| width="90%" | RGBA
 
|-
 
|-
|Mode_Line
+
| colspan="2" | The default colour of the points&nbsp;
|Displays cloud as joined lines
 
 
|-
 
|-
|Mode_Solid
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
|Displays cloud as a solid surface
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
[[Variable Types|ULONG]] ''RGBA''
 
:The default colour of the points
 
 
 
==Return value==
 
[[Variable Types|HANDLE]]
 
 
A handle to the new point cloud
 
  
  
Line 47: Line 30:
 
[[File:SIMAPI Panel.PCloud Landscape.png|thumb|150px|Landscape using mandelbrot set]]
 
[[File:SIMAPI Panel.PCloud Landscape.png|thumb|150px|Landscape using mandelbrot set]]
  
[[File:SIMAPI Panel.PCloud Torus.png|thumb|150px|Torus rendered with Mode_Solid]]
+
[[File:SIMAPI Panel.PCloud Torus.png|thumb|150px|Torus rendered with Mode_Line]]
  
A [[http://en.wikipedia.org/wiki/Point_cloud|point cloud]] is a series of points that can represent a graph, shape or terrain in Flowcode. All the parameters passed to this function can be altered using specific calls.
+
A [http://en.wikipedia.org/wiki/Point_cloud|<nowiki/>point cloud] is a series of points that can represent a graph, shape or terrain in Flowcode. All the parameters passed to this function can be altered using specific calls.
  
  
Point clouds can either be rendered using a ''chain'' of points, or a ''grid'' of points. There is no difference when displaying with ''Mode_Point'', but for other modes a chain will render each point as though it is connected to the last, where as a grid assumes a 2-dimensional map, and connects each point to the one above and to the right of it.
+
Point clouds can either be rendered using a ''chain'' of points, or a ''grid'' of points. There is no difference when displaying with ''Mode_Point'', but for other modes a chain will render each point as though it is connected to the last, where as a grid assumes a 2-dimensional map, and connects each point to the one above and to the right of it, breaking the sequence at the end of each row of the grid.
  
 
[[File:SIMAPI Panel.PCloud PointOrder.svg|thumb|none|400px|Ordering of points in a chain and grid]]
 
[[File:SIMAPI Panel.PCloud PointOrder.svg|thumb|none|400px|Ordering of points in a chain and grid]]
Line 67: Line 50:
 
* Declare a variable 'result' of type HANDLE
 
* Declare a variable 'result' of type HANDLE
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.PCloud.Create(pos, ::Panel.PCloud.Mode_Point, rgba)</pre>
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.PCloud.Create(pos, ::Panel.PCloud.Mode_Point, rgba)</pre>
 
''<span style="color:red;">No additional examples</span>''
 

Latest revision as of 11:54, 16 January 2023

Fc9-comp-macro.png Create
Creates a new point cloud tied to a position handle 
Fc9-h32-icon.png - HANDLE Pos
The position to display the cloud at 
Fc9-u16-icon.png - UINT DrawMode
The appearance of the points 
Fc9-u32-icon.png - ULONG RGBA
The default colour of the points 
Fc9-h32-icon.png - HANDLE Return


Detailed description

Landscape using mandelbrot set
Torus rendered with Mode_Line

A point cloud is a series of points that can represent a graph, shape or terrain in Flowcode. All the parameters passed to this function can be altered using specific calls.


Point clouds can either be rendered using a chain of points, or a grid of points. There is no difference when displaying with Mode_Point, but for other modes a chain will render each point as though it is connected to the last, where as a grid assumes a 2-dimensional map, and connects each point to the one above and to the right of it, breaking the sequence at the end of each row of the grid.

Ordering of points in a chain and grid


The Pos is a position handle that the point cloud will scale to. The range of a point cloud in any axis is -1 to 1. This means that, for example -1 can be considered far left, and 1 as far right. To automatically scale a point cloud to this range, use UnitScale.


The Pos will be tracked by default. This means that the point cloud will take the shape of the position, and if that position changes at any time, the point cloud will change with it. The SetPos allows this option to be explicitly set.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Panel.PCloud.Create(pos, ::Panel.PCloud.Mode_Point, rgba)