arcticPigs release V1.0 helpefiles |
![]() |
The Vector Object
The vector object is returned by several properties of other objects, for example the 'base' property of the model-object or the 'diffuseColor' property of the group-object. When you obtain a vector in this manner the vector is in fact a reference to the original property. To stay with the 'base' example, if one has the following line of script
var hRocation = arcticLayer.Models("sus scrofa").base
then the variable 'hRocation' is now linked to the base-location of the model 'sus scrofa'. So if you at any time change this vector it will have an immediate impact on the location of the model. For example
hRocation.Set(0,100,0);
will move the model to the 3D location (0,100,0). For vector values representing colours the same applies; changing any value on the vector will have an immediate effect on the material or light colour in the scene.
Some functions return a vector object that identifies a colour, for example the group::diffuseColor property. For 'vectors' identifying colours you can refer to the red, green and blue components separately. Alternatively you can use the RGB property to set all three components simultaneously.
Name | Type | Description |
---|---|---|
set | ![]() | Sets all three element of the vector. void set(float x , float y, float z) |
blue (float) | ![]() | Sets or retrieves the blue colour component of the colour-vector. |
green (float) | ![]() | Sets or retrieves the green colour component of the colour-vector. |
red (float) | ![]() | Sets or retrieves the red colour component of the colour-vector. |
rgb (Long) | ![]() | Sets or retrieves the RGB colour value of the colour-vector. |
x (float) | ![]() | Sets or retrieves the x coordinate of the vector. |
y (float) | ![]() | Sets or retrieves the y coordinate of the vector. |
z (float) | ![]() | Sets or retrieves the z coordinate of the vector. |
Last Updated: 06/22/02 |