Skip to content

Commit

Permalink
docs: add origin parameters to the sample page.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciopoppe committed Jul 27, 2024
1 parent 5a75ffd commit 516a3f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ let camera, controls, scene, renderer
const params = {
nPoints: 100,
domain: 100,
originX: 0,
originY: 0,
originZ: 0,
timeToCompute: 'please check console!'
}

Expand All @@ -25,7 +28,7 @@ function generatePointCloud() {
}

function pointGenerator() {
return [p(), p(), p()]
return [params.originX + p(), params.originY + p(), params.originZ + p()]
}

const points = []
Expand Down Expand Up @@ -126,9 +129,16 @@ function init() {
const ambientLight = new THREE.AmbientLight(0x555555)
scene.add(ambientLight)

// helpers
const axesHelper = new THREE.AxesHelper(5)
scene.add(axesHelper)

const gui = new GUI()
gui.add(params, 'nPoints', 10, 1000).onChange(() => rebuild(group))
gui.add(params, 'domain', 50, 150).onChange(() => rebuild(group))
gui.add(params, 'originX', -100, 100).onChange(() => rebuild(group))
gui.add(params, 'originY', -100, 100).onChange(() => rebuild(group))
gui.add(params, 'originZ', -100, 100).onChange(() => rebuild(group))
gui.add(params, 'timeToCompute')

window.addEventListener('resize', onWindowResize)
Expand Down

0 comments on commit 516a3f1

Please sign in to comment.