Difference between revisions of "API Panel.Position.GetScale"
(XML import) |
(XML import) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | <sidebar>API | + | <sidebar>API Contents</sidebar> |
− | Returns the positions scale in | + | Returns the positions scale in (X,Y,Z) array |
<div style="width:25%; float:right" class="toc"> | <div style="width:25%; float:right" class="toc"> | ||
Line 11: | Line 11: | ||
==Parameters== | ==Parameters== | ||
− | [[Variable | + | [[Variable Types|HANDLE]] ''Handle'' |
:The position or component to read | :The position or component to read | ||
:''The default value for this parameter is: '''''this''' | :''The default value for this parameter is: '''''this''' | ||
− | [[Variable | + | [[Variable Types|HANDLE]] ''Target'' |
:The position or component to convert relative to | :The position or component to convert relative to | ||
:''The default value for this parameter is: '''''this''' | :''The default value for this parameter is: '''''this''' | ||
Line 21: | Line 21: | ||
==Return value== | ==Return value== | ||
− | [[Variable | + | [[Variable Types|FLOAT[]]] |
− | Returns the positions scale in | + | Returns the positions scale in (X,Y,Z) array |
Line 35: | Line 35: | ||
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.Position.GetScale(handle, target)</pre> | * Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.Position.GetScale(handle, target)</pre> | ||
− | + | ===Flowcode example file=== | |
+ | Download {{Fcfile|SIMAPI_Panel_Position_GetScale.fcfx|SIMAPI_Panel_Position_GetScale}} and open it in Flowcode v6. In this example a yellow sphere, three red spheres that have been grouped together and a LCD are shown on the system panel. When the program starts, the scale of the sphere is returned into an existing Float Array variable containing the width,height & depth values. This is also done for the group of three red spheres. The scale for the sphere and the group of spheres are then displayed on the LCD display. | ||
+ | |||
+ | Important Note: | ||
+ | * Single Objects | ||
+ | It is important to understand that the 3d world within Flowcode version 6 deals with every object having a unit scale of 1. You will see in the example the single sphere object shows a scale of 10,10,10 (also incidentally this is the same size) this is because it has been scaled from a unit scale of 1. Similarly you will notice when you drag on one of the primitive shapes from the system panel, they have a size/scale of 32,32,32 again the object is scaled up from a unit scale of 1. The value 32 has no significant meaning here other than making the primitive initially large enough to see on the system panel, otherwise you would see a very small primitive if it's default value was 1,1,1. | ||
+ | * Grouped objects | ||
+ | When a set of objects are grouped, the group itself becomes an object in it's own right. Note here however, the default scale of the object will be 1,1,1 even though the size/scale of the actual objects contained within the group will be of different size/scale. | ||
+ | |||
+ | |||
+ | Be aware in this example the LCD display is showing integer values. The floats are cast to ints. | ||
+ | The screenshots below show the effect and also highlight the code used by the example. | ||
+ | |||
+ | |||
+ | |||
+ | [[File:SIMAPI_Panel_Position_GetScale_Pic0.png]] |
Latest revision as of 15:57, 16 January 2014
<sidebar>API Contents</sidebar> Returns the positions scale in (X,Y,Z) array
Contents
Parameters
HANDLE Handle
- The position or component to read
- The default value for this parameter is: this
HANDLE Target
- The position or component to convert relative to
- The default value for this parameter is: this
Return value
Returns the positions scale in (X,Y,Z) array
Detailed description
No additional information
Examples
Calling in a calculation
- Declare a variable 'result' of type FLOAT[]
- Add to a calculation icon:
result = ::Panel.Position.GetScale(handle, target)
Flowcode example file
Download SIMAPI_Panel_Position_GetScale and open it in Flowcode v6. In this example a yellow sphere, three red spheres that have been grouped together and a LCD are shown on the system panel. When the program starts, the scale of the sphere is returned into an existing Float Array variable containing the width,height & depth values. This is also done for the group of three red spheres. The scale for the sphere and the group of spheres are then displayed on the LCD display.
Important Note:
- Single Objects
It is important to understand that the 3d world within Flowcode version 6 deals with every object having a unit scale of 1. You will see in the example the single sphere object shows a scale of 10,10,10 (also incidentally this is the same size) this is because it has been scaled from a unit scale of 1. Similarly you will notice when you drag on one of the primitive shapes from the system panel, they have a size/scale of 32,32,32 again the object is scaled up from a unit scale of 1. The value 32 has no significant meaning here other than making the primitive initially large enough to see on the system panel, otherwise you would see a very small primitive if it's default value was 1,1,1.
- Grouped objects
When a set of objects are grouped, the group itself becomes an object in it's own right. Note here however, the default scale of the object will be 1,1,1 even though the size/scale of the actual objects contained within the group will be of different size/scale.
Be aware in this example the LCD display is showing integer values. The floats are cast to ints.
The screenshots below show the effect and also highlight the code used by the example.