Skip to content

Commit

Permalink
Merge pull request #4759 from AnalyticalGraphicsInc/vector
Browse files Browse the repository at this point in the history
3D Tiles - Support vectors in the styling language
  • Loading branch information
pjcozzi authored Jan 6, 2017
2 parents 5eb1336 + d76dade commit fd76c00
Show file tree
Hide file tree
Showing 5 changed files with 817 additions and 105 deletions.
14 changes: 7 additions & 7 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
});

addStyle('Min and Max', {
color : "rgb(min(${POSITION}[0], 0.75) * 255, max(${POSITION}[2], 0.25) * 255, 255)",
color : "rgb(min(${POSITION}.x, 0.75) * 255, max(${POSITION}.z, 0.25) * 255, 255)",
pointSize : "5"
});

Expand All @@ -141,12 +141,11 @@

addStyle('Secondary Color', {
color : {
expression : "[${secondaryColor}[0], ${secondaryColor}[1], ${secondaryColor}[2], 1.0]",
conditions : [
["${id} < 250", "${expression}"],
["${id} < 500", "${expression} * ${expression}"],
["${id} < 750", "${expression} / 5.0"],
["${id} < 1000", "rgb(0, 0, Number(${expression}[0] < 0.5) * 255)"]
["${id} < 250", "vec4(${secondaryColor}, 1.0)"],
["${id} < 500", "vec4(${secondaryColor} * ${secondaryColor}, 1.0)"],
["${id} < 750", "vec4(${secondaryColor} / 5.0, 1.0)"],
["${id} < 1000", "rgb(0, 0, Number(${secondaryColor}.x < 0.5) * 255)"]
]
}
});
Expand All @@ -159,8 +158,9 @@
show : "${POSITION}[0] > 0.5 || ${POSITION}[1] > 0.5 || ${POSITION}[2] > 0.5"
});

// POSITION contains 0 as its last component, so add 1.0 to make the point cloud opaque
addStyle('Color based on position', {
color : "rgb(${POSITION}[0] * 255, ${POSITION}[1] * 255, ${POSITION}[2] * 255)"
color : "vec4(${POSITION}, 1.0)"
});

addStyle('Style point size', {
Expand Down
Loading

0 comments on commit fd76c00

Please sign in to comment.