The Z Rotation in our coCompVec() is currently set to 0, so it will make the Logo face towards us. If it were -1, then it would do the opposite by making the Logo facing away from us. Let's grab the Z Rotation number from our toCompVec(0, 0, 1) Expression. To do that, I have to use square brackets at the end like so: toCompVec(0, 0, 1)[]. I have to specify which index number I want to grab from our toCompVec(0, 0, 1) Expression inside those square brackets. The Z Rotation number is 1. It is the third number from the left; however, the Index considers it as the second number from the left. It can be confusing to understand at first because the Index orders things starting from 0, not from 1. For example: Right now, we have three numbers inside our toCompVec() Expression. Those numbers are 0, 0, 1. The first number in our toCompVec(0, 0, 1) Expression is 0. Naturally, we will probably say that this 0 number is the first number of our Expression. Therefore it must be number 1 since most of us start counting from 1 to whatever. However, the Index doesn't look at the order the same way we do. Index orders things starting from 0. If we have three numbers inside of our toCompVec(0, 0, 1) Expression, the Index will list those numbers from 0 to 3 like so: 0, 1, 2. Let's keep going. The second number is also 0, but the Index looks at it as the first number from the left. Lastly, the third and final number in our Expression is 1, but the Index lists it as the second number. I hope this makes sense. |
No comments:
Post a Comment