Difference between revisions of "Pseudo Mutli-Dimensional Array (3D)"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
In my previous article [[Pseudo_Multi-Dimensional_Array_(2D)]], I discussed how to acheive 2 dimensional array behavior in LSL.
In my previous article [[Pseudo Multi-Dimensional Array]], I discussed how to acheive 2 dimensional array behavior in LSL.  In this article, we will look at doing the same for a 3 dimensional array.


In this article, we will look at doing the same for a 3 dimensional array.
A list is defined as “a heterogeneous list of the other data types”.  It is linear by nature and can be thought of as a single column.
 
At the physical level, arrays are stored in contiguous sections of memory. (Another linear structure)  An algorithm is used to translate between the logical rows and columns and the physical level of addresses.
 
Consider a list with 48 elements.  Normally we visualize this as a vertical column.  In this case, it is convenient to think of them as 2 tables of 4 rows and 6 columns.  Notice we are starting with element 1.  Element zero is reserved for storing the size of the array.

Revision as of 16:30, 21 August 2009

In my previous article Pseudo Multi-Dimensional Array, I discussed how to acheive 2 dimensional array behavior in LSL. In this article, we will look at doing the same for a 3 dimensional array.

A list is defined as “a heterogeneous list of the other data types”. It is linear by nature and can be thought of as a single column.

At the physical level, arrays are stored in contiguous sections of memory. (Another linear structure) An algorithm is used to translate between the logical rows and columns and the physical level of addresses.

Consider a list with 48 elements. Normally we visualize this as a vertical column. In this case, it is convenient to think of them as 2 tables of 4 rows and 6 columns. Notice we are starting with element 1. Element zero is reserved for storing the size of the array.