Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore z coordinates on gl point and polygon features. #963

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@

### Features
- Feature selection API is now enabled automatically if any event handlers are bounds to the feature (#921)
- Added a VTK.js renderer which supports a point feature (#893)
- Added a VTK.js renderer which supports a point feature (#893, #953)

### Improvements
- Coordinate transforms on flat arrays are now faster (#939)
- `convertColor` is memoized to speed up repeated calls (#936)
- All features have a `featureType` property (#931)
- When changing geometry sizes, buffers are reallocated less (#941)
- Initial rendering webGL features is somewhat faster (#943)
- WebGL point and polygon features no longer clip by z coordinates (#963)

### Changes
- Removed the dependency on the vgl module for the `object` and `timestamp` classes (#918)
- CSS color names are obtained from an npm package rather than being defined in the util module (#936)
- Updated several npm modules (#944)
- Report the unmasked renderer used with webgl (#947)
- Width and height are now in the base renderer class (#962)

### Bug Fixes
- Fixed some minor issues with layers (#949)

### Documentation
- Improve documentation (#922, #928, #929, #930, #932, #948, #950, #951, #956, #960, #961)
- Added a point cluster example (#957)
- Editor tutorials keep history in browser (#926)

## Version 0.18.1

### Bug Fixes
Expand Down
14 changes: 3 additions & 11 deletions src/gl/pointFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ var gl_pointFeature = function (arg) {
vpf = m_this.verticesPerFeature(),
data = m_this.data(),
item, ivpf, ivpf3, iunit, i3,
geom = m_mapper.geometryData(), nonzeroZ;
geom = m_mapper.geometryData();

posFunc = m_this.position();
radFunc = m_this.style.get('radius');
Expand All @@ -300,19 +300,11 @@ var gl_pointFeature = function (arg) {
posVal = posFunc(data[i], i);
position[i3] = posVal.x;
position[i3 + 1] = posVal.y;
position[i3 + 2] = posVal.z || 0;
nonzeroZ = nonzeroZ || position[i3 + 2];
// ignore the z values until we support them
position[i3 + 2] = 0; // posVal.z || 0;
}
position = transform.transformCoordinates(
m_this.gcs(), m_this.layer().map().gcs(), position, 3);
/* Some transforms modify the z-coordinate. If we started with all zero z
* coordinates, don't modify them. This could be changed if the
* z-coordinate space of the gl cube is scaled appropriately. */
if (!nonzeroZ && m_this.gcs() !== m_this.layer().map().gcs()) {
for (i = i3 = 0; i < numPts; i += 1, i3 += 3) {
position[i3 + 2] = 0;
}
}

posBuf = util.getGeomBuffer(geom, 'pos', vpf * numPts * 3);

Expand Down
6 changes: 4 additions & 2 deletions src/gl/polygonFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ var gl_polygonFeature = function (arg) {
c = posFunc(outer[i], i, item, itemIndex);
geometry[d3] = c.x;
geometry[d3 + 1] = c.y;
geometry[d3 + 2] = c.z || 0;
// ignore the z values until we support them
geometry[d3 + 2] = 0; // c.z || 0;
}
geometry = {vertices: geometry, dimensions: 3, holes: []};
original = outer;
Expand All @@ -157,7 +158,8 @@ var gl_polygonFeature = function (arg) {
c = posFunc(hole[i], i, item, itemIndex);
geometry.vertices[d3] = c.x;
geometry.vertices[d3 + 1] = c.y;
geometry.vertices[d3 + 2] = c.z || 0;
// ignore the z values until we support them
geometry.vertices[d3 + 2] = 0; // c.z || 0;
}
});
}
Expand Down