This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Elevation Grid Example: Chessboard
A chess board is made of 64 tiles, in a 8x8 grid. The tiles are colored
black and white, so that two tiles sharing a side have different colors.
As far as defining the tiles, The ElevationGrid
for this purpose is as follows:
Example:
geometry ElevationGrid {
xDimension 9
zDimension 9
xSpacing 1
zSpacing 1
height [
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
]
}
Note that the dimensions specified are the number of tiles plus one.
The same goes for the list of heights, there are xDimension x zDimensionheight values specified.
Now we need to define the colors. First set the field colorPerVertex
to FALSE. This implies that the colors defined are applied to each square
of the chessboard, and not to the vertices.
Next set the color field to a Color
node with 64 values, alternating between black and white. The complete
code is as follows:
Example: