Reply To: blender 2.8 pencil’s xray

Forum Archive blender 2.8 pencil’s xray Reply To: blender 2.8 pencil’s xray

#59159
spikeyxxx
Participant

    Thanks @duerer , that is so cool!

    A little additional information (that nobody will want to know…):

    Why in programming languages do they start counting the indices at 0 ???

    Well, if you have for instance an array called ‘layers’, then there is a lookup table (made by the compiler?) which tells the computer the memory address of the first Byte of where that array is stored. What is called the index, is actually an offset from that starting point;

    so, the first element would start at the address:[ layers + (0  times sizeOfElement)], the second at [layers + (1 times sizeOfElement)], etc.

    So every time you see a variable in a program, that is actually an address and changing the value of that variable only changes what is stored at that address, it doesn’t change the address. Constants are different, because they are just assigned a ‘value’, not an address  and are therefore a lot faster to access (in general).