noob question

noob question

Anonymous
Not applicable
203 Views
1 Reply
Message 1 of 2

noob question

Anonymous
Not applicable
why is it that when you assigning a position date to a property, you use [] but when you assign colors, you use ()

e.g. mybox.wirecolor=(colour 1 1 1) and mybox.pos =

surely both are an array of three parameters? Why mix up the notations and why use comas for one and not for the other? Am I missing something?
0 Likes
204 Views
1 Reply
Reply (1)
Message 2 of 2

Steve_Curley
Mentor
Mentor
The parentheses are not required in the mybox.wirecolor statement because color is a constructor taking 3 (4 if you provide an alpha) values returning a single color value. There are occasions, however, where you will find that you need to enclose the whole color part of the statement in parentheses. Try entering
 print color 1 2 3 
into the listener, then try with parentheses around the color 1 2 3 part.
The brackets in the mybox.pos statement are required to force the 3 values to be treated as an array (actually a point3 value).
Note that the location of the parentheses and brackets are different (in the 2 statements).

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes