Skip to content

Commit

Permalink
Add rotation parameter to example
Browse files Browse the repository at this point in the history
  • Loading branch information
Ib Green committed Jan 4, 2017
1 parent 70e4b7e commit 4c27064
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 181 deletions.
10 changes: 6 additions & 4 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ class ExampleApp extends React.Component {
hoverChoropleth: null,
clickItem: null,
settings: {
separation: 0
separation: 0,
rotation: 0
}
};

Expand Down Expand Up @@ -386,7 +387,7 @@ class ExampleApp extends React.Component {
}

_renderExamples() {
const {settings: {separation}} = this.state;
const {settings: {separation, rotation}} = this.state;
const props = {
...this.props,
...this.state,
Expand Down Expand Up @@ -427,10 +428,11 @@ class ExampleApp extends React.Component {
// Generate common props
index++;
// const modelMatrix = new Matrix4().fromTranslation([0, 0, 1000 * index * separation]);
layerProps.modelMatrix =
const modelMatrix =
mat4.fromTranslation(mat4.create(), [0, 0, 300 * index * separation, 0]);
mat4.rotateZ(modelMatrix, modelMatrix, index * rotation * Math.PI / 10000);
console.log(layerProps.modelMatrix); // eslint-disable-line

Object.assign(layerProps, {modelMatrix});
/* eslint-enable max-depth */
layers.push(example(layerProps));
}
Expand Down
1 change: 1 addition & 0 deletions example/layer-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class LayerControls extends Component {
<div className="layer-controls" style={{marginTop: 0, padding: 0, width: 270}}>
<h4>Layer Controls</h4>
{this._renderSlider('separation', {}, settings.separation, 'Separation')}
{this._renderSlider('rotation', {}, settings.rotation, 'Rotation')}
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"gl": "^4.0.2",
"highlight.js": "^9.7.0",
"immutable": "^3.7.5",
"luma.gl": "^2.10.3",
"luma.gl": "3.0.0-alpha2",
"marked": "^0.3.6",
"react": "^15.3.2",
"react-addons-test-utils": "^15.0.2",
Expand All @@ -84,7 +84,7 @@
"uglify-js": "^2.6.1"
},
"peerDependencies": {
"luma.gl": "^2.10.3",
"luma.gl": "3.0.0-alpha2",
"react": "0.14.x - 15.x",
"react-dom": "0.14.x - 15.x"
},
Expand Down
Loading

0 comments on commit 4c27064

Please sign in to comment.