Skip to content

Commit

Permalink
refactor: clean up fake modularization
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Jun 16, 2020
1 parent bd565fb commit bddf273
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ This library is currently in alpha and in midst of significant development. It m
This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a `WebGL` renderer context for the scene and camera, and it adds that viewport to the `document.body` element. Finally, it animates the cube within the scene for the camera.

```typescript
import { box } from "./geometry/primitives/Box";
import { MaterialOutputs } from "./materials/MaterialOutputs";
import { PhysicalMaterial } from "./materials/PhysicalMaterial";
import { PerspectiveCamera } from "./nodes/cameras/PerspectiveCamera";
import { Mesh } from "./nodes/Mesh";
import { Node } from "./nodes/Node";
import { RenderingContext } from "./renderers/webgl2";
import { box } from "@threeify/geometry/primitives/Box";
import { MaterialOutputs } from "@threeify/materials/MaterialOutputs";
import { PhysicalMaterial } from "@threeify/materials/PhysicalMaterial";
import { PerspectiveCamera } from "@threeify/nodes/cameras/PerspectiveCamera";
import { Mesh } from "@threeify/nodes/Mesh";
import { Node } from "@threeify/nodes/Node";
import { RenderingContext } from "@threeify/renderers/webgl2";

const camera = new PerspectiveCamera(70, 0.01, 10);
camera.position.x = 1;
Expand All @@ -48,7 +48,7 @@ const context = new RenderingContext();
const canvasFramebuffer = context.canvasFramebuffer;
document.body.appendChild(canvasFramebuffer.canvas);

function animate() {
function animate(): void {
requestAnimationFrame(animate);

mesh.rotation.x += 0.01;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// TODO: figure out a way to get rid of the long "@threeify" from the includes
import { box } from "@threeify/geometry/primitives/Box";
import { MaterialOutputs } from "@threeify/materials/MaterialOutputs";
import { PhysicalMaterial } from "@threeify/materials/PhysicalMaterial";
Expand Down
1 change: 0 additions & 1 deletion src/examples/testing/testrig1/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// TODO: figure out a way to get rid of the long "@threeify" from the includes
import { box } from "@threeify/geometry/primitives/Box";
import { fetchImage } from "@threeify/io/loaders/Image";
import { PhysicalMaterial } from "@threeify/materials/PhysicalMaterial";
Expand Down

0 comments on commit bddf273

Please sign in to comment.