Skip to content

Commit

Permalink
Examples
Browse files Browse the repository at this point in the history
Center updates
  • Loading branch information
jasonsturges committed Nov 30, 2024
1 parent 319e78c commit 8ec0e68
Show file tree
Hide file tree
Showing 30 changed files with 73 additions and 73 deletions.
4 changes: 2 additions & 2 deletions examples/animators/emissive-pulse.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { EmissivePulseAnimation, PanelLight, centerMesh } from "../../src/index.js";
import { EmissivePulseAnimation, PanelLight, centerObject } from "../../src/index.js";
import { createOrbitScene } from "../utils/orbitScene.js";

const { scene, camera, handlers } = createOrbitScene();
Expand All @@ -37,7 +37,7 @@
emissive: params.emissive,
});
scene.add(panelLight);
centerMesh(panelLight);
centerObject(panelLight);

const pulseAnimation = new EmissivePulseAnimation({
material: panelLight.material,
Expand Down
6 changes: 3 additions & 3 deletions examples/effects/bubbling.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { BubblingEffect, centerInstancedMesh } from "../../src/index.js";
import { BubblingEffect, centerObject } from "../../src/index.js";
import { createOrbitScene } from "../utils/orbitScene.js";

const { scene, camera, handlers } = createOrbitScene();
Expand Down Expand Up @@ -47,7 +47,7 @@
...params,
});
scene.add(bubblingEffect);
centerInstancedMesh(bubblingEffect);
centerObject(bubblingEffect);
handlers.push(() => bubblingEffect.update());

gui.title("Bubbling Effect");
Expand All @@ -69,7 +69,7 @@
depth: params.depth,
});
scene.add(bubblingEffect);
centerInstancedMesh(bubblingEffect);
centerObject(bubblingEffect);
handlers.push(() => bubblingEffect.update());
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions examples/effects/leaf.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { EllipticLeafGeometry, LeafEffect, centerInstancedMesh } from "../../src/index.js";
import { EllipticLeafGeometry, LeafEffect, centerObject } from "../../src/index.js";
import { createOrbitScene } from "../utils/orbitScene.js";

const { scene, camera, handlers } = createOrbitScene();
Expand Down Expand Up @@ -47,7 +47,7 @@
...params
});
scene.add(leafEffect);
centerInstancedMesh(leafEffect);
centerObject(leafEffect);
handlers.push(() => leafEffect.update());

