» Back To Index
Api Demoniak3D/LUA: Curves control library
HYP_Curve is the library of the LUA API host responsible for the curves management.
These functions make it possible to initialize and modify the properties of a curve object (position of the points, color).
HYP_Curve.GetNumPoints
HYP_Curve.GetValue
HYP_Curve.SetColor
HYP_Curve.SetValue
GetValue
GetValue allows to get the particular coordinates of a point on the curve.
Syntax
x, y, z = HYP_Curve.GetValue( curve_name, index );
- curve_name - [STR127] - name of the curve as defined in the XML script by the "name" attribute.
- index - [INTEGER] - index of the point you want to know the value. The index lies between
0 and HYP_Curve.GetNumPoints()-1.
- x - [REAL] - X coordinate of the point.
- y - [REAL] - Y coordinate of the point.
- z - [REAL] - Z coordinate of the point.
SetValue
SetValue allows to set the value of the punctual coordinates particular of the curve.
Syntax
HYP_Curve.SetValue( curve_name, index, x, y, z );
- curve_name - [STR127] - name of the curve as defined in the XML script by the "name" attribute.
- index - [INTEGER] - index of the point you want to change the value.
The index lies between 0 and HYP_Curve.GetNumPoints()-1.
- x - [REAL] - X coordinate of the point.
- y - [REAL] - Y coordinate of the point.
- z - [REAL] - Z coordinate of the point.
GetNumPoints
GetNumPoints allows to get the number of points of a curve.
This number has been initialized in the XML main script in the curve node.
Syntax
num_points = HYP_Curve.GetNumPoints( curve_name );
- curve_name - [STR127] - name of the curve as defined in the XML script by the "name" attribute.
- num_points - [INTEGER] - number of points of the curve.
SetColor
SetColor allows to change the color of the rendered curve. By default, the value of the rendering color
is green (0.0, 1.0, 0.0).
Syntax
HYP_Curve.SetColor( curve_name, r, b, b );
- curve_name - [STR127] - name of the curve as defined in the XML script by the "name" attribute.
- r - [CLAMPED_REAL] - value of the red component of the color.
- g - [CLAMPED_REAL] - value of the green component of the color.
- b - [CLAMPED_REAL] - value of the blue component of the color.