gui.title("Leaf Effect");
Expand All @@ -69,7 +69,7 @@
depth: params.depth,
});
scene.add(leafEffect);
centerInstancedMesh(leafEffect);
centerObject(leafEffect);
handlers.push(() => leafEffect.update());
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions examples/factory/row-of-books-by-count.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { centerInstancedMesh, rowOfBooksByCount } from "../../src/index.js";
import { centerObject, rowOfBooksByCount } from "../../src/index.js";
import { createOrbitScene } from "../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();
Expand Down Expand Up @@ -65,7 +65,7 @@
...params,
});
mesh.rotation.y = Math.PI / 2;
centerInstancedMesh(mesh);
centerObject(mesh);
scene.add(mesh);
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions examples/factory/row-of-books-by-length.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { centerInstancedMesh, rowOfBooksByLength } from "../../src/index.js";
import { centerObject, rowOfBooksByLength } from "../../src/index.js";
import { createOrbitScene } from "../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();
Expand Down Expand Up @@ -65,7 +65,7 @@
...params,
});
mesh.rotation.y = Math.PI / 2;
centerInstancedMesh(mesh);
centerObject(mesh);
scene.add(mesh);
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions examples/models/books/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { Book, centerMesh } from "../../../src/index.js";
import { Book, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();

let book = new Book();
scene.add(book);
centerMesh(book);
centerObject(book);

// Create the lil-gui panel
const gui = new GUI();
Expand Down Expand Up @@ -57,7 +57,7 @@
coverColor: params.coverColor,
pageColor: params.pageColor,
});
centerMesh(book);
centerObject(book);
scene.add(book);
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions examples/models/bottles/jar.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
</head>
<body>
<script type="module">
import { Jar, centerMesh } from "../../../src/index.js";
import { Jar, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();

const jar = new Jar();
scene.add(jar);
centerMesh(jar);
centerObject(jar);
</script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/models/bottles/potion-bottle.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
</head>
<body>
<script type="module">
import { PotionBottle, centerMesh } from "../../../src/index.js";
import { PotionBottle, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();

const potionBottle = new PotionBottle();
scene.add(potionBottle);
centerMesh(potionBottle);
centerObject(potionBottle);
</script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/models/bottles/wine-bottle.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
</head>
<body>
<script type="module">
import { DaySkybox, WineBottle, centerMesh } from "../../../src/index.js";
import { DaySkybox, WineBottle, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();
scene.add(new DaySkybox());

const wineBottle = new WineBottle();
scene.add(wineBottle);
centerMesh(wineBottle);
centerObject(wineBottle);
</script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/models/cemetery/cross-headstone.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { CrossHeadstone, CrossHeadstoneGeometry, centerMesh } from "../../../src/index.js";
import { CrossHeadstone, CrossHeadstoneGeometry, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();

let crossHeadstone = new CrossHeadstone();
scene.add(crossHeadstone);
centerMesh(crossHeadstone);
centerObject(crossHeadstone);

const gui = new GUI();
const params = {
Expand Down
4 changes: 2 additions & 2 deletions examples/models/cemetery/mausoleum.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
</head>
<body>
<script type="module">
import { Mausoleum, centerMesh } from "../../../src/index.js";
import { Mausoleum, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();
camera.position.set(0, 0, 10);

const mausoleum = new Mausoleum();
scene.add(mausoleum);
centerMesh(mausoleum);
centerObject(mausoleum);
</script>
</body>
</html>
4 changes: 2 additions & 2 deletions examples/models/cemetery/obelisk-headstone.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { ObeliskHeadstone, ObeliskHeadstoneGeometry, centerMesh } from "../../../src/index.js";
import { ObeliskHeadstone, ObeliskHeadstoneGeometry, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();

let crossHeadstone = new ObeliskHeadstone();
scene.add(crossHeadstone);
centerMesh(crossHeadstone);
centerObject(crossHeadstone);

const gui = new GUI();
const params = {
Expand Down
4 changes: 2 additions & 2 deletions examples/models/cemetery/rounded-headstone.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { RoundedHeadstone, RoundedHeadstoneGeometry, centerMesh } from "../../../src/index.js";
import { RoundedHeadstone, RoundedHeadstoneGeometry, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();

let roundedHeadstone = new RoundedHeadstone();
scene.add(roundedHeadstone);
centerMesh(roundedHeadstone);
centerObject(roundedHeadstone);

const gui = new GUI();
const params = {
Expand Down
4 changes: 2 additions & 2 deletions examples/models/cemetery/square-headstone.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { SquareHeadstone, SquareHeadstoneGeometry, centerMesh } from "../../../src/index";
import { SquareHeadstone, SquareHeadstoneGeometry, centerObject } from "../../../src/index";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();

let squareHeadstone = new SquareHeadstone();
scene.add(squareHeadstone);
centerMesh(squareHeadstone);
centerObject(squareHeadstone);

const gui = new GUI();
const params = {
Expand Down
6 changes: 3 additions & 3 deletions examples/models/fence/stone-fence-post.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { centerMesh, StoneFencePost } from "../../../src/index.js";
import { centerObject, StoneFencePost } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();
Expand All @@ -29,7 +29,7 @@

let fenceColumn = new StoneFencePost(params);
scene.add(fenceColumn);
centerMesh(fenceColumn);
centerObject(fenceColumn);

const gui = new GUI();

Expand All @@ -39,7 +39,7 @@
scene.remove(fenceColumn);
fenceColumn = new StoneFencePost(params);
scene.add(fenceColumn);
centerMesh(fenceColumn);
centerObject(fenceColumn);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions examples/models/fence/wrought-iron-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { centerMesh, WroughtIronBar } from "../../../src/index.js";
import { centerObject, WroughtIronBar } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();
Expand All @@ -35,7 +35,7 @@

let wroughtIronBar = new WroughtIronBar(params);
scene.add(wroughtIronBar);
centerMesh(wroughtIronBar);
centerObject(wroughtIronBar);

const gui = new GUI();

Expand All @@ -50,7 +50,7 @@
scene.remove(wroughtIronBar);
wroughtIronBar = new WroughtIronBar(params);
scene.add(wroughtIronBar);
centerMesh(wroughtIronBar);
centerObject(wroughtIronBar);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions examples/models/fence/wrought-iron-fence.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script type="module">
import * as THREE from "three";
import GUI from "lil-gui";
import { centerMesh, WroughtIronFence } from "../../../src/index.js";
import { centerObject, WroughtIronFence } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene } = createOrbitScene();
Expand All @@ -41,7 +41,7 @@

let wroughtIronFence = new WroughtIronFence(params);
scene.add(wroughtIronFence);
centerMesh(wroughtIronFence);
centerObject(wroughtIronFence);

const gui = new GUI();

Expand All @@ -61,7 +61,7 @@
scene.remove(wroughtIronFence);
wroughtIronFence = new WroughtIronFence(params);
scene.add(wroughtIronFence);
centerMesh(wroughtIronFence);
centerObject(wroughtIronFence);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions examples/models/furniture/bookshelf.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<body>
<script type="module">
import GUI from "lil-gui";
import { Bookshelf, centerMesh } from "../../../src/index.js";
import { Bookshelf, centerObject } from "../../../src/index.js";
import { createOrbitScene } from "../../utils/orbitScene.js";

const { scene, camera } = createOrbitScene();
Expand All @@ -34,7 +34,7 @@

let bookshelf = new Bookshelf(params);
scene.add(bookshelf);
centerMesh(bookshelf);
centerObject(bookshelf);

const gui = new GUI();

Expand All @@ -49,7 +49,7 @@
scene.remove(bookshelf);
bookshelf = new Bookshelf(params);
scene.add(bookshelf);
centerMesh(bookshelf);
centerObject(bookshelf);
}
</script>
</body>
Expand Down
Loading

0 comments on commit 8ec0e68

Please sign in to comment